laura is hosted by Hepforge, IPPP Durham
Laura++  3.6.0
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:
54 
57  LauCalcChiSq( const TString& inputFileName = "chiSqInput.txt" );
58 
60  virtual ~LauCalcChiSq();
61 
63 
66  inline void setVerbose( const Bool_t flag ) { verbose_ = flag; }
67 
69  void run();
70 
71  private:
73  void initialiseHistos();
74 
76 
82  void pickBinning( const Double_t* xs,
83  const Double_t* ys,
84  const Int_t nEntries,
85  std::vector<Int_t>& divisions );
86 
88 
101  void getHisto( const Double_t xMin,
102  const Double_t xMax,
103  const Double_t yMin,
104  const Double_t yMax,
105  const Double_t* xs,
106  const Double_t* ys,
107  const Int_t nEntries,
108  const std::vector<Int_t>& divisions,
109  const UInt_t iter = 0 );
110 
112  void calculateChiSq();
113 
115  void makePlots();
116 
118  TString inputFileName_;
119 
121  TString fileName1_;
123  TString fileName2_;
125  TString treeName1_;
127  TString treeName2_;
128 
130  TString xName1_;
132  TString xName2_;
134  TString yName1_;
136  TString yName2_;
137 
139  Float_t minContent_;
140 
142  TH2Poly* theHisto_;
144  TH2Poly* histo1_;
146  TH2Poly* histo2_;
148  TH2Poly* pullHisto_;
150  TH2Poly* chiSqHisto_;
153 
155  Float_t xMin_;
157  Float_t xMax_;
159  Float_t yMin_;
161  Float_t yMax_;
162 
164  Int_t nParams_;
165 
167  Float_t scaleFactor_;
168 
170  Bool_t verbose_;
171 
172  ClassDef( LauCalcChiSq, 0 )
173 };
void makePlots()
Create plots.
void run()
Run the calculations.
Definition: LauCalcChiSq.cc:95
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.
TString treeName2_
Name of the high stats data tree.
Float_t xMax_
Maximum x coordinate of histograms.
TH2Poly * histo1_
Histogram (constructed from template) filled from tree 1.
TH2Poly * theHisto_
Template histogram constructed from the binning scheme.
void setVerbose(const Bool_t flag)
Toggle verbose printout.
Definition: LauCalcChiSq.hh:66
TString inputFileName_
Name of the config file.
TH2Poly * pullHisto_
Histogram (constructed from template) filled with pulls of tree1 vs tree2.
virtual ~LauCalcChiSq()
Destructor.
Definition: LauCalcChiSq.cc:91
TString yName1_
Name of the y-coordinate branch in tree 1.
TString treeName1_
Name of the low stats data tree.
Float_t minContent_
The minimum bin content.
Float_t xMin_
Minimum x coordinate of histograms.
TString xName1_
Name of the x-coordinate branch in tree 1.
Bool_t verbose_
Verbose flag.
Utility class to allow the calculation of the chisq of the fit to the Dalitz plot.
Definition: LauCalcChiSq.hh:50
void initialiseHistos()
Read the config file, read the data and create histograms.
Int_t nParams_
Number of free parameters in fit (used for calculating the ndof)
TH2Poly * histo2_
Histogram (constructed from template) filled from tree 2.
Float_t yMin_
Minimum y coordinate of histograms.
Float_t yMax_
Maximum y coordinate of histograms.
void calculateChiSq()
Calculate the chisq from the data histograms.
LauCalcChiSq(const TString &inputFileName="chiSqInput.txt")
Constructor.
Definition: LauCalcChiSq.cc:66
TString xName2_
Name of the x-coordinate branch in tree 2.
TString yName2_
Name of the y-coordinate branch in tree 2.
void pickBinning(const Double_t *xs, const Double_t *ys, const Int_t nEntries, std::vector< Int_t > &divisions)
Choose the binning scheme.
TString fileName2_
Name of the high stats data file.
Float_t scaleFactor_
Scalefactor between low and high stats data samples.
TH2Poly * chiSqHisto_
Histogram (constructed from template) filled with chisq of tree1 vs tree2.
TH2Poly * chiSqSignedHisto_
Histogram (constructed from template) filled with signed chisq of tree1 vs tree2.
TString fileName1_
Name of the low stats data file.