laura is hosted by Hepforge, IPPP Durham
Laura++  v2r1
A maximum likelihood fitting package for performing Dalitz-plot analysis.

Class for defining a 1D histogram PDF. More...

#include <Lau1DHistPdf.hh>

Inheritance diagram for Lau1DHistPdf:
LauAbsPdf

Public Member Functions

 Lau1DHistPdf (const TString &theVarName, const TH1 *hist, Double_t minAbscissa, Double_t maxAbscissa, Bool_t useInterpolation=kTRUE, Bool_t fluctuateBins=kFALSE)
 Constructor. More...
 
virtual ~Lau1DHistPdf ()
 Destructor. More...
 
 Lau1DHistPdf (const Lau1DHistPdf &other)
 Copy constructor. More...
 
virtual void calcLikelihoodInfo (const LauAbscissas &abscissas)
 Calculate the likelihood (and intermediate info) for a given abscissa. More...
 
virtual void calcNorm ()
 Calculate the normalisation. More...
 
virtual void calcPDFHeight (const LauKinematics *kinematics)
 Calculate the PDF height. More...
 
- Public Member Functions inherited from LauAbsPdf
 LauAbsPdf (const TString &theVarName, const std::vector< LauAbsRValue * > &params, Double_t minAbscissa, Double_t maxAbscissa)
 Constructor for a 1D PDF. More...
 
 LauAbsPdf (const std::vector< TString > &theVarNames, const std::vector< LauAbsRValue * > &params, const LauFitData &minAbscissas, const LauFitData &maxAbscissas)
 Constructor for a multidimensional PDF. More...
 
virtual ~LauAbsPdf ()
 Destructor. More...
 
virtual const TString & varName () const
 Retrieve the name of the abscissa. More...
 
virtual std::vector< TString > varNames () const
 Retrieve the names of the abscissas. More...
 
virtual UInt_t nParameters () const
 Retrieve the number of PDF parameters. More...
 
virtual UInt_t nFixedParameters () const
 Retrieve the number of fixed PDF parameters. More...
 
virtual UInt_t nInputVars () const
 Retrieve the number of abscissas. More...
 
virtual Bool_t isDPDependent () const
 Specifies whether or not the PDF is DP dependent. More...
 
virtual Double_t getMinAbscissa () const
 Retrieve the minimum value of the (primary) abscissa. More...
 
virtual Double_t getMaxAbscissa () const
 Retrieve the maximum value of the (primary) abscissa. More...
 
virtual Double_t getRange () const
 Retrieve the range of the (primary) abscissa. More...
 
virtual Double_t getMinAbscissa (const TString &theVarName) const
 Retrieve the minimum value of the specified abscissa. More...
 
virtual Double_t getMaxAbscissa (const TString &theVarName) const
 Retrieve the maximum value of the specified abscissa. More...
 
virtual Double_t getRange (const TString &theVarName) const
 Retrieve the range of the specified abscissa. More...
 
virtual LauFitData getMinAbscissas () const
 Retrieve the minimum values of all the abscissas. More...
 
virtual LauFitData getMaxAbscissas () const
 Retrieve the maximum values of all the abscissas. More...
 
virtual LauFitData getRanges () const
 Retrieve the ranges of all the abscissas. More...
 
virtual void updatePulls ()
 Update the pulls for all parameters. More...
 
virtual void cacheInfo (const LauFitDataTree &inputData)
 Cache information from data. More...
 
virtual void calcLikelihoodInfo (UInt_t iEvt)
 Retrieve the likelihood (and all associated information) given the event number. More...
 
virtual Double_t getUnNormLikelihood () const
 Retrieve the unnormalised likelihood value. More...
 
virtual Double_t getNorm () const
 Retrieve the normalisation factor. More...
 
virtual Double_t getLikelihood () const
 Retrieve the normalised likelihood value. More...
 
virtual Double_t getLikelihood (const TString &theVarName) const
 For multidimentional PDFs, retrieve the normalised likelihood value of a named variable. More...
 
virtual Double_t getMaxHeight () const
 Retrieve the maximum height. More...
 
virtual LauFitData generate (const LauKinematics *kinematics)
 Generate an event from the PDF. More...
 
virtual void setRandomFun (TRandom *randomFun)
 Set the random function used for toy MC generation. More...
 
virtual const std::vector
< LauAbsRValue * > & 
getParameters () const
 Retrieve the parameters of the PDF, e.g. so that they can be loaded into a fit. More...
 
virtual std::vector
< LauAbsRValue * > & 
getParameters ()
 Retrieve the parameters of the PDF, e.g. so that they can be loaded into a fit. More...
 
virtual Bool_t heightUpToDate () const
 Check if the maximum height of the PDF is up to date. More...
 
virtual Bool_t cachePDF () const
 Check if the PDF is to be cached. More...
 
