laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauResultsExtractor.hh
Go to the documentation of this file.
1 
2 /*
3 Copyright 2005 University of Warwick
4 
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8 
9  http://www.apache.org/licenses/LICENSE-2.0
10 
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16 */
17 
18 /*
19 Laura++ package authors:
20 John Back
21 Paul Harrison
22 Thomas Latham
23 */
24 
25 #include <map>
26 #include <vector>
27 
28 #include "TString.h"
29 
30 class TChain;
31 class TFile;
32 class TH1;
33 class TTree;
34 
52 {
53  public:
55 
60  LauResultsExtractor(const TString& inputFileName, const TString& outputFileName, const TString& treeName);
61 
63  virtual ~LauResultsExtractor();
64 
66 
69  void process(const Int_t numExpts);
70 
71  protected:
73  void setupInputTree();
75  void setupOutputTree(TTree * tree);
77  void setInputTreeBranchStatus(const Bool_t status);
79  void clearMaps();
81  void writeFile();
82 
83  private:
85  TString inputFileName_;
87  TString outputFileName_;
89  TString treeName_;
90 
92  TChain * inputTree_;
93 
95  TFile * outputFile_;
97  TTree * outputTree_;
98 
100  Int_t nEntries_;
101 
102  // Tree variables
104  Int_t iExpt_;
106  Int_t fitStatus_;
108  Double_t NLL_;
110  Double_t EDM_;
112  std::map<TString,Double_t> otherVars_;
113 
115  std::map< Int_t, std::pair<Double_t,Int_t> > bestNLL_;
117  std::map< Int_t, std::pair<Double_t,Int_t> > worstNLL_;
119  std::map< Int_t, std::vector<Double_t> > allNLLs_;
120 
122  std::map< Int_t, TH1* > nllHistos_;
123 
124  ClassDef(LauResultsExtractor,0)
125 };
126 
void setInputTreeBranchStatus(const Bool_t status)
Toggle branch status of input tree branches (except iExpt, fitStatus and NLL)
void process(const Int_t numExpts)
Run the calculations.
TFile * outputFile_
Output file.
Int_t fitStatus_
Storage for fit status variable.
void setupOutputTree(TTree *tree)
Create branches in the output tree.
void setupInputTree()
Create storage for leaves and call SetBranchAddress for each.
TTree * outputTree_
Output tree.
TString inputFileName_
Name of text file containing list of input files.
std::map< Int_t, std::pair< Double_t, Int_t > > bestNLL_
Best NLL and corresponding tree entries for each experiment.
virtual ~LauResultsExtractor()
Destructor.
Int_t nEntries_
Number of entries in the input chain.
std::map< Int_t, std::vector< Double_t > > allNLLs_
All NLL values for each experiment.
TString outputFileName_
Name of output ROOT file.
void writeFile()
Write the output file.
std::map< Int_t, TH1 * > nllHistos_
Histograms of the NLL values for each experiment.
Double_t EDM_
Storage for EDM variable.
std::map< Int_t, std::pair< Double_t, Int_t > > worstNLL_
Worst NLL and corresponding tree entries for each experiment.
Int_t iExpt_
Storage for experiment ID variable.
std::map< TString, Double_t > otherVars_
Storage for other input variables.
LauResultsExtractor(const TString &inputFileName, const TString &outputFileName, const TString &treeName)
Constructor.
Double_t NLL_
Storage for NLL variable.
void clearMaps()
Clear all information.
TString treeName_
Name of tree in input ROOT files.
TChain * inputTree_
Chain of inputs.
Utility class to allow the merging of data files on a expt-by-expt basis.