laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
A maximum likelihood fitting package for performing Dalitz-plot analysis.
LauCalcChiSq.hh
Go to the documentation of this file.
1 
2 /*
3 Copyright 2008 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 "TH2Poly.h"
26 #include "TString.h"
27 
28 #include <vector>
29 
50 class LauCalcChiSq {
51 
52  public:
53 
55 
58  LauCalcChiSq(const TString& inputFileName = "chiSqInput.txt");
59 
61  virtual ~LauCalcChiSq();
62 
64 
67  inline void setVerbose(const Bool_t flag) {verbose_ = flag;}
68 
70  void run();
71 
72  private:
74  void initialiseHistos();
75 
77 
83  void pickBinning(const Double_t* xs, const Double_t* ys, const Int_t nEntries, std::vector<Int_t>& divisions);
84 
86 
99  void getHisto(const Double_t xMin, const Double_t xMax, const Double_t yMin, const Double_t yMax, const Double_t* xs, const Double_t* ys, const Int_t nEntries, const std::vector<Int_t>& divisions, const UInt_t iter=0);
100 
102  void calculateChiSq();
103 
105  void makePlots();
106 
108  TString inputFileName_;
109 
111  TString fileName1_;
113  TString fileName2_;
115  TString treeName1_;
117  TString treeName2_;
118 
120  TString xName1_;
122  TString xName2_;
124  TString yName1_;
126  TString yName2_;
127 
129  Float_t minContent_;
130 
132  TH2Poly* theHisto_;
134  TH2Poly* histo1_;
136  TH2Poly* histo2_;
138  TH2Poly* pullHisto_;
140  TH2Poly* chiSqHisto_;
143 
145  Float_t xMin_;
147  Float_t xMax_;
149  Float_t yMin_;
151  Float_t yMax_;
152 
154  Int_t nParams_;
155 
157  Float_t scaleFactor_;
158 
160  Bool_t verbose_;
161 
162  ClassDef(LauCalcChiSq,0)
163 };
TH2Poly * chiSqSignedHisto_
Histogram (constructed from template) filled with signed chisq of tree1 vs tree2. ...
TString treeName2_
Name of the high stats data tree.
TString xName1_
Name of the x-coordinate branch in tree 1.
Bool_t verbose_
Verbose flag.
Int_t nParams_
Number of free parameters in fit (used for calculating the ndof)
void getHisto(const Double_t xMin, const Double_t xMax, const Double_t yMin, const Double_t yMax, const Double_t *xs, const Double_t *ys, const Int_t nEntries, const std::vector< Int_t > &divisions, const UInt_t iter=0)
Create the template histogram based on the binning scheme.
void setVerbose(const Bool_t flag)
Toggle verbose printout.
Definition: LauCalcChiSq.hh:67
void calculateChiSq()
Calculate the chisq from the data histograms.
Float_t yMax_
Maximum y coordinate of histograms.
Float_t xMax_
Maximum x coordinate of histograms.
TString yName1_
Name of the y-coordinate branch in tree 1.
TString fileName2_
Name of the high stats data file.
TH2Poly * histo1_
Histogram (constructed from template) filled from tree 1.
TString fileName1_
Name of the low stats data file.
TH2Poly * pullHisto_
Histogram (constructed from template) filled with pulls of tree1 vs tree2.
void run()
Run the calculations.
Float_t yMin_
Minimum y coordinate of histograms.
Float_t xMin_
Minimum x coordinate of histograms.
TString xName2_
Name of the x-coordinate branch in tree 2.
TString inputFileName_
Name of the config file.
TH2Poly * theHisto_
Template histogram constructed from the binning scheme.
void pickBinning(const Double_t *xs, const Double_t *ys, const Int_t nEntries, std::vector< Int_t > &divisions)
Choose the binning scheme.
void initialiseHistos()
Read the config file, read the data and create histograms.
Utility class to allow the calculation of the chisq of the fit to the Dalitz plot.
Definition: LauCalcChiSq.hh:50
TH2Poly * histo2_
Histogram (constructed from template) filled from tree 2.
TString treeName1_
Name of the low stats data tree.
Float_t scaleFactor_
Scalefactor between low and high stats data samples.
TH2Poly * chiSqHisto_
Histogram (constructed from template) filled with chisq of tree1 vs tree2.
virtual ~LauCalcChiSq()
Destructor.
Definition: LauCalcChiSq.cc:96
TString yName2_
Name of the y-coordinate branch in tree 2.
LauCalcChiSq(const TString &inputFileName="chiSqInput.txt")
Constructor.
Definition: LauCalcChiSq.cc:71
Float_t minContent_
The minimum bin content.
void makePlots()
Create plots.