laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
A maximum likelihood fitting package for performing Dalitz-plot analysis.
Lau2DHistPdf.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 
38 #ifndef LAU_2DHIST_PDF
39 #define LAU_2DHIST_PDF
40 
41 #include "LauAbsPdf.hh"
42 
43 class TH2;
44 class TH1;
45 class Lau1DHistPdf;
46 
47 class Lau2DHistPdf : public LauAbsPdf {
48 
49  public:
51 
60  Lau2DHistPdf(const std::vector<TString>& theVarNames, const TH2* hist,
61  const LauFitData& minVals, const LauFitData& maxVals,
62  Bool_t useInterpolation = kTRUE, Bool_t fluctuateBins = kFALSE);
63 
65  virtual ~Lau2DHistPdf();
66 
68  Double_t getMinX() const {return minX_;}
69 
71  Double_t getMaxX() const {return maxX_;}
72 
74  Double_t getRangeX() const {return rangeX_;}
75 
77  Double_t getMinY() const {return minY_;}
78 
80  Double_t getMaxY() const {return maxY_;}
81 
83  Double_t getRangeY() const {return rangeY_;}
84 
86 
89  virtual void cacheInfo(const LauFitDataTree& inputData);
90 
92 
95  virtual void calcLikelihoodInfo(const LauAbscissas& abscissas);
96 
98 
101  virtual void calcLikelihoodInfo(UInt_t iEvt);
102 
103 
105 
109  virtual Double_t getLikelihood( const TString& theVarName ) const;
111 
113  virtual void calcNorm();
114 
116 
119  virtual void calcPDFHeight( const LauKinematics* kinematics );
120 
122 
126  virtual LauFitData generate(const LauKinematics* kinematics);
127 
128  protected:
130  void doBinFluctuation();
131 
133  void checkNormalisation();
134 
136 
141  Double_t getBinHistValue(Int_t i, Int_t j) const;
142 
144 
149  Double_t interpolateXY(Double_t x, Double_t y) const;
150 
152 
157  Double_t interpolateXYNorm(Double_t x, Double_t y) const;
158 
159  private:
161  Lau2DHistPdf(const Lau2DHistPdf& other);
162 
164  Lau2DHistPdf& operator=(const Lau2DHistPdf& other);
165 
167  TH2* hist_;
169  TH1* xProj_;
171  TH1* yProj_;
172 
177 
179  TString xName_;
181  TString yName_;
182 
184  Int_t nBinsX_;
186  Int_t nBinsY_;
188  Double_t minX_;
190  Double_t maxX_;
192  Double_t minY_;
194  Double_t maxY_;
196  Double_t rangeX_;
198  Double_t rangeY_;
199 
201  Double_t binXWidth_;
203  Double_t binYWidth_;
204 
206  Double_t invBinXWidth_;
208  Double_t invBinYWidth_;
209 
214 
215  ClassDef(Lau2DHistPdf,0) // 2D histogram pdf class
216 };
217 
218 #endif
Double_t getMinX() const
Get the minimum value of x-axis abscissa.
Definition: Lau2DHistPdf.hh:68
Lau1DHistPdf * xVarPdf_
1D PDF for x variable
Double_t interpolateXY(Double_t x, Double_t y) const
Perform the interpolation (unnormalised)
Double_t getRangeX() const
Get the range of x-axis abscissa values.
Definition: Lau2DHistPdf.hh:74
Bool_t useInterpolation_
Control boolean for using the linear interpolation.
Double_t interpolateXYNorm(Double_t x, Double_t y) const
Perform the interpolation and divide by the normalisation.
void checkNormalisation()
Check the normalisation calculation.
virtual void cacheInfo(const LauFitDataTree &inputData)
Cache information from data.
TH2 * hist_
The underlying histogram.
Double_t invBinXWidth_
The histogram x-axis inverse bin width.
Class for defining a 1D histogram PDF.
Definition: Lau1DHistPdf.hh:45
Class for defining a 2D histogram PDF.
Definition: Lau2DHistPdf.hh:47
Double_t minY_
The histogram y-axis minimum.
std::map< TString, Double_t > LauFitData
Type for holding event data.
virtual LauFitData generate(const LauKinematics *kinematics)
Generate an event from the PDF.
Double_t getRangeY() const
Get the range of y-axis abscissa values.
Definition: Lau2DHistPdf.hh:83
Double_t getMaxX() const
Get the maximum value of x-axis abscissa.
Definition: Lau2DHistPdf.hh:71
Lau2DHistPdf & operator=(const Lau2DHistPdf &other)
Copy assignment operator (not implemented)
void doBinFluctuation()
Fluctuate the histogram bin contents in accordance with their errors.
TString xName_
x variable name
virtual ~Lau2DHistPdf()
Destructor.
Double_t getMinY() const
Get the minimum value of y-axis abscissa.
Definition: Lau2DHistPdf.hh:77
virtual void calcLikelihoodInfo(const LauAbscissas &abscissas)
Calculate the likelihood (and intermediate info) for a given value of the abscissas.
TH1 * yProj_
Projection of histogram y-axis.
Double_t binYWidth_
The histogram y-axis bin width.
Bool_t fluctuateBins_
Control boolean for performing the fluctuation of the histogram bin contents.
Double_t getBinHistValue(Int_t i, Int_t j) const
Get the bin content from the histogram.
TH1 * xProj_
Projection of histogram x-axis.
Lau1DHistPdf * yVarPdf_
1D PDF for y variable
virtual void calcPDFHeight(const LauKinematics *kinematics)
Calculate the PDF height.
Double_t binXWidth_
The histogram x-axis bin width.
File containing declaration of LauAbsPdf class.
virtual void calcNorm()
Calculate the normalisation.
Double_t maxX_
The histogram x-axis maximum.
virtual Double_t getLikelihood() const
Retrieve the normalised likelihood value.
Definition: LauAbsPdf.cc:368
Double_t invBinYWidth_
The histogram y-axis inverse bin width.
Double_t minX_
The histogram x-axis minimum.
Class for defining the abstract interface for PDF classes.
Definition: LauAbsPdf.hh:55
Class for calculating 3-body kinematic quantities.
TString yName_
y variable name
Double_t maxY_
The histogram y-axis maximum.
Double_t getMaxY() const
Get the maximum value of y-axis abscissa.
Definition: Lau2DHistPdf.hh:80
Lau2DHistPdf(const std::vector< TString > &theVarNames, const TH2 *hist, const LauFitData &minVals, const LauFitData &maxVals, Bool_t useInterpolation=kTRUE, Bool_t fluctuateBins=kFALSE)
Constructor.
Definition: Lau2DHistPdf.cc:47
Double_t rangeX_
The histogram x-axis range.
Class to store the input fit variables.
std::vector< Double_t > LauAbscissas
The type used for containing multiple abscissa values.
Definition: LauAbsPdf.hh:59
Int_t nBinsX_
The number of bins on the x-axis of the histogram.
Int_t nBinsY_
The number of bins on the y-axis of the histogram.
Double_t rangeY_
The histogram y-axis range.