laura is hosted by Hepforge, IPPP Durham
Laura++  v3r5
A maximum likelihood fitting package for performing Dalitz-plot analysis.
Lau1DHistPdf.hh
Go to the documentation of this file.
1 
2 /*
3 Copyright 2006 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_1DHIST_PDF
39 #define LAU_1DHIST_PDF
40 
41 #include "LauAbsPdf.hh"
42 
43 class TH1;
44 
45 class Lau1DHistPdf : public LauAbsPdf {
46 
47  public:
49 
58  Lau1DHistPdf(const TString& theVarName, const TH1* hist, Double_t minAbscissa, Double_t maxAbscissa,
59  Bool_t useInterpolation = kTRUE, Bool_t fluctuateBins = kFALSE);
60 
62  virtual ~Lau1DHistPdf();
63 
65 
68  virtual void calcLikelihoodInfo(const LauAbscissas& abscissas);
69 
71 
73  virtual void calcNorm();
74 
76 
79  virtual void calcPDFHeight( const LauKinematics* kinematics );
80 
81  protected:
83  void doBinFluctuation();
84 
86  void checkNormalisation();
87 
89 
93  Double_t getBinHistValue(Int_t bin) const;
94 
96 
100  Double_t interpolate(Double_t x) const;
101 
103 
107  Double_t interpolateNorm(Double_t x) const;
108 
109  private:
111  Lau1DHistPdf(const Lau1DHistPdf& rhs);
112 
114  Lau1DHistPdf& operator=(const Lau1DHistPdf& rhs);
115 
117  TH1* hist_;
118 
123 
125  Int_t nBins_;
127  Double_t axisMin_;
129  Double_t axisMax_;
131  Double_t axisRange_;
132 
133  ClassDef(Lau1DHistPdf,0) // 1D histogram pdf class
134 };
135 
136 #endif
virtual void calcLikelihoodInfo(const LauAbscissas &abscissas)
Calculate the likelihood (and intermediate info) for a given abscissa.
virtual void calcNorm()
Calculate the normalisation.
TH1 * hist_
The underlying histogram.
Bool_t fluctuateBins_
Control boolean for performing the fluctuation of the histogram bin contents.
void checkNormalisation()
Check the normalisation calculation.
Bool_t useInterpolation_
Control boolean for using the linear interpolation.
Double_t axisMax_
The histogram axis maximum.
Class for defining a 1D histogram PDF.
Definition: Lau1DHistPdf.hh:45
void doBinFluctuation()
Fluctuate the histogram bin contents in accorance with their errors.
Double_t getBinHistValue(Int_t bin) const
Get the bin content from the histogram.
virtual ~Lau1DHistPdf()
Destructor.
Definition: Lau1DHistPdf.cc:94
Int_t nBins_
The number of bins in the histogram.
Lau1DHistPdf(const TString &theVarName, const TH1 *hist, Double_t minAbscissa, Double_t maxAbscissa, Bool_t useInterpolation=kTRUE, Bool_t fluctuateBins=kFALSE)
Constructor.
Definition: Lau1DHistPdf.cc:46
Double_t interpolateNorm(Double_t x) const
Perform the interpolation and divide by the normalisation.
File containing declaration of LauAbsPdf class.
Double_t axisMin_
The histogram axis minimum.
virtual void calcLikelihoodInfo(const LauAbscissas &abscissas)=0
Calculate the likelihood (and all associated information) given value(s) of the abscissa(s) ...
Double_t axisRange_
The histogram axis range.
Double_t interpolate(Double_t x) const
Perform the interpolation (unnormalised)
virtual void calcPDFHeight(const LauKinematics *kinematics)
Calculate the PDF height.
Class for defining the abstract interface for PDF classes.
Definition: LauAbsPdf.hh:55
Class for calculating 3-body kinematic quantities.
Lau1DHistPdf & operator=(const Lau1DHistPdf &rhs)
Copy assignment operator (not implemented)
std::vector< Double_t > LauAbscissas
The type used for containing multiple abscissa values.
Definition: LauAbsPdf.hh:59