BOSS
7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/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
//-----------------------------------------------------------------------
16
#include "EvtGenBase/EvtPatches.hh"
17
18
// Decay model that does the decay B+->D0K, D0->3 psudoscalars
19
20
#include <assert.h>
21
22
#include "EvtGenModels/EvtBtoKD3P.hh"
23
#include "EvtGenBase/EvtDecayTable.hh"
24
#include "EvtGenBase/EvtParticle.hh"
25
#include "EvtGenBase/EvtId.hh"
26
#include "EvtGenBase/EvtRandom.hh"
27
#include "EvtGenModels/EvtPto3P.hh"
28
29
#include "EvtGenBase/EvtDalitzPoint.hh"
30
#include "EvtGenBase/EvtCyclic3.hh"
31
using
std::endl;
32
33
//------------------------------------------------------------------
34
EvtBtoKD3P::EvtBtoKD3P
() :
35
_model1(0),
36
_model2(0),
37
_decayedOnce(
false
)
38
{
39
}
40
41
//------------------------------------------------------------------
42
EvtBtoKD3P::EvtBtoKD3P
(
const
EvtBtoKD3P
& other){
43
}
44
45
//------------------------------------------------------------------
46
EvtBtoKD3P::~EvtBtoKD3P
(){
47
}
48
49
//------------------------------------------------------------------
50
EvtDecayBase
*
EvtBtoKD3P::clone
(){
51
return
new
EvtBtoKD3P
();
52
}
53
54
//------------------------------------------------------------------
55
void
EvtBtoKD3P::getName
(std::string& model_name){
56
model_name=
"BTOKD3P"
;
57
}
58
59
//------------------------------------------------------------------
60
void
EvtBtoKD3P::init
(){
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:
66
checkSpinParent
(
EvtSpinType::SCALAR
);
67
checkSpinDaughter
(0,
EvtSpinType::SCALAR
);
68
checkSpinDaughter
(1,
EvtSpinType::SCALAR
);
69
checkSpinDaughter
(2,
EvtSpinType::SCALAR
);
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
//------------------------------------------------------------------
80
void
EvtBtoKD3P::initProbMax
(){
81
setProbMax
(1);
// this is later changed in decay()
82
}
83
84
//------------------------------------------------------------------
85
void
EvtBtoKD3P::decay
(
EvtParticle
*p){
86
// tell the subclass that we decay the daughter:
87
_daugsDecayedByParentModel
=
true
;
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
();
186
EvtPdfSum<EvtDalitzPoint>
pc;
187
pc.
addTerm
(1.0, *pc1);
188
pc.
addTerm
(1.0, *pc2);
189
190
// from this combined cover function, generate the Dalitz point:
191
EvtDalitzPoint
x
= pc.
randomPoint
();
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
sin
double sin(const BesAngle a)
Definition:
BesAngle.h:210
cos
double cos(const BesAngle a)
Definition:
BesAngle.h:213
false
#define false
Definition:
BesCxxPolicy/BesCxxPolicy-00-01-01/CxxFeatures/config.h:22
x
Double_t x[10]
Definition:
DataBase/tau_mode.c:57
v
**********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
report
ostream & report(Severity severity, const char *facility)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtReport.cc:36
ERROR
@ ERROR
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtReport.hh:49
EvtBtoKD3P
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtBtoKD3P.hh:51
EvtBtoKD3P::getName
void getName(std::string &model_name)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtBtoKD3P.cc:55
EvtBtoKD3P::_decayedOnce
bool _decayedOnce
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtBtoKD3P.hh:77
EvtBtoKD3P::clone
EvtDecayBase * clone()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtBtoKD3P.cc:50
EvtBtoKD3P::initProbMax
virtual void initProbMax()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtBtoKD3P.cc:80
EvtBtoKD3P::_model2
const EvtDecayBase * _model2
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtBtoKD3P.hh:76
EvtBtoKD3P::_exp
EvtComplex _exp
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtBtoKD3P.hh:72
EvtBtoKD3P::init
virtual void init()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtBtoKD3P.cc:60
EvtBtoKD3P::decay
virtual void decay(EvtParticle *p)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtBtoKD3P.cc:85
EvtBtoKD3P::_model1
const EvtDecayBase * _model1
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtBtoKD3P.hh:75
EvtBtoKD3P::EvtBtoKD3P
EvtBtoKD3P()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtBtoKD3P.cc:34
EvtBtoKD3P::_r
double _r
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtBtoKD3P.hh:71
EvtBtoKD3P::~EvtBtoKD3P
virtual ~EvtBtoKD3P()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtBtoKD3P.cc:46
EvtComplex
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtComplex.hh:28
EvtDalitzPoint
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDalitzPoint.hh:27
EvtDecayAmp::vertex
void vertex(const EvtComplex &)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayAmp.hh:37
EvtDecayBase
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.hh:33
EvtDecayBase::checkSpinDaughter
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.cc:533
EvtDecayBase::checkSpinParent
void checkSpinParent(EvtSpinType::spintype sp)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.cc:520
EvtDecayBase::getArg
double getArg(int j)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.cc:564
EvtDecayBase::setProbMax
void setProbMax(double prbmx)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.cc:297
EvtDecayBase::getProbMax
double getProbMax(double prob)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.cc:67
EvtDecayBase::getNDaug
int getNDaug()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.hh:64
EvtDecayBase::checkNDaug
void checkNDaug(int d1, int d2=-1)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.cc:504
EvtDecayBase::getDaugs
EvtId * getDaugs()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.hh:65
EvtDecayBase::checkNArg
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.cc:482
EvtDecayBase::_daugsDecayedByParentModel
bool _daugsDecayedByParentModel
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.hh:109
EvtDecayBase::getDaug
EvtId getDaug(int i)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayBase.hh:66
EvtDecayTable::getDecayFunc
static EvtDecayBase * getDecayFunc(EvtParticle *)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtDecayTable.cc:73
EvtId
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtId.hh:27
EvtIntervalDecayAmp::getPC
EvtPdfSum< T > * getPC()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtIntervalDecayAmp.hh:171
EvtIntervalDecayAmp::amplNonCP
EvtComplex amplNonCP(const T &x)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtIntervalDecayAmp.hh:170
EvtPDL::name
static std::string name(EvtId i)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPDL.hh:64
EvtParticle
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.hh:42
EvtParticle::init
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtParticle::getP4
const EvtVector4R & getP4() const
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:121
EvtParticle::getNDaug
int getNDaug() const
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:125
EvtParticle::getDaug
EvtParticle * getDaug(int i)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:85
EvtParticle::initializePhaseSpace
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:1071
EvtParticle::generateMassTree
void generateMassTree()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtParticle.cc:461
EvtPdfSum
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdfSum.hh:21
EvtPdfSum::addTerm
void addTerm(double c, const EvtPdf< T > &pdf)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdfSum.hh:32
EvtPdfSum::randomPoint
virtual T randomPoint()
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdfSum.hh:118
EvtPdf::evaluate
double evaluate(const T &p) const
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtPdf.hh:65
EvtPto3P
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPto3P.hh:26
EvtPto3P::getName
void getName(std::string &model_name)
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPto3P.hh:32
EvtPto3P::initDaughters
virtual std::vector< EvtVector4R > initDaughters(const EvtDalitzPoint &p) const
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenModels/EvtPto3P.cc:56
EvtSpinType::SCALAR
@ SCALAR
Definition:
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtSpinType.hh:31
source
Generator
BesEvtGen
bak-BesEvtGen-00-04-08
src
EvtGen
EvtGenModels
EvtBtoKD3P.cc
Generated by
1.9.6