CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtBtoKD3P Class Reference

#include <EvtBtoKD3P.hh>

+ Inheritance diagram for EvtBtoKD3P:

Public Member Functions

 EvtBtoKD3P ()
 
 EvtBtoKD3P (const EvtBtoKD3P &other)
 
virtual ~EvtBtoKD3P ()
 
EvtDecayBaseclone ()
 
virtual void init ()
 
virtual void initProbMax ()
 
virtual void decay (EvtParticle *p)
 
virtual int nRealDaughters ()
 
void getName (std::string &model_name)
 
- Public Member Functions inherited from EvtDecayAmp
void makeDecay (EvtParticle *p)
 
void setWeight (double weight)
 
void vertex (const EvtComplex &amp)
 
void vertex (int i1, const EvtComplex &amp)
 
void vertex (int i1, int i2, const EvtComplex &amp)
 
void vertex (int i1, int i2, int i3, const EvtComplex &amp)
 
void vertex (int *i1, const EvtComplex &amp)
 
virtual ~EvtDecayAmp ()
 
- Public Member Functions inherited from EvtDecayBase
virtual void getName (std::string &name)=0
 
virtual void decay (EvtParticle *p)=0
 
virtual void makeDecay (EvtParticle *p)=0
 
virtual EvtDecayBaseclone ()=0
 
virtual void init ()
 
virtual void initProbMax ()
 
virtual std::string commandName ()
 
virtual void command (std::string cmd)
 
double getProbMax (double prob)
 
double resetProbMax (double prob)
 
 EvtDecayBase ()
 
virtual ~EvtDecayBase ()
 
virtual bool matchingDecay (const EvtDecayBase &other) const
 
EvtId getParentId ()
 
double getBranchingFraction ()
 
void disableCheckQ ()
 
void checkQ ()
 
int getNDaug ()
 
EvtIdgetDaugs ()
 
EvtId getDaug (int i)
 
int getNArg ()
 
int getPHOTOS ()
 
void setPHOTOS ()
 
void setVerbose ()
 
void setSummary ()
 
double * getArgs ()
 
std::string * getArgsStr ()
 
double getArg (int j)
 
std::string getArgStr (int j)
 
std::string getModelName ()
 
int getDSum ()
 
int summary ()
 
int verbose ()
 
void saveDecayInfo (EvtId ipar, int ndaug, EvtId *daug, int narg, std::vector< std::string > &args, std::string name, double brfr)
 
void printSummary ()
 
void setProbMax (double prbmx)
 
void noProbMax ()
 
void checkNArg (int a1, int a2=-1, int a3=-1, int a4=-1)
 
void checkNDaug (int d1, int d2=-1)
 
void checkSpinParent (EvtSpinType::spintype sp)
 
void checkSpinDaughter (int d1, EvtSpinType::spintype sp)
 
virtual int nRealDaughters ()
 

Protected Attributes

double _r
 
EvtComplex _exp
 
const EvtDecayBase_model1
 
const EvtDecayBase_model2
 
bool _decayedOnce
 
- Protected Attributes inherited from EvtDecayAmp
EvtAmp _amp2
 
- Protected Attributes inherited from EvtDecayBase
bool _daugsDecayedByParentModel
 

Additional Inherited Members

- Static Public Member Functions inherited from EvtDecayBase
static void findMasses (EvtParticle *p, int ndaugs, EvtId daugs[10], double masses[10])
 
static void findMass (EvtParticle *p)
 
static double findMaxMass (EvtParticle *p)
 
- Protected Member Functions inherited from EvtDecayBase
bool daugsDecayedByParentModel ()
 

Detailed Description

Definition at line 51 of file EvtBtoKD3P.hh.

Constructor & Destructor Documentation

◆ EvtBtoKD3P() [1/2]

EvtBtoKD3P::EvtBtoKD3P ( )

Definition at line 34 of file EvtBtoKD3P.cc.

34 :
35 _model1(0),
36 _model2(0),
37 _decayedOnce(false)
38{
39}
bool _decayedOnce
Definition: EvtBtoKD3P.hh:77
const EvtDecayBase * _model2
Definition: EvtBtoKD3P.hh:76
const EvtDecayBase * _model1
Definition: EvtBtoKD3P.hh:75

Referenced by clone().

◆ EvtBtoKD3P() [2/2]

EvtBtoKD3P::EvtBtoKD3P ( const EvtBtoKD3P other)

Definition at line 42 of file EvtBtoKD3P.cc.

42 {
43}

◆ ~EvtBtoKD3P()

EvtBtoKD3P::~EvtBtoKD3P ( )
virtual

Definition at line 46 of file EvtBtoKD3P.cc.

46 {
47}

Member Function Documentation

◆ clone()

EvtDecayBase * EvtBtoKD3P::clone ( )
virtual

Implements EvtDecayBase.

Definition at line 50 of file EvtBtoKD3P.cc.

50 {
51 return new EvtBtoKD3P();
52}

◆ decay()

void EvtBtoKD3P::decay ( EvtParticle p)
virtual

Implements EvtDecayBase.

Definition at line 85 of file EvtBtoKD3P.cc.