virtual Int_t nNormPoints () const
 Retrieve the number of points to integrate over when normalising. More...
 
virtual void nNormPoints (Int_t nPoints)
 Set the number of points to integrate over when normalising. More...
 
virtual IntMethod integMethod () const
 Retrieve the integration method used to normalise the PDF. More...
 
virtual void integMethod (IntMethod method)
 Set the integration method used to normalise the PDF. More...
 

Protected Member Functions

void doBinFluctuation ()
 Fluctuate the histogram bin contents in accorance with their errors. More...
 
void checkNormalisation ()
 Check the normalisation calculation. More...
 
Double_t getBinHistValue (Int_t bin) const
 Get the bin content from the histogram. More...
 
Double_t interpolate (Double_t x) const
 Perform the interpolation (unnormalised) More...
 
Double_t interpolateNorm (Double_t x) const
 Perform the interpolation and divide by the normalisation. More...
 
- Protected Member Functions inherited from LauAbsPdf
virtual void cachePDF (Bool_t doCachePDF)
 Set whether the PDF is to be cached. More...
 
virtual void heightUpToDate (Bool_t hutd)
 Set whether the height is up to date. More...
 
virtual Double_t integrGaussLegendre ()
 Integrate the PDF using the Gauss-Legendre method. More...
 
virtual Double_t integTrapezoid ()
 Integrate the PDF using the simple trapezoid method. More...
 
virtual void setNorm (Double_t norm)
 Set the normalisation factor. More...
 
virtual void setMaxHeight (Double_t maxHeight)
 Set the maximum height. More...
 
virtual void setMinAbscissa (const TString &theVarName, Double_t minAbscissa)
 Set the minimum value of the specified abscissa. More...
 
virtual void setMaxAbscissa (const TString &theVarName, Double_t maxAbscissa)
 Set the maximum value of the specified abscissa. More...
 
virtual void setRange (const TString &theVarName, Double_t minAbscissa, Double_t maxAbscissa)
 Set the range of the specified abscissa. More...
 
virtual Bool_t checkRange (const LauAbscissas &abscissas) const
 Check that all abscissas are within their allowed ranges. More...
 
virtual void setUnNormPDFVal (Double_t unNormPDFVal)
 Set the unnormalised likelihood. More...
 
virtual LauAbsRValuefindParameter (const TString &parName)
 Retrieve the specified parameter. More...
 
virtual const LauAbsRValuefindParameter (const TString &parName) const
 Retrieve the specified parameter. More...
 
virtual TRandom * getRandomFun () const
 Retrieve the random function used for MC generation. More...
 
virtual std::vector
< LauAbscissas > & 
getAbscissas ()
 Retrieve the abscissa(s) More...
 
virtual const std::vector
< LauAbscissas > & 
getAbscissas () const
 Retrieve the abscissa(s) More...
 
virtual std::vector< Double_t > & getUnNormPDFValues ()
 Retrieve the cached unnormalised likelihood values. More...
 
virtual const std::vector
< Double_t > & 
getUnNormPDFValues () const
 Retrieve the cached unnormalised likelihood values. More...
 
virtual void addParameters (std::vector< LauAbsRValue * > &params)
 Add parameters to the PDF. More...
 
virtual Bool_t withinNormCalc () const
 Check whether the calcNorm method is running. More...
 
virtual void withinNormCalc (Bool_t yorn)
 Set flag to track whether the calcNorm method is running. More...
 
virtual Bool_t withinGeneration () const
 Check whether the generate method is running. More...
 
virtual void withinGeneration (Bool_t yorn)
 Set flag to track whether the generate method is running. More...
 
virtual Bool_t normWeightsDone () const
 Check whether the normalisation weights have been calculated. More...
 
virtual void normWeightsDone (Bool_t yorn)
 Set whether the normalisation weights have been calculated. More...
 
virtual void getNormWeights ()
 Calculate the weights and abscissas used for normalisation. More...
 
virtual const std::vector
< LauAbscissas > & 
normAbscissas () const
 Retrieve the abscissa points used for normalisation. More...
 
virtual const std::vector
< Double_t > & 
normWeights () const
 Retrieve the weights used for normalisation. More...
 

Private Attributes

TH1 * hist_
 The underlying histogram. More...
 
Bool_t useInterpolation_
 Control boolean for using the linear interpolation. More...
 
Bool_t fluctuateBins_
 Control boolean for performing the fluctuation of the histogram bin contents. More...
 
Int_t nBins_
 The number of bins in the histogram. More...
 
Double_t axisMin_
 The histogram axis minimum. More...
 
Double_t axisMax_
 The histogram axis maximum. More...
 
Double_t axisRange_
 The histogram axis range. More...
 

Additional Inherited Members

- Public Types inherited from LauAbsPdf
enum  IntMethod { GaussLegendre, Trapezoid }
 The possible numerical intergration methods. More...
 
