laura is hosted by Hepforge, IPPP Durham
Laura++  v3r1
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  Double_t getMinX() const {return minX_;}
55 
57  Double_t getMaxX() const {return maxX_;}
58 
60  Double_t getRangeX() const {return rangeX_;}
61 
63  Double_t getMinY() const {return minY_;}
64 
66  Double_t getMaxY() const {return maxY_;}
67 
69  Double_t getRangeY() const {return rangeY_;}
70 
72 
75  virtual void cacheInfo(const LauFitDataTree& inputData);
76 
78 
81  virtual void calcLikelihoodInfo(const LauAbscissas& abscissas);
82 
84 
87  virtual void calcLikelihoodInfo(UInt_t iEvt);
88 
89 
91 
95  virtual Double_t getLikelihood( const TString& theVarName ) const;
97 
99  virtual void calcNorm();
100 
102 
105  virtual void calcPDFHeight( const LauKinematics* kinematics );
106 
108 
112  virtual LauFitData generate(const LauKinematics* kinematics);
113 
114  protected:
116  void doBinFluctuation();
117 
119  void checkNormalisation();
120 
122 
127  Double_t getBinHistValue(Int_t i, Int_t j) const;
128 
130 
135  Double_t interpolateXY(Double_t x, Double_t y) const;
136 
138 
143  Double_t interpolateXYNorm(Double_t x, Double_t y) const;
144 
145  private:
147  Lau2DHistPdf(const Lau2DHistPdf& other);
148 
150  Lau2DHistPdf& operator=(const Lau2DHistPdf& other);
151 
153  TH2* hist_;
155  TH1* xProj_;
157  TH1* yProj_;
158 
163 
165  TString xName_;
167  TString yName_;
168 
170  Int_t nBinsX_;
172  Int_t nBinsY_;
174  Double_t minX_;
176  Double_t maxX_;
178  Double_t minY_;
180  Double_t maxY_;
182  Double_t rangeX_;
184  Double_t rangeY_;
185 
187  Double_t binXWidth_;
189  Double_t binYWidth_;
190 
192  Double_t invBinXWidth_;
194  Double_t invBinYWidth_;
195 
200 
201  ClassDef(Lau2DHistPdf,0) // 2D histogram pdf class
202 };
203 
204 #endif
Double_t getMinX() const
Get the minimum value of x-axis abscissa.
Definition: Lau2DHistPdf.hh:54
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:60
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:69
Double_t getMaxX() const
Get the maximum value of x-axis abscissa.
Definition: Lau2DHistPdf.hh:57
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:63
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:66
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.