85 {
86 // tell the subclass that we decay the daughter:
88
89 // the K is the 1st daughter of the B EvtParticle.
90 // The decay mode of the allowed D (the one produced in b->c decay) is 2nd
91 // The decay mode of the suppressed D (the one produced in b->u decay) is 3rd
92 const int KIND = 0;
93 const int D1IND = 1;
94 const int D2IND = 2;
95
96 // generate kinematics of daughters (K and D):
97 EvtId tempDaug[2] = {getDaug(KIND), getDaug(D1IND)};
98 p->initializePhaseSpace(2, tempDaug);
99
100 // Get the D daughter particle and the decay models of the allowed
101 // and suppressed D modes:
102 EvtParticle * theD = p->getDaug(D1IND);
103 EvtPto3P * model1 = (EvtPto3P*)(EvtDecayTable::getDecayFunc(theD));
104
105 // for the suppressed mode, re-initialize theD as the suppressed D alias:
106 theD->init(getDaug(D2IND), theD->getP4());
107 EvtPto3P * model2 = (EvtPto3P*)(EvtDecayTable::getDecayFunc(theD));
108
109 // on the first call:
110 if (false == _decayedOnce) {
111 _decayedOnce = true;
112
113 // store the D decay model pointers:
114 _model1 = model1;
115 _model2 = model2;
116
117 // check the decay models of the first 2 daughters and that they
118 // have the same final states:
119 std::string name1;
120 std::string name2;
121 model1->getName(name1);
122 model2->getName(name2);
123
124 if (name1 != "PTO3P") {
125 report(ERROR,"EvtGen")
126 << "D daughters of EvtBtoKD3P decay must decay via the \"PTO3P\" model"
127 << endl
128 << " but found to decay via " << name1.c_str()
129 << " or " << name2.c_str()
130 << ". Will terminate execution!" << endl;
131 assert(0);
132 }
133
134 EvtId * daugs1 = model1->getDaugs();
135 EvtId * daugs2 = model2->getDaugs();
136
137 bool idMatch = true;
138 int d;
139 for (d = 0; d < 2; ++d) {
140 if (daugs1[d] != daugs2[d]) {
141 idMatch = false;
142 }
143 }
144 if (false == idMatch) {
145 report(ERROR,"EvtGen")
146 << "D daughters of EvtBtoKD3P decay must decay to the same final state"
147 << endl
148 << " particles in the same order (not CP-conjugate order)," << endl
149 << " but they were found to decay to" << endl;
150 for (d = 0; d < model1->getNDaug(); ++d) {
151 report(ERROR,"") << " " << EvtPDL::name(daugs1[d]).c_str() << " ";
152 }
153 report(ERROR,"") << endl;
154 for (d = 0; d < model1->getNDaug(); ++d) {
155 report(ERROR,"") << " " << EvtPDL::name(daugs2[d]).c_str() << " ";
156 }
157 report(ERROR,"") << endl << ". Will terminate execution!" << endl;
158 assert(0);
159 }
160
161 // estimate the probmax. Need to know the probmax's of the 2
162 // models for this:
163 setProbMax(model1->getProbMax(0)
164 + _r * _r * model2->getProbMax(0)
165 + 2 * _r * sqrt(model1->getProbMax(0) * model2->getProbMax(0)));
166
167 } // end of things to do on the first call
168
169 // make sure the models haven't changed since the first call:
170 if (_model1 != model1 || _model2 != model2) {
171 report(ERROR,"EvtGen")
172 << "D daughters of EvtBtoKD3P decay should have only 1 decay modes, "
173 << endl
174 << " but a new decay mode was found after the first call" << endl
175 << " Will terminate execution!" << endl;
176 assert(0);
177 }
178
179 // get the cover function for each of the models and add them up.
180 // They are summed with coefficients 1 because we are willing to
181 // take a small inefficiency (~50%) in order to ensure that the
182 // cover function is large enough without getting into complications
183 // associated with the smallness of _r:
184 EvtPdfSum<EvtDalitzPoint> * pc1 = model1->getPC();
185 EvtPdfSum<EvtDalitzPoint> * pc2 = model2->getPC();
187 pc.addTerm(1.0, *pc1);
188 pc.addTerm(1.0, *pc2);
189
190 // from this combined cover function, generate the Dalitz point:
192
193 // get the aptitude for each of the models on this point and add them up:
194 EvtComplex amp1 = model1->amplNonCP(x);
195 EvtComplex amp2 = model2->amplNonCP(x);
196 EvtComplex amp = amp1 + amp2 * _r * _exp;
197
198 // get the value of the cover function for this point and set the
199 // relative amplitude for this decay:
200
201 double comp = sqrt(pc.evaluate (x));
202 vertex (amp/comp);
203
204 // Make the daughters of theD:
205 theD->generateMassTree();
206
207 // Now generate the p4's of the daughters of theD:
208 std::vector<EvtVector4R> v = model2->initDaughters(x);
209
210 if(v.size() != theD->getNDaug()) {
211 report(ERROR,"EvtGen")
212 << "Number of daughters " << theD->getNDaug()
213 << " != " << "Momentum vector size " << v.size()
214 << endl
215 << " Terminating execution." << endl;
216 assert(0);
217 }
218
219 // Apply the new p4's to the daughters:
220 int i;
221 for(i=0; i<theD->getNDaug(); ++i){
222 theD->getDaug(i)->init(model2->getDaugs()[i], v[i]);
223 }
224}
Double_t x[10]
ostream & report(Severity severity, const char *facility)
Definition: EvtReport.cc:36
@ ERROR
Definition: EvtReport.hh:49
**********Class see also m_nmax DOUBLE PRECISION m_amel DOUBLE PRECISION m_x2 DOUBLE PRECISION m_alfinv DOUBLE PRECISION m_Xenph INTEGER m_KeyWtm INTEGER m_idyfs DOUBLE PRECISION m_zini DOUBLE PRECISION m_q2 DOUBLE PRECISION m_Wt_KF DOUBLE PRECISION m_WtCut INTEGER m_KFfin *COMMON c_KarLud $ !Input CMS energy[GeV] $ !CMS energy after beam spread beam strahlung[GeV] $ !Beam energy spread[GeV] $ !z boost due to beam spread $ !electron beam mass *ff pair spectrum $ !minimum v
Definition: KarLud.h:35
EvtComplex _exp
Definition: EvtBtoKD3P.hh:72
double _r
Definition: EvtBtoKD3P.hh:71
void vertex(const EvtComplex &amp)
Definition: EvtDecayAmp.hh:37
void setProbMax(double prbmx)
double getProbMax(double prob)
Definition: EvtDecayBase.cc:67
EvtId * getDaugs()
Definition: EvtDecayBase.hh:65
bool _daugsDecayedByParentModel
EvtId getDaug(int i)
Definition: EvtDecayBase.hh:66
static EvtDecayBase * getDecayFunc(EvtParticle *)
Definition: EvtId.hh:27
EvtPdfSum< T > * getPC()
EvtComplex amplNonCP(const T &x)
static std::string name(EvtId i)
Definition: EvtPDL.hh:64
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
const EvtVector4R & getP4() const
Definition: EvtParticle.cc:121
int getNDaug() const
Definition: EvtParticle.cc:125
EvtParticle * getDaug(int i)
Definition: EvtParticle.cc:85
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
void generateMassTree()
Definition: EvtParticle.cc:461
void addTerm(double c, const EvtPdf< T > &pdf)
Definition: EvtPdfSum.hh:32
virtual T randomPoint()
Definition: EvtPdfSum.hh:118
double evaluate(const T &p) const
Definition: EvtPdf.hh:65
void getName(std::string &model_name)
Definition: EvtPto3P.hh:32
virtual std::vector< EvtVector4R > initDaughters(const EvtDalitzPoint &p) const
Definition: EvtPto3P.cc:56

