MINT2
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
DalitzPdfBase Class Referenceabstract

#include <DalitzPdfBase.h>

Inheritance diagram for DalitzPdfBase:
MINT::PdfBase< IDalitzEvent > IDalitzPdf MINT::IReturnRealForEvent< IDalitzEvent > MINT::IPdf< IDalitzEvent > MINT::IReturnRealForEvent< IDalitzEvent > MINT::IReturnRealForEvent< IDalitzEvent > MINT::IPdf< IDalitzEvent > MINT::IReturnRealForEvent< IDalitzEvent > MINT::IReturnRealForEvent< IDalitzEvent >

Public Member Functions

 DalitzPdfBase (MINT::IEventGenerator< IDalitzEvent > *generator=0, double precision=1.e-2)
 
void setIntegrationPrecision (double prec)
 
void setEventGenerator (MINT::IEventGenerator< IDalitzEvent > *g)
 
MINT::IEventGenerator< IDalitzEvent > * getEventGenerator ()
 
const MINT::IEventGenerator< IDalitzEvent > * getEventGenerator () const
 
virtual void beginFit ()
 
virtual void parametersChanged ()
 
virtual void endFit ()
 
virtual double getVal (IDalitzEvent &evt)
 
virtual double getVal_noPs (IDalitzEvent &evt)
 
virtual double getVal_withPs (IDalitzEvent &evt)
 
virtual double getVal (IDalitzEvent *evt)
 
virtual double getVal_noPs (IDalitzEvent *evt)
 
virtual double getVal_withPs (IDalitzEvent *evt)
 
double RealVal (IDalitzEvent &evt)
 
DalitzHistoSet histoSet ()
 
- Public Member Functions inherited from MINT::PdfBase< IDalitzEvent >
 PdfBase ()
 
 PdfBase (const PdfBase< IDalitzEvent > &)
 
virtual double getNewVal (IDalitzEvent &evt)
 
virtual ~PdfBase ()
 
- Public Member Functions inherited from MINT::IPdf< IDalitzEvent >
virtual void Gradient (IDalitzEvent &evt, std::vector< double > &grad, MINT::MinuitParameterSet *mps)
 
virtual bool useAnalyticGradient ()
 
- Public Member Functions inherited from MINT::IReturnRealForEvent< IDalitzEvent >
virtual ~IReturnRealForEvent ()
 

Public Attributes

bool _integrating
 

Private Member Functions

virtual double un_normalised_noPs (IDalitzEvent &evt)=0
 
virtual double phaseSpace (IDalitzEvent &evt)
 
bool getNorm ()
 
bool integrating ()
 

Private Attributes

DalitzEventPattern _pat
 
double _norm
 
double _precision
 
DalitzMCIntegrator _mcint
 
MINT::IEventGenerator< IDalitzEvent > * _generator
 

Additional Inherited Members

- Protected Member Functions inherited from MINT::IReturnRealForEvent< IDalitzEvent >
 IReturnRealForEvent ()
 

Detailed Description

Definition at line 17 of file DalitzPdfBase.h.

Constructor & Destructor Documentation

◆ DalitzPdfBase()

DalitzPdfBase::DalitzPdfBase ( MINT::IEventGenerator< IDalitzEvent > *  generator = 0,
double  precision = 1.e-2 
)

Definition at line 42 of file DalitzPdfBase.cpp.

46  , _pat()
47  , _norm(-1)
48  , _precision(prec)
49  , _generator(generator)
50  , _integrating(0)
51 {
52 
53 }
MINT::IEventGenerator< IDalitzEvent > * _generator
Definition: DalitzPdfBase.h:27
double _precision
Definition: DalitzPdfBase.h:24
DalitzEventPattern _pat
Definition: DalitzPdfBase.h:22

Member Function Documentation

◆ beginFit()

void DalitzPdfBase::beginFit ( )
virtual

Reimplemented from MINT::PdfBase< IDalitzEvent >.

Definition at line 32 of file DalitzPdfBase.cpp.

32  {
33  //getNorm();
34 }

◆ endFit()

void DalitzPdfBase::endFit ( )
virtual

Reimplemented from MINT::PdfBase< IDalitzEvent >.

Definition at line 38 of file DalitzPdfBase.cpp.

38  {
39 
40 }

◆ getEventGenerator() [1/2]

MINT::IEventGenerator<IDalitzEvent>* DalitzPdfBase::getEventGenerator ( )
inline

Definition at line 43 of file DalitzPdfBase.h.

43 {return _generator;}
MINT::IEventGenerator< IDalitzEvent > * _generator
Definition: DalitzPdfBase.h:27

◆ getEventGenerator() [2/2]

const MINT::IEventGenerator<IDalitzEvent>* DalitzPdfBase::getEventGenerator ( ) const
inline

Definition at line 44 of file DalitzPdfBase.h.

44  {
45  return _generator;}
MINT::IEventGenerator< IDalitzEvent > * _generator
Definition: DalitzPdfBase.h:27

◆ getNorm()

bool DalitzPdfBase::getNorm ( )
private

Definition at line 10 of file DalitzPdfBase.cpp.

10  {
11  if(_pat.size() <= 0) return false;
12 
13  _integrating = true;
14 
16  , this
17  , _generator
18  , gRandom
19  , _precision
20  );
21  _norm = _mcint.getVal();
22  _integrating = false;
23  return _norm > 0;
24 }
MINT::IEventGenerator< IDalitzEvent > * _generator
Definition: DalitzPdfBase.h:27
bool initialise(const DalitzEventPattern &pattern, MINT::IReturnRealForEvent< IDalitzEvent > *weightFunction=0, MINT::IEventGenerator< IDalitzEvent > *eventGenerator=0, TRandom *rnd=gRandom, double precision=1.e-2)
DalitzMCIntegrator _mcint
Definition: DalitzPdfBase.h:25
unsigned int size() const
double _precision
Definition: DalitzPdfBase.h:24
DalitzEventPattern _pat
Definition: DalitzPdfBase.h:22

◆ getVal() [1/2]

double DalitzPdfBase::getVal ( IDalitzEvent evt)
virtual

Implements IDalitzPdf.

Definition at line 61 of file DalitzPdfBase.cpp.

61  {
62  if(_pat.empty()) _pat = evt.eventPattern();
63  if(_integrating) return getVal_withPs(evt);
64  else return getVal_noPs(evt);
65 }
virtual double getVal_noPs(IDalitzEvent &evt)
virtual double getVal_withPs(IDalitzEvent &evt)
virtual const DalitzEventPattern & eventPattern() const =0
DalitzEventPattern _pat
Definition: DalitzPdfBase.h:22

◆ getVal() [2/2]

virtual double DalitzPdfBase::getVal ( IDalitzEvent evt)
inlinevirtual

Implements IDalitzPdf.

Definition at line 57 of file DalitzPdfBase.h.

57  {
58  if(0 == evt) return 0;
59  return getVal(*evt);
60  }
virtual double getVal(IDalitzEvent &evt)

◆ getVal_noPs() [1/2]

double DalitzPdfBase::getVal_noPs ( IDalitzEvent evt)
virtual

Implements IDalitzPdf.

Definition at line 67 of file DalitzPdfBase.cpp.

67  {
68  bool dbthis = false;
69  if(_pat.empty()) _pat = evt.eventPattern();
70 
71  if(_integrating){
72  // shouldn't really do that - use getVal or getVal_withPs
73  // when you integrate (automatically done in getVal()):
74  return un_normalised_noPs(evt);
75  }else{
76  if(-1 == _norm) getNorm(); // not threadsave
77  //if(-1 == _norm){
78  // cout << "DalitzPdfBase::getVal_noPs: _norm = "
79  // << _norm << endl;
80  // throw "what's going on here?";
81  //}
82  double num = un_normalised_noPs(evt);
83  if(dbthis)cout << "un_normalised / norm: "
84  << num << " / " <<_norm
85  << " = " << num/_norm
86  << endl;
87  return num/_norm;
88  }
89 }
virtual double un_normalised_noPs(IDalitzEvent &evt)=0
virtual const DalitzEventPattern & eventPattern() const =0
DalitzEventPattern _pat
Definition: DalitzPdfBase.h:22

◆ getVal_noPs() [2/2]

virtual double DalitzPdfBase::getVal_noPs ( IDalitzEvent evt)
inlinevirtual

Implements IDalitzPdf.

Definition at line 61 of file DalitzPdfBase.h.

61  {
62  if(0 == evt) return 0;
63  return getVal_noPs(*evt);
64  }
virtual double getVal_noPs(IDalitzEvent &evt)

◆ getVal_withPs() [1/2]

double DalitzPdfBase::getVal_withPs ( IDalitzEvent evt)
virtual

Implements IDalitzPdf.

Definition at line 91 of file DalitzPdfBase.cpp.

91  {
92  bool dbthis = false;
93  if(_pat.empty()) _pat = evt.eventPattern();
94  if(_integrating){
95  return un_normalised_noPs(evt)*phaseSpace(evt);
96  }else{
97  if(_norm == -1) getNorm(); // not threadsave
98  //if(-1 == _norm){
99  // cout << "DalitzPdfBase::getVal_withPs: _norm = "
100  // << _norm << endl;
101  // throw "what's going on here?";
102  //}
103  double num = un_normalised_noPs(evt)*phaseSpace(evt);
104  if(dbthis)cout << "un_normalised / norm: "
105  << num << " / " <<_norm
106  << " = " << num/_norm
107  << endl;
108  return num/_norm;
109  }
110 }
virtual double un_normalised_noPs(IDalitzEvent &evt)=0
virtual double phaseSpace(IDalitzEvent &evt)
virtual const DalitzEventPattern & eventPattern() const =0
DalitzEventPattern _pat
Definition: DalitzPdfBase.h:22

◆ getVal_withPs() [2/2]

virtual double DalitzPdfBase::getVal_withPs ( IDalitzEvent evt)
inlinevirtual

Implements IDalitzPdf.

Definition at line 65 of file DalitzPdfBase.h.

65  {
66  if(0 == evt) return 0;
67  return getVal_withPs(*evt);
68  }
virtual double getVal_withPs(IDalitzEvent &evt)

◆ histoSet()

DalitzHistoSet DalitzPdfBase::histoSet ( )
inlinevirtual

Implements IDalitzPdf.

Definition at line 74 of file DalitzPdfBase.h.

74 {return _mcint.histoSet();}
DalitzHistoSet histoSet()
DalitzMCIntegrator _mcint
Definition: DalitzPdfBase.h:25

◆ integrating()

bool DalitzPdfBase::integrating ( )
private

Definition at line 55 of file DalitzPdfBase.cpp.

55  {
56  return _integrating;
57 }

◆ parametersChanged()

void DalitzPdfBase::parametersChanged ( )
virtual

Reimplemented from MINT::PdfBase< IDalitzEvent >.

Definition at line 35 of file DalitzPdfBase.cpp.

35  {
36  getNorm(); // should implement caching here.
37 }

◆ phaseSpace()

double DalitzPdfBase::phaseSpace ( IDalitzEvent evt)
privatevirtual

Definition at line 58 of file DalitzPdfBase.cpp.

58  {
59  return evt.phaseSpace();
60 }
virtual double phaseSpace() const =0

◆ RealVal()

double DalitzPdfBase::RealVal ( IDalitzEvent evt)
inlinevirtual

Implements MINT::IReturnRealForEvent< IDalitzEvent >.

Definition at line 71 of file DalitzPdfBase.h.

71 {return getVal(evt);}
virtual double getVal(IDalitzEvent &evt)

◆ setEventGenerator()

void DalitzPdfBase::setEventGenerator ( MINT::IEventGenerator< IDalitzEvent > *  g)
inline

Definition at line 42 of file DalitzPdfBase.h.

42 {_generator=g;}
MINT::IEventGenerator< IDalitzEvent > * _generator
Definition: DalitzPdfBase.h:27
static const double g

◆ setIntegrationPrecision()

void DalitzPdfBase::setIntegrationPrecision ( double  prec)

Definition at line 26 of file DalitzPdfBase.cpp.

26  {
27  _precision = prec;
29 }
void setPrecision(double prec)
DalitzMCIntegrator _mcint
Definition: DalitzPdfBase.h:25
double _precision
Definition: DalitzPdfBase.h:24

◆ un_normalised_noPs()

virtual double DalitzPdfBase::un_normalised_noPs ( IDalitzEvent evt)
privatepure virtual

Member Data Documentation

◆ _generator

MINT::IEventGenerator<IDalitzEvent>* DalitzPdfBase::_generator
private

Definition at line 27 of file DalitzPdfBase.h.

◆ _integrating

bool DalitzPdfBase::_integrating

Definition at line 35 of file DalitzPdfBase.h.

◆ _mcint

DalitzMCIntegrator DalitzPdfBase::_mcint
private

Definition at line 25 of file DalitzPdfBase.h.

◆ _norm

double DalitzPdfBase::_norm
private

Definition at line 23 of file DalitzPdfBase.h.

◆ _pat

DalitzEventPattern DalitzPdfBase::_pat
private

Definition at line 22 of file DalitzPdfBase.h.

◆ _precision

double DalitzPdfBase::_precision
private

Definition at line 24 of file DalitzPdfBase.h.


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