laura is hosted by Hepforge, IPPP Durham
Laura++  v2r1
A maximum likelihood fitting package for performing Dalitz-plot analysis.
Lau2DHistPdf.hh
Go to the documentation of this file.
1 
2 // Copyright University of Warwick 2008 - 2013.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 // Authors:
7 // Thomas Latham
8 // John Back
9 // Paul Harrison
10 
24 #ifndef LAU_2DHIST_PDF
25 #define LAU_2DHIST_PDF
26 
27 #include "LauAbsPdf.hh"
28 
29 class TH2;
30 class TH1;
31 class Lau1DHistPdf;
32 
33 class Lau2DHistPdf : public LauAbsPdf {
34 
35  public:
37 
46  Lau2DHistPdf(const std::vector<TString>& theVarNames, const TH2* hist,
47  const LauFitData& minVals, const LauFitData& maxVals,
48  Bool_t useInterpolation = kTRUE, Bool_t fluctuateBins = kFALSE);
49 
51  virtual ~Lau2DHistPdf();
52 
54  Lau2DHistPdf(const Lau2DHistPdf& other);
55 
57  Double_t getMinX() const {return minX_;}
58 
60  Double_t getMaxX() const {return maxX_;}
61 
63  Double_t getRangeX() const {return rangeX_;}
64 
66  Double_t getMinY() const {return minY_;}
67 
69  Double_t getMaxY() const {return maxY_;}
70 
72  Double_t getRangeY() const {return rangeY_;}
73 
75 
78  virtual void cacheInfo(const LauFitDataTree& inputData);
79 
81 
84  virtual void calcLikelihoodInfo(const LauAbscissas& abscissas);
85 
87 
90  virtual void calcLikelihoodInfo(UInt_t iEvt);
91 
92 
94 
98  virtual Double_t getLikelihood( const TString& theVarName ) const;
100 
102  virtual void calcNorm();
103 
105 
108  virtual void calcPDFHeight( const LauKinematics* kinematics );
109 
111 
115  virtual LauFitData generate(const LauKinematics* kinematics);
116 
117  protected:
119  void doBinFluctuation();
120 
122  void checkNormalisation();
123 
125 
130  Double_t getBinHistValue(Int_t i, Int_t j) const;
131 
133 
138  Double_t interpolateXY(Double_t x, Double_t y) const;
139 
141 
146  Double_t interpolateXYNorm(Double_t x, Double_t y) const;
147 
148  private:
150  TH2* hist_;
152  TH1* xProj_;
154  TH1* yProj_;
155 
160 
162  TString xName_;
164  TString yName_;
165 
167  Int_t nBinsX_;
169  Int_t nBinsY_;
171  Double_t minX_;
173  Double_t maxX_;
175  Double_t minY_;
177  Double_t maxY_;
179  Double_t rangeX_;
181  Double_t rangeY_;
182 
184  Double_t binXWidth_;
186  Double_t binYWidth_;
187 
189  Double_t invBinXWidth_;
191  Double_t invBinYWidth_;
192 
197 
198  ClassDef(Lau2DHistPdf,0) // 2D histogram pdf class
199 };
200 
201 #endif
Double_t getMinX() const
Get the minimum value of x-axis abscissa.
Definition: Lau2DHistPdf.hh:57
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:63
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:31
Class for defining a 2D histogram PDF.
Definition: Lau2DHistPdf.hh:33
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:72
Double_t getMaxX() const
Get the maximum value of x-axis abscissa.
Definition: Lau2DHistPdf.hh:60
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:66
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:354
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:41
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:69
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:33
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:45
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.