BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtBtoKD3P.cc
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// File and Version Information:
3// $Id: EvtBtoKD3P.cc,v 1.2 2009/12/18 08:43:52 pingrg Exp $
4//
5// Environment:
6// This software is part of the EvtGen package developed jointly
7// for the BaBar and CLEO collaborations. If you use all or part
8// of it, please give an appropriate acknowledgement.
9//
10// Copyright Information:
11// Copyright (C) 2003, Colorado State University
12//
13// Module creator:
14// Abi soffer, CSU, 2003
15//-----------------------------------------------------------------------
17
18// Decay model that does the decay B+->D0K, D0->3 psudoscalars
19
20#include <assert.h>
21
25#include "EvtGenBase/EvtId.hh"
28
31using std::endl;
32
33//------------------------------------------------------------------
35 _model1(0),
36 _model2(0),
37 _decayedOnce(false)
38{
39}
40
41//------------------------------------------------------------------
43}
44
45//------------------------------------------------------------------
47}
48
49//------------------------------------------------------------------
51 return new EvtBtoKD3P();
52}
53
54//------------------------------------------------------------------
55void EvtBtoKD3P::getName(std::string& model_name){
56 model_name="BTOKD3P";
57}
58
59//------------------------------------------------------------------
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}
78
79//------------------------------------------------------------------
81 setProbMax(1); // this is later changed in decay()
82}
83
84//------------------------------------------------------------------
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}
225
Double_t x[10]
ostream & report(Severity severity, const char *facility)
Definition: EvtReport.cc:36
@ ERROR
Definition: EvtReport.hh:49
double sin(const BesAngle a)
double cos(const BesAngle a)
**********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
void getName(std::string &model_name)
Definition: EvtBtoKD3P.cc:55
bool _decayedOnce
Definition: EvtBtoKD3P.hh:77
EvtDecayBase * clone()
Definition: EvtBtoKD3P.cc:50
virtual void initProbMax()
Definition: EvtBtoKD3P.cc:80
EvtComplex _exp
Definition: EvtBtoKD3P.hh:72
virtual void init()
Definition: EvtBtoKD3P.cc:60
virtual void decay(EvtParticle *p)
Definition: EvtBtoKD3P.cc:85
const EvtDecayBase * _model2
Definition: EvtBtoKD3P.hh:76
const EvtDecayBase * _model1
Definition: EvtBtoKD3P.hh:75
double _r
Definition: EvtBtoKD3P.hh:71
virtual ~EvtBtoKD3P()
Definition: EvtBtoKD3P.cc:46
void vertex(const EvtComplex &amp)
Definition: EvtDecayAmp.hh:37
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
void checkSpinParent(EvtSpinType::spintype sp)
double getArg(int j)
void setProbMax(double prbmx)
double getProbMax(double prob)
Definition: EvtDecayBase.cc:67
void checkNDaug(int d1, int d2=-1)
EvtId * getDaugs()
Definition: EvtDecayBase.hh:65
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
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