typedef std::vector< Double_t > LauAbscissas
 The type used for containing multiple abscissa values. More...
 

Detailed Description

Class for defining a 1D histogram PDF.

Class for defining a 1D histogram PDF. Employs linear interpolation to get the PDF value based on how far away a point is from nearby bin centres. The returned values are normalised to the total area.

Definition at line 31 of file Lau1DHistPdf.hh.

Constructor & Destructor Documentation

Lau1DHistPdf::Lau1DHistPdf ( const TString &  theVarName,
const TH1 *  hist,
Double_t  minAbscissa,
Double_t  maxAbscissa,
Bool_t  useInterpolation = kTRUE,
Bool_t  fluctuateBins = kFALSE 
)

Constructor.

Parameters
[in]theVarNamethe name of the abscissa variable
[in]histthe 1D histogram from which the PDF should be constructed
[in]minAbscissathe minimum value of the abscissa
[in]maxAbscissathe maximum value of the abscissa
[in]useInterpolationboolean flag to determine whether linear interpolation between bins should be used or simply the raw bin values
[in]fluctuateBinsboolean flag to determine whether the bin contents should be fluctuated in accordance with their errors. The seed for the random number generator used to fluctuate the bins should first be set using LauRandom::setSeed.

Definition at line 32 of file Lau1DHistPdf.cc.

Lau1DHistPdf::~Lau1DHistPdf ( )
virtual

Destructor.

Definition at line 80 of file Lau1DHistPdf.cc.

Lau1DHistPdf::Lau1DHistPdf ( const Lau1DHistPdf other)

Copy constructor.

Definition at line 86 of file Lau1DHistPdf.cc.

Member Function Documentation

void Lau1DHistPdf::calcLikelihoodInfo ( const LauAbscissas abscissas)
virtual

Calculate the likelihood (and intermediate info) for a given abscissa.

Parameters
[in]abscissasthe values of the abscissa(s)

Implements LauAbsPdf.

Definition at line 172 of file Lau1DHistPdf.cc.

void Lau1DHistPdf::calcNorm ( )
virtual

Calculate the normalisation.

Reimplemented from LauAbsPdf.

Definition at line 107 of file Lau1DHistPdf.cc.

void Lau1DHistPdf::calcPDFHeight ( const LauKinematics kinematics)
virtual

Calculate the PDF height.

Parameters
[in]kinematicsthe current DP kinematics (not strictly required in this case since PDF has no DP dependence)

Implements LauAbsPdf.

Definition at line 95 of file Lau1DHistPdf.cc.

void Lau1DHistPdf::checkNormalisation ( )
protected

Check the normalisation calculation.

Definition at line 128 of file Lau1DHistPdf.cc.

void Lau1DHistPdf::doBinFluctuation ( )
protected

Fluctuate the histogram bin contents in accorance with their errors.

Definition at line 246 of file Lau1DHistPdf.cc.

Double_t Lau1DHistPdf::getBinHistValue ( Int_t  bin) const
protected

Get the bin content from the histogram.

Parameters
[in]binthe bin number
Returns
the bin content

Definition at line 149 of file Lau1DHistPdf.cc.

Double_t Lau1DHistPdf::interpolate ( Double_t  x) const
protected

Perform the interpolation (unnormalised)

Parameters
[in]xthe abscissa value
Returns
the unnormalised PDF value

Definition at line 187 of file Lau1DHistPdf.cc.

Double_t Lau1DHistPdf::interpolateNorm ( Double_t  x) const
protected

Perform the interpolation and divide by the normalisation.

Parameters
[in]xthe abscissa value
Returns
the normalised PDF value

Definition at line 164 of file Lau1DHistPdf.cc.

Member Data Documentation

Double_t Lau1DHistPdf::axisMax_
private

The histogram axis maximum.

Definition at line 112 of file Lau1DHistPdf.hh.

Double_t Lau1DHistPdf::axisMin_
private

The histogram axis minimum.

Definition at line 110 of file Lau1DHistPdf.hh.

Double_t Lau1DHistPdf::axisRange_
private

The histogram axis range.

Definition at line 114 of file Lau1DHistPdf.hh.

Bool_t Lau1DHistPdf::fluctuateBins_
private

Control boolean for performing the fluctuation of the histogram bin contents.

Definition at line 105 of file Lau1DHistPdf.hh.

TH1* Lau1DHistPdf::hist_
private

The underlying histogram.

Definition at line 100 of file Lau1DHistPdf.hh.

Int_t Lau1DHistPdf::nBins_
private

The number of bins in the histogram.

Definition at line 108 of file Lau1DHistPdf.hh.

Bool_t Lau1DHistPdf::useInterpolation_
private

Control boolean for using the linear interpolation.

Definition at line 103 of file Lau1DHistPdf.hh.


The documentation for this class was generated from the following files: