meerkat is hosted by Hepforge, IPPP Durham
Meerkat  v1r3
Multidimensional kernel density estimation package

#include <FormulaDensity.hh>

Inheritance diagram for FormulaDensity:
AbsDensity

Public Member Functions

 FormulaDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, const char *formula)
 Constructor. More...
 
 FormulaDensity (const char *pdfName, AbsPhaseSpace *thePhaseSpace, TFormula *formula)
 Constructor. More...
 
virtual ~FormulaDensity ()
 
Double_t density (std::vector< Double_t > &x)
 Calculate PDF value at the given point. More...
 
AbsPhaseSpacephaseSpace ()
 Return phase space definition for this PDF. More...
 
- Public Member Functions inherited from AbsDensity
 AbsDensity (const char *pdfName)
 Constructor. More...
 
virtual ~AbsDensity ()
 Destructor. More...
 
void slice (std::vector< Double_t > &x, UInt_t num, TH1F *hist)
 Calculate 1D slice of the PDF. More...
 
void slice (std::vector< Double_t > &x, UInt_t numx, UInt_t numy, TH2F *hist, Bool_t inPhaseSpace=true)
 Calculate 2D slice of the PDF. More...
 
double transform (TH1F *hist1, TH1F *hist2, double x)
 
void project (TH1F *hist)
 Calculate projection of the 1D PDF. More...
 
void project (TH2F *hist, Bool_t inPhaseSpace=true)
 Calculate projection of the 2D PDF. More...
 
void setMajorant (Double_t majorant)
 Set majorant for accept-reject method. More...
 
void setMaxTries (UInt_t maxTries)
 Set maximum number of tries for accept-reject method. More...
 
Double_t generate (std::vector< Double_t > &x)
 Generate a single point within the phase space according to the PDF using accept-reject method. More...
 
void generate (TNtuple *tree, UInt_t numEvents)
 Generate a sample of points within the phase space according to the PDF using accept-reject method. More...
 
const char * name (void)
 Return the name of the PDF. More...
 
void setSeed (UInt_t seed=0)
 Set random seed. More...
 

Private Attributes

AbsPhaseSpacem_phaseSpace
 Reference to phase space. More...
 
TFormula * m_formula
 ROOT formula. More...
 
UInt_t m_dim
 Cached dimensionality of the phase space. More...
 

Additional Inherited Members

- Protected Attributes inherited from AbsDensity
char m_name [256]
 PDF name. More...
 
Double_t m_majorant
 PDF majorant (maximum PDF value needed for accept-reject). More...
 
UInt_t m_maxTries
 Maximum number of tries for accept-reject method. More...
 
TRandom3 m_rnd
 Random number generator. More...
 

Detailed Description

Class that describes the density defined by ROOT formula The phase space dimensionality must not exceed four

Definition at line 14 of file FormulaDensity.hh.

Constructor & Destructor Documentation

FormulaDensity::FormulaDensity ( const char *  pdfName,
AbsPhaseSpace thePhaseSpace,
const char *  formula 
)

Constructor.

Parameters
[in]pdfNamePDF name
[in]thePhaseSpacephase space definition
[in]formulaROOT formula string

Definition at line 12 of file FormulaDensity.cpp.

FormulaDensity::FormulaDensity ( const char *  pdfName,
AbsPhaseSpace thePhaseSpace,
TFormula *  formula 
)

Constructor.

Parameters
[in]pdfNamePDF name
[in]thePhaseSpacephase space definition
[in]formulaROOT TFormula object

Definition at line 26 of file FormulaDensity.cpp.

FormulaDensity::~FormulaDensity ( )
virtual

Definition at line 40 of file FormulaDensity.cpp.

Member Function Documentation

Double_t FormulaDensity::density ( std::vector< Double_t > &  x)
virtual

Calculate PDF value at the given point.

Parameters
[in]xthe point at which to calculate the PDF
Returns
PDF value (equals 1 inside phase space, 0 outside it)

Implements AbsDensity.

Definition at line 44 of file FormulaDensity.cpp.

AbsPhaseSpace* FormulaDensity::phaseSpace ( )
inlinevirtual

Return phase space definition for this PDF.

Returns
PDF phase space

Implements AbsDensity.

Definition at line 51 of file FormulaDensity.hh.

Member Data Documentation

UInt_t FormulaDensity::m_dim
private

Cached dimensionality of the phase space.

Definition at line 62 of file FormulaDensity.hh.

TFormula* FormulaDensity::m_formula
private

ROOT formula.

Definition at line 59 of file FormulaDensity.hh.

AbsPhaseSpace* FormulaDensity::m_phaseSpace
private

Reference to phase space.

Definition at line 56 of file FormulaDensity.hh.


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