◆ getName()

void EvtBtoKD3P::getName ( std::string &  model_name)
virtual

Implements EvtDecayBase.

Definition at line 55 of file EvtBtoKD3P.cc.

55 {
56 model_name="BTOKD3P";
57}

◆ init()

void EvtBtoKD3P::init ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 60 of file EvtBtoKD3P.cc.

60 {
61 checkNArg(2); // r, phase
62 checkNDaug(3); // K, D0(allowed), D0(suppressed).
63 // The last two daughters are really one particle
64
65 // check that the mother and all daughters are scalars:
70
71 // Check that the B dtr types are K D D:
72
73 // get the parameters:
74 _r = getArg(0);
75 double phase = getArg(1);
76 _exp = EvtComplex(cos(phase), sin(phase));
77}
double sin(const BesAngle a)
double cos(const BesAngle a)
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
void checkSpinParent(EvtSpinType::spintype sp)
double getArg(int j)
void checkNDaug(int d1, int d2=-1)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)

◆ initProbMax()

void EvtBtoKD3P::initProbMax ( )
virtual

Reimplemented from EvtDecayBase.

Definition at line 80 of file EvtBtoKD3P.cc.

80 {
81 setProbMax(1); // this is later changed in decay()
82}

◆ nRealDaughters()

virtual int EvtBtoKD3P::nRealDaughters ( )
inlinevirtual

Reimplemented from EvtDecayBase.

Definition at line 65 of file EvtBtoKD3P.hh.

65{ return 2;}

Member Data Documentation

◆ _decayedOnce

bool EvtBtoKD3P::_decayedOnce
protected

Definition at line 77 of file EvtBtoKD3P.hh.

Referenced by decay().

◆ _exp

EvtComplex EvtBtoKD3P::_exp
protected

Definition at line 72 of file EvtBtoKD3P.hh.

Referenced by decay(), and init().

◆ _model1

const EvtDecayBase* EvtBtoKD3P::_model1
protected

Definition at line 75 of file EvtBtoKD3P.hh.

Referenced by decay().

◆ _model2

const EvtDecayBase* EvtBtoKD3P::_model2
protected

Definition at line 76 of file EvtBtoKD3P.hh.

Referenced by decay().

◆ _r

double EvtBtoKD3P::_r
protected

Definition at line 71 of file EvtBtoKD3P.hh.

Referenced by decay(), and init().


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