laura is hosted by Hepforge, IPPP Durham
Laura++  v1r2
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 
45  Lau2DHistPdf(const std::vector<TString>& theVarNames, const TH2* hist,
46  const LauFitData& minVals, const LauFitData& maxVals,
47  Bool_t useInterpolation = kTRUE, Bool_t fluctuateBins = kFALSE);
48 
50  virtual ~Lau2DHistPdf();
51 
53  Lau2DHistPdf(const Lau2DHistPdf& other);
54 
56  Double_t getMinX() const {return minX_;}
57 
59  Double_t getMaxX() const {return maxX_;}
60 
62  Double_t getRangeX() const {return rangeX_;}
63 
65  Double_t getMinY() const {return minY_;}
66 
68  Double_t getMaxY() const {return maxY_;}
69 
71  Double_t getRangeY() const {return rangeY_;}
72 
74 
77  virtual void cacheInfo(const LauFitDataTree& inputData);
78 
80 
83  virtual void calcLikelihoodInfo(const LauAbscissas& abscissas);
84 
86 
89  virtual void calcLikelihoodInfo(UInt_t iEvt);
90 
91 
93 
97  virtual Double_t getLikelihood( const TString& theVarName ) const;
99 
101 
105  virtual void checkPositiveness() {}; // Nothing to check here.
106 
108  virtual void calcNorm();
109 
111 
114  virtual void calcPDFHeight( const LauKinematics* kinematics );
115 
117 
121  virtual LauFitData generate(const LauKinematics* kinematics);
122 
123  protected:
125  void doBinFluctuation();
126 
128  void checkNormalisation();
129 
131 
136  Double_t getBinHistValue(Int_t i, Int_t j) const;
137 
139 
144  Double_t interpolateXY(Double_t x, Double_t y) const;
145 
147 
152  Double_t interpolateXYNorm(Double_t x, Double_t y) const;
153 
154  private:
156  TH2* hist_;
158  TH1* xProj_;
160  TH1* yProj_;
161 
166 
168  TString xName_;
170  TString yName_;
171 
173  Int_t nBinsX_;
175  Int_t nBinsY_;
177  Double_t minX_;
179  Double_t maxX_;
181  Double_t minY_;
183  Double_t maxY_;
185  Double_t rangeX_;
187  Double_t rangeY_;
188 
190  Double_t binXWidth_;
192  Double_t binYWidth_;
193 
195  Double_t invBinXWidth_;
197  Double_t invBinYWidth_;
198 
203 
204  ClassDef(Lau2DHistPdf,0) // 2D histogram pdf class
205 };
206 
207 #endif
Double_t getMinX() const
Get the minimum value of x-axis abscissa.
Definition: Lau2DHistPdf.hh:56
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:62
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:71
Double_t getMaxX() const
Get the maximum value of x-axis abscissa.
Definition: Lau2DHistPdf.hh:59
void doBinFluctuation()
Fluctuate the histogram bin contents in accordance with their errors.
virtual void checkPositiveness()
Check that PDF is positive.
TString xName_
x variable name
virtual ~Lau2DHistPdf()
Destructor.
Double_t getMinY() const
Get the minimum value of y-axis abscissa.
Definition: Lau2DHistPdf.hh:65
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:40
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:68
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:44
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.