CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDalitzResPdf Class Reference

#include <EvtDalitzResPdf.hh>

+ Inheritance diagram for EvtDalitzResPdf:

Public Member Functions

 EvtDalitzResPdf (const EvtDalitzPlot &dp, double m0, double g0, EvtCyclic3::Pair pairRes)
 
 EvtDalitzResPdf (const EvtDalitzResPdf &other)
 
virtual ~EvtDalitzResPdf ()
 
EvtPdf< EvtDalitzPoint > * clone () const
 
virtual EvtValError compute_integral (int N) const
 
virtual EvtDalitzPoint randomPoint ()
 
double pdfMaxValue () const
 
- Public Member Functions inherited from EvtPdf< EvtDalitzPoint >
 EvtPdf ()
 
 EvtPdf (const EvtPdf &other)
 
virtual ~EvtPdf ()
 
double evaluate (const EvtDalitzPoint &p) const
 
EvtPdfMax< EvtDalitzPointfindMax (const EvtPdf< EvtDalitzPoint > &pc, int N)
 
EvtValError findGenEff (const EvtPdf< EvtDalitzPoint > &pc, int N, int nFindMax)
 
void setItg (EvtValError itg)
 
EvtValError getItg () const
 
EvtValError getItg (int N) const
 
virtual EvtValError compute_integral () const
 
EvtValError compute_mc_integral (const EvtPdf< EvtDalitzPoint > &pc, int N)
 
EvtPredGen< EvtPdfGen< EvtDalitzPoint >, EvtPdfPred< EvtDalitzPoint > > accRejGen (const EvtPdf< EvtDalitzPoint > &pc, int nMax, double factor=1.)
 

Protected Member Functions

virtual double pdf (const EvtDalitzPoint &) const
 
- Protected Member Functions inherited from EvtPdf< EvtDalitzPoint >

Additional Inherited Members

- Protected Attributes inherited from EvtPdf< EvtDalitzPoint >
EvtValError _itg
 

Detailed Description

Definition at line 31 of file EvtDalitzResPdf.hh.

Constructor & Destructor Documentation

◆ EvtDalitzResPdf() [1/2]

EvtDalitzResPdf::EvtDalitzResPdf ( const EvtDalitzPlot & dp,
double m0,
double g0,
EvtCyclic3::Pair pairRes )

Definition at line 20 of file EvtDalitzResPdf.cc.

23 _dp(dp), _m0(_m0), _g0(_g0), _pair(pair)
24{}

Referenced by clone().

◆ EvtDalitzResPdf() [2/2]

EvtDalitzResPdf::EvtDalitzResPdf ( const EvtDalitzResPdf & other)

Definition at line 27 of file EvtDalitzResPdf.cc.

29 _dp(other._dp),_m0(other._m0), _g0(other._g0), _pair(other._pair)
30{}
Index other(Index i, Index j)

◆ ~EvtDalitzResPdf()

EvtDalitzResPdf::~EvtDalitzResPdf ( )
virtual

Definition at line 33 of file EvtDalitzResPdf.cc.

34{}

Member Function Documentation

◆ clone()

EvtPdf< EvtDalitzPoint > * EvtDalitzResPdf::clone ( ) const
inlinevirtual

Implements EvtPdf< EvtDalitzPoint >.

Definition at line 40 of file EvtDalitzResPdf.hh.

40{ return new EvtDalitzResPdf(*this); }
EvtDalitzResPdf(const EvtDalitzPlot &dp, double m0, double g0, EvtCyclic3::Pair pairRes)

◆ compute_integral()

EvtValError EvtDalitzResPdf::compute_integral ( int N) const
virtual

Reimplemented from EvtPdf< EvtDalitzPoint >.

Definition at line 36 of file EvtDalitzResPdf.cc.

37{
38 assert(N != 0);
39
40 EvtCyclic3::Pair i = _pair;
42
43 // Trapezoidal integral
44
45 double dh = (_dp.qAbsMax(j) - _dp.qAbsMin(j))/((double) N);
46 double sum = 0;
47
48 int ii;
49 for(ii=1;ii<N;ii++) {
50
51 double x = _dp.qAbsMin(j) + ii*dh;
52 double min = (_dp.qMin(i,j,x) - _m0*_m0)/_m0/_g0;
53 double max = (_dp.qMax(i,j,x) - _m0*_m0)/_m0/_g0;
54 double itg = 1/EvtConst::pi*(atan(max) - atan(min));
55 sum += itg;
56 }
57 EvtValError ret(sum*dh,0.);
58
59 return ret;
60}
Double_t x[10]
static const double pi
Definition EvtConst.hh:28
double qAbsMin(EvtCyclic3::Pair i) const
double qMin(EvtCyclic3::Pair i, EvtCyclic3::Pair j, double q) const
double qAbsMax(EvtCyclic3::Pair i) const
double qMax(EvtCyclic3::Pair i, EvtCyclic3::Pair j, double q) const
Index next(Index i)

◆ pdf()

double EvtDalitzResPdf::pdf ( const EvtDalitzPoint & x) const
protectedvirtual

Implements EvtPdf< EvtDalitzPoint >.

Definition at line 93 of file EvtDalitzResPdf.cc.

94{
95 EvtCyclic3::Pair i = _pair;
96 double dq = x.q(i) - _m0*_m0;
97 return 1/EvtConst::pi*_g0*_m0/(dq*dq + _g0*_g0*_m0*_m0);
98}

◆ pdfMaxValue()

double EvtDalitzResPdf::pdfMaxValue ( ) const

Definition at line 101 of file EvtDalitzResPdf.cc.

102{
103 return 1/(EvtConst::pi*_g0*_m0);
104}

◆ randomPoint()

EvtDalitzPoint EvtDalitzResPdf::randomPoint ( )
virtual

Reimplemented from EvtPdf< EvtDalitzPoint >.

Definition at line 63 of file EvtDalitzResPdf.cc.

64{
65 // Random point generation must be done in a box encompassing the
66 // Dalitz plot
67
68
69 EvtCyclic3::Pair i = _pair;
71 double min = 1/EvtConst::pi*atan((_dp.qAbsMin(i) - _m0*_m0)/_m0/_g0);
72 double max = 1/EvtConst::pi*atan((_dp.qAbsMax(i) - _m0*_m0)/_m0/_g0);
73
74 int n = 0;
75 while(n++ < 1000) {
76
77 double qj = EvtRandom::Flat(_dp.qAbsMin(j),_dp.qAbsMax(j));
78 double r = EvtRandom::Flat(min,max);
79 double qi = tan(EvtConst::pi*r)*_g0*_m0 + _m0*_m0;
80 EvtDalitzCoord x(i,qi,j,qj);
81 EvtDalitzPoint ret(_dp,x);
82 if(ret.isValid()) return ret;
83 }
84
85 // All generated points turned out to be outside of the Dalitz plot
86 // (in the outer box)
87
88 printf("No point generated for dalitz plot after 1000 tries\n");
89 assert(0);
90}
double tan(const BesAngle a)
Definition BesAngle.h:216
const Int_t n
static double Flat()
Definition EvtRandom.cc:73

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