laura is hosted by Hepforge, IPPP Durham
Laura++  3.6.0
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 "TString.h"
26 
27 #include <map>
28 #include <vector>
29 
30 class TChain;
31 class TFile;
32 class TH1;
33 class TTree;
34 
52  public:
54 
59  LauResultsExtractor( const TString& inputFileName,
60  const TString& outputFileName,
61  const TString& treeName );
62 
64  virtual ~LauResultsExtractor();
65 
67 
70  void process( const Int_t numExpts );
71 
72  protected:
74  void setupInputTree();
76  void setupOutputTree( TTree* tree );
78  void setInputTreeBranchStatus( const Bool_t status );
80  void clearMaps();
82  void writeFile();
83 
84  private:
86  TString inputFileName_;
88  TString outputFileName_;
90  TString treeName_;
91 
93  TChain* inputTree_;
94 
96  TFile* outputFile_;
98  TTree* outputTree_;
99 
101  Int_t nEntries_;
102 
103  // Tree variables
105  Int_t iExpt_;
107  Int_t fitStatus_;
109  Double_t NLL_;
111  Double_t EDM_;
113  std::map<TString, Double_t> otherVars_;
114 
116  std::map<Int_t, std::pair<Double_t, Int_t>> bestNLL_;
118  std::map<Int_t, std::pair<Double_t, Int_t>> worstNLL_;
120  std::map<Int_t, std::vector<Double_t>> allNLLs_;
121 
123  std::map<Int_t, TH1*> nllHistos_;
124 
125  ClassDef( LauResultsExtractor, 0 )
126 };
TString outputFileName_
Name of output ROOT file.
std::map< Int_t, std::vector< Double_t > > allNLLs_
All NLL values for each experiment.
Int_t iExpt_
Storage for experiment ID variable.
void setupInputTree()
Create storage for leaves and call SetBranchAddress for each.
TString inputFileName_
Name of text file containing list of input files.
std::map< TString, Double_t > otherVars_
Storage for other input variables.
std::map< Int_t, std::pair< Double_t, Int_t > > bestNLL_
Best NLL and corresponding tree entries for each experiment.
TTree * outputTree_
Output tree.
Int_t nEntries_
Number of entries in the input chain.
LauResultsExtractor(const TString &inputFileName, const TString &outputFileName, const TString &treeName)
Constructor.
Double_t NLL_
Storage for NLL variable.
Double_t EDM_
Storage for EDM variable.
void setupOutputTree(TTree *tree)
Create branches in the output tree.
TFile * outputFile_
Output file.
std::map< Int_t, std::pair< Double_t, Int_t > > worstNLL_
Worst NLL and corresponding tree entries for each experiment.
virtual ~LauResultsExtractor()
Destructor.
void writeFile()
Write the output file.
TChain * inputTree_
Chain of inputs.
std::map< Int_t, TH1 * > nllHistos_
Histograms of the NLL values for each experiment.
TString treeName_
Name of tree in input ROOT files.
void process(const Int_t numExpts)
Run the calculations.
void setInputTreeBranchStatus(const Bool_t status)
Toggle branch status of input tree branches (except iExpt, fitStatus and NLL)
Int_t fitStatus_
Storage for fit status variable.
void clearMaps()
Clear all information.
Utility class to allow the extraction of the best fit from a series of fits to a given data sample.