EvtGen
2.2.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
Toggle main menu visibility
Loading...
Searching...
No Matches
src
EvtGenModels
EvtBtoKD3P.cpp
Go to the documentation of this file.
1
2
/***********************************************************************
3
* Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4
* *
5
* This file is part of EvtGen. *
6
* *
7
* EvtGen is free software: you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation, either version 3 of the License, or *
10
* (at your option) any later version. *
11
* *
12
* EvtGen is distributed in the hope that it will be useful, *
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
* GNU General Public License for more details. *
16
* *
17
* You should have received a copy of the GNU General Public License *
18
* along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19
***********************************************************************/
20
21
#include "
EvtGenModels/EvtBtoKD3P.hh
"
22
23
#include "
EvtGenBase/EvtCyclic3.hh
"
24
#include "
EvtGenBase/EvtDalitzPoint.hh
"
25
#include "
EvtGenBase/EvtDecayTable.hh
"
26
#include "
EvtGenBase/EvtId.hh
"
27
#include "
EvtGenBase/EvtParticle.hh
"
28
#include "
EvtGenBase/EvtRandom.hh
"
29
#include "
EvtGenBase/EvtReport.hh
"
30
31
#include "
EvtGenModels/EvtPto3P.hh
"
32
33
#include <assert.h>
34
using
std::endl;
35
36
//------------------------------------------------------------------
37
EvtDecayBase
*
EvtBtoKD3P::clone
()
const
38
{
39
return
new
EvtBtoKD3P
();
40
}
41
42
//------------------------------------------------------------------
43
std::string
EvtBtoKD3P::getName
()
const
44
{
45
return
"BTOKD3P"
;
46
}
47
48
//------------------------------------------------------------------
49
void
EvtBtoKD3P::init
()
50
{
51
checkNArg
( 2 );
// r, phase
52
checkNDaug
( 3 );
// K, D0(allowed), D0(suppressed).
53
// The last two daughters are really one particle
54
55
// check that the mother and all daughters are scalars:
56
checkSpinParent
(
EvtSpinType::SCALAR
);
57
checkSpinDaughter
( 0,
EvtSpinType::SCALAR
);
58
checkSpinDaughter
( 1,
EvtSpinType::SCALAR
);
59
checkSpinDaughter
( 2,
EvtSpinType::SCALAR
);
60
61
// Check that the B dtr types are K D D:
62
63
// get the parameters:
64
m_r
=
getArg
( 0 );
65
double
phase =
getArg
( 1 );
66
m_exp
=
EvtComplex
( cos( phase ), sin( phase ) );
67
}
68
69
//------------------------------------------------------------------
70
void
EvtBtoKD3P::initProbMax
()
71
{
72
setProbMax
( 1 );
// this is later changed in decay()
73
}
74
75
//------------------------------------------------------------------
76
void
EvtBtoKD3P::decay
(
EvtParticle
* p )
77
{
78
// tell the subclass that we decay the daughter:
79
m_daugsDecayedByParentModel
=
true
;
80
81
// the K is the 1st daughter of the B EvtParticle.
82
// The decay mode of the allowed D (the one produced in b->c decay) is 2nd
83
// The decay mode of the suppressed D (the one produced in b->u decay) is 3rd
84
const
int
KIND = 0;
85
const
int
D1IND = 1;
86
const
int
D2IND = 2;
87
88
// generate kinematics of daughters (K and D):
89
EvtId
tempDaug[2] = {
getDaug
( KIND ),
getDaug
( D1IND ) };
90
p->
initializePhaseSpace
( 2, tempDaug );
91
92
// Get the D daughter particle and the decay models of the allowed
93
// and suppressed D modes:
94
EvtParticle
* theD = p->
getDaug
( D1IND );
95
EvtPto3P
* model1 =
dynamic_cast<
EvtPto3P
*
>
(
96
EvtDecayTable::getInstance
().
getDecayFunc
( theD ) );
97
98
// For the suppressed mode, re-initialize theD as the suppressed D alias.
99
// First set the id, then re-initialize (since it matches the expected id)
100
theD->
setId
(
getDaug
( D2IND ) );
101
theD->
init
(
getDaug
( D2IND ), theD->
getP4
() );
102
EvtPto3P
* model2 =
dynamic_cast<
EvtPto3P
*
>
(
103
EvtDecayTable::getInstance
().
getDecayFunc
( theD ) );
104
105
// on the first call:
106
if
(
false
==
m_decayedOnce
) {
107
m_decayedOnce
=
true
;
108
109
// store the D decay model pointers:
110
m_model1
= model1;
111
m_model2
= model2;
112
113
// check the decay models of the first 2 daughters and that they
114
// have the same final states:
115
std::string name1 = model1->
getName
();
116
std::string name2 = model2->
getName
();
117
118
if
( name1 !=
"PTO3P"
) {
119
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
120
<<
"D daughters of EvtBtoKD3P decay must decay via the \"PTO3P\" model"
121
<< endl
122
<<
" but found to decay via "
<< name1.c_str() <<
" or "
123
<< name2.c_str() <<
". Will terminate execution!"
<< endl;
124
assert( 0 );
125
}
126
127
const
EvtId
* daugs1 = model1->
getDaugs
();
128
const
EvtId
* daugs2 = model2->
getDaugs
();
129
130
bool
idMatch =
true
;
131
int
d;
132
for
( d = 0; d < 2; ++d ) {
133
if
( daugs1[d] != daugs2[d] ) {
134
idMatch =
false
;
135
}
136
}
137
if
(
false
== idMatch ) {
138
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
139
<<
"D daughters of EvtBtoKD3P decay must decay to the same final state"
140
<< endl
141
<<
" particles in the same order (not CP-conjugate order),"
142
<< endl
143
<<
" but they were found to decay to"
<< endl;
144
for
( d = 0; d < model1->
getNDaug
(); ++d ) {
145
EvtGenReport
(
EVTGEN_ERROR
,
""
)
146
<<
" "
<<
EvtPDL::name
( daugs1[d] ).c_str() <<
" "
;
147
}
148
EvtGenReport
(
EVTGEN_ERROR
,
""
) << endl;
149
for
( d = 0; d < model1->
getNDaug
(); ++d ) {
150
EvtGenReport
(
EVTGEN_ERROR
,
""
)
151
<<
" "
<<
EvtPDL::name
( daugs2[d] ).c_str() <<
" "
;
152
}
153
EvtGenReport
(
EVTGEN_ERROR
,
""
)
154
<< endl
155
<<
". Will terminate execution!"
<< endl;
156
assert( 0 );
157
}
158
159
// estimate the probmax. Need to know the probmax's of the 2
160
// models for this:
161
setProbMax
(
162
model1->
getProbMax
( 0 ) +
m_r
*
m_r
* model2->
getProbMax
( 0 ) +
163
2 *
m_r
* sqrt( model1->
getProbMax
( 0 ) * model2->
getProbMax
( 0 ) ) );
164
165
}
// end of things to do on the first call
166
167
// make sure the models haven't changed since the first call:
168
if
(
m_model1
!= model1 ||
m_model2
!= model2 ) {
169
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
170
<<
"D daughters of EvtBtoKD3P decay should have only 1 decay modes, "
171
<< endl
172
<<
" but a new decay mode was found after the first call"
<< endl
173
<<
" Will terminate execution!"
<< endl;
174
assert( 0 );
175
}
176
177
// Reset the D id to the 1st D
178
theD->
setId
(
getDaug
( D1IND ) );
179
theD->
init
(
getDaug
( D1IND ), theD->
getP4
() );
180
181
// get the cover function for each of the models and add them up.
182
// They are summed with coefficients 1 because we are willing to
183
// take a small inefficiency (~50%) in order to ensure that the
184
// cover function is large enough without getting into complications
185
// associated with the smallness of m_r:
186
EvtPdfSum<EvtDalitzPoint>
* pc1 = model1->
getPC
();
187
EvtPdfSum<EvtDalitzPoint>
* pc2 = model2->
getPC
();
188
EvtPdfSum<EvtDalitzPoint>
pc;
189
pc.
addTerm
( 1.0, *pc1 );
190
pc.
addTerm
( 1.0, *pc2 );
191
192
// from this combined cover function, generate the Dalitz point:
193
EvtDalitzPoint
x = pc.
randomPoint
();
194
195
// get the aptitude for each of the models on this point and add them up:
196
EvtComplex
amp1 = model1->
amplNonCP
( x );
197
EvtComplex
amp2 = model2->
amplNonCP
( x );
198
EvtComplex
amp = amp1 + amp2 *
m_r
*
m_exp
;
199
200
// get the value of the cover function for this point and set the
201
// relative amplitude for this decay:
202
203
double
comp = sqrt( pc.
evaluate
( x ) );
204
vertex
( amp / comp );
205
206
// Make the daughters of theD:
207
bool
massTreeOK = theD->
generateMassTree
();
208
if
( massTreeOK ==
false
) {
209
return
;
210
}
211
212
// Now generate the p4's of the daughters of theD:
213
std::vector<EvtVector4R> v = model2->
initDaughters
( x );
214
215
if
( v.size() != theD->
getNDaug
() ) {
216
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
217
<<
"Number of daughters "
<< theD->
getNDaug
() <<
" != "
218
<<
"Momentum vector size "
<< v.size() << endl
219
<<
" Terminating execution."
<< endl;
220
assert( 0 );
221
}
222
223
// Apply the new p4's to the daughters:
224
for
(
unsigned
int
i = 0; i < theD->
getNDaug
(); ++i ) {
225
theD->
getDaug
( i )->
init
( model2->
getDaugs
()[i], v[i] );
226
}
227
}
EvtBtoKD3P.hh
EvtCyclic3.hh
EvtDalitzPoint.hh
EvtDecayTable.hh
EvtId.hh
EvtParticle.hh
EvtPto3P.hh
EvtRandom.hh
EvtReport.hh
EvtGenReport
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
Definition
EvtReport.cpp:32
EVTGEN_ERROR
@ EVTGEN_ERROR
Definition
EvtReport.hh:49
EvtBtoKD3P
Definition
EvtBtoKD3P.hh:53
EvtBtoKD3P::initProbMax
void initProbMax() override
Definition
EvtBtoKD3P.cpp:70
EvtBtoKD3P::decay
void decay(EvtParticle *p) override
Definition
EvtBtoKD3P.cpp:76
EvtBtoKD3P::getName
std::string getName() const override
Definition
EvtBtoKD3P.cpp:43
EvtBtoKD3P::m_r
double m_r
Definition
EvtBtoKD3P.hh:69
EvtBtoKD3P::m_exp
EvtComplex m_exp
Definition
EvtBtoKD3P.hh:70
EvtBtoKD3P::init
void init() override
Definition
EvtBtoKD3P.cpp:49
EvtBtoKD3P::m_model1
const EvtDecayBase * m_model1
Definition
EvtBtoKD3P.hh:73
EvtBtoKD3P::clone
EvtDecayBase * clone() const override
Definition
EvtBtoKD3P.cpp:37
EvtBtoKD3P::m_decayedOnce
bool m_decayedOnce
Definition
EvtBtoKD3P.hh:75
EvtBtoKD3P::m_model2
const EvtDecayBase * m_model2
Definition
EvtBtoKD3P.hh:74
EvtComplex
Definition
EvtComplex.hh:29
EvtDalitzPoint
Definition
EvtDalitzPoint.hh:38
EvtDecayAmp::vertex
void vertex(const EvtComplex &)
Definition
EvtDecayAmp.hh:37
EvtDecayBase::checkSpinDaughter
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
Definition
EvtDecayBase.cpp:547
EvtDecayBase::EvtDecayBase
EvtDecayBase()=default
EvtDecayBase::getNDaug
int getNDaug() const
Definition
EvtDecayBase.hh:64
EvtDecayBase::checkSpinParent
void checkSpinParent(EvtSpinType::spintype sp)
Definition
EvtDecayBase.cpp:534
EvtDecayBase::getArg
double getArg(unsigned int j)
Definition
EvtDecayBase.cpp:578
EvtDecayBase::setProbMax
void setProbMax(double prbmx)
Definition
EvtDecayBase.cpp:295
EvtDecayBase::m_daugsDecayedByParentModel
bool m_daugsDecayedByParentModel
Definition
EvtDecayBase.hh:110
EvtDecayBase::getDaug
EvtId getDaug(int i) const
Definition
EvtDecayBase.hh:66
EvtDecayBase::getProbMax
double getProbMax(double prob)
Definition
EvtDecayBase.cpp:74
EvtDecayBase::checkNDaug
void checkNDaug(int d1, int d2=-1)
Definition
EvtDecayBase.cpp:516
EvtDecayBase::checkNArg
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
Definition
EvtDecayBase.cpp:492
EvtDecayBase::getDaugs
const EvtId * getDaugs() const
Definition
EvtDecayBase.hh:65
EvtDecayTable::getInstance
static EvtDecayTable & getInstance()
Definition
EvtDecayTable.cpp:58
EvtDecayTable::getDecayFunc
EvtDecayBase * getDecayFunc(EvtParticle *p)
Definition
EvtDecayTable.cpp:82
EvtId
Definition
EvtId.hh:27
EvtIntervalDecayAmp::getPC
EvtPdfSum< T > * getPC()
Definition
EvtIntervalDecayAmp.hh:191
EvtIntervalDecayAmp::amplNonCP
EvtComplex amplNonCP(const T &x)
Definition
EvtIntervalDecayAmp.hh:187
EvtPDL::name
static std::string name(EvtId i)
Definition
EvtPDL.cpp:376
EvtParticle
Definition
EvtParticle.hh:45
EvtParticle::init
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtParticle::initializePhaseSpace
double initializePhaseSpace(size_t numdaughter, const EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
Definition
EvtParticle.cpp:1100
EvtParticle::getP4
const EvtVector4R & getP4() const
Definition
EvtParticle.cpp:144
EvtParticle::getDaug
EvtParticle * getDaug(const int i)
Definition
EvtParticle.hh:173
EvtParticle::getNDaug
size_t getNDaug() const
Definition
EvtParticle.cpp:154
EvtParticle::generateMassTree
bool generateMassTree()
Definition
EvtParticle.cpp:509
EvtParticle::setId
void setId(EvtId id)
Definition
EvtParticle.hh:389
EvtPdfSum
Definition
EvtPdfSum.hh:32
EvtPdfSum::addTerm
void addTerm(double c, const EvtPdf< T > &pdf)
Definition
EvtPdfSum.hh:41
EvtPdfSum::randomPoint
T randomPoint() override
Definition
EvtPdfSum.hh:129
EvtPdf::evaluate
double evaluate(const T &p) const
Definition
EvtPdf.hh:79
EvtPto3P
Definition
EvtPto3P.hh:31
EvtPto3P::initDaughters
std::vector< EvtVector4R > initDaughters(const EvtDalitzPoint &p) const override
Definition
EvtPto3P.cpp:61
EvtPto3P::getName
std::string getName() const override
Definition
EvtPto3P.hh:35
EvtSpinType::SCALAR
@ SCALAR
Definition
EvtSpinType.hh:30
Generated by
1.17.0