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
EvtSVP.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/EvtSVP.hh
"
22
23
#include "
EvtGenBase/EvtDiracSpinor.hh
"
24
#include "
EvtGenBase/EvtPDL.hh
"
25
#include "
EvtGenBase/EvtParticle.hh
"
26
#include "
EvtGenBase/EvtSpinType.hh
"
27
#include "
EvtGenBase/EvtVector4C.hh
"
28
#include "
EvtGenBase/EvtVector4R.hh
"
29
30
#include <cmath>
31
32
std::string
EvtSVP::getName
()
const
33
{
34
return
"SVP"
;
35
}
36
37
EvtDecayBase
*
EvtSVP::clone
()
const
38
{
39
return
new
EvtSVP
;
40
}
41
42
void
EvtSVP::decay_2body
(
EvtParticle
* root )
43
{
44
root->
initializePhaseSpace
(
getNDaug
(),
getDaugs
() );
45
// Photon is the first particle and psi is the second
46
// to ensure decay file backwards compatibility
47
EvtParticle
* photon = root->
getDaug
( 0 );
48
EvtParticle
* psi = root->
getDaug
( 1 );
49
50
EvtVector4R
p = psi->
getP4
(),
// psi momentum
51
k = photon->
getP4
();
// Photon momentum
52
53
bool
validAmp(
true
);
54
55
double
kp = k * p;
56
if
( fabs( kp ) < 1e-10 ) {
57
validAmp =
false
;
58
}
59
60
for
(
int
iPsi = 0; iPsi < 3; iPsi++ ) {
61
EvtVector4C
epsPsi = psi->
epsParent
( iPsi ).
conj
();
62
for
(
int
iGamma = 0; iGamma < 2; iGamma++ ) {
63
EvtVector4C
epsGamma = photon->
epsParentPhoton
( iGamma ).
conj
();
64
EvtComplex
amp( 0.0, 0.0 );
65
if
( validAmp ) {
66
amp = ( epsPsi * epsGamma ) -
67
( epsPsi * k ) * ( epsGamma * p ) / kp;
68
}
69
vertex
( iGamma, iPsi, amp );
70
}
71
}
72
}
73
74
void
EvtSVP::decay_3body
(
EvtParticle
* root )
75
{
76
root->
initializePhaseSpace
(
getNDaug
(),
getDaugs
() );
77
EvtParticle
* psi = root->
getDaug
( 0 );
78
EvtParticle
* mup = root->
getDaug
( 1 );
79
EvtParticle
* mum = root->
getDaug
( 2 );
80
81
EvtVector4R
p = psi->
getP4
(),
// psi momentum
82
k1 = mup->
getP4
(),
// mu+ momentum
83
k2 = mum->
getP4
(),
// mu- momentum
84
k = k1 + k2;
// photon momentum
85
86
double
kSq = k * k;
87
88
// The decay amplitude needs four-vector products. Make sure we have
89
// valid values for these, otherwise set the amplitude to zero.
90
// We need to set _amp2 (EvtDecayAmp) via the vertex() function call
91
// even when the amplitude is zero, otherwise the amplitude from the
92
// previous accepted event will be used, potentially leading to biases
93
94
// Selection on k^2 to avoid inefficient generation for the electron modes
95
bool
validAmp(
true
);
96
if
( kSq < 1e-3 ) {
97
validAmp =
false
;
98
}
99
100
// Extra checks to make sure we are not dividing by zero
101
double
kp = k * p;
102
if
( fabs( kp ) < 1e-10 ) {
103
validAmp =
false
;
104
}
105
106
double
dSq =
m_delta
*
m_delta
;
107
double
dSqDenom = dSq - kSq;
108
if
( fabs( dSqDenom ) < 1e-10 ) {
109
validAmp =
false
;
110
}
111
112
double
factor( 1.0 );
113
if
( validAmp ) {
114
factor = dSq / ( dSqDenom * kSq );
115
}
116
117
// Calculate the amplitude terms, looping over the psi and lepton states
118
for
(
int
iPsi = 0; iPsi < 3; iPsi++ ) {
119
EvtVector4C
epsPsi = psi->
epsParent
( iPsi ).
conj
();
120
121
for
(
int
iMplus = 0; iMplus < 2; iMplus++ ) {
122
EvtDiracSpinor
spMplus = mup->
spParent
( iMplus );
123
124
for
(
int
iMminus = 0; iMminus < 2; iMminus++ ) {
125
EvtDiracSpinor
spMminus = mum->
spParent
( iMminus );
126
EvtVector4C
epsGamma =
EvtLeptonVCurrent
( spMplus, spMminus );
127
EvtComplex
amp( 0.0, 0.0 );
128
if
( validAmp ) {
129
amp = ( epsPsi * epsGamma ) -
130
( epsPsi * k ) * ( epsGamma * p ) / kp;
131
}
132
amp *= factor;
133
134
// Set the amplitude matrix element using the vertex function
135
vertex
( iPsi, iMplus, iMminus, amp );
136
}
137
}
138
}
139
}
140
141
void
EvtSVP::decay
(
EvtParticle
* root )
142
{
143
if
(
getNDaug
() == 2 ) {
144
decay_2body
( root );
145
}
else
if
(
getNDaug
() == 3 ) {
146
decay_3body
( root );
147
}
148
}
149
150
void
EvtSVP::init
()
151
{
152
checkSpinParent
(
EvtSpinType::SCALAR
);
153
154
if
(
getNDaug
() == 2 ) {
// chi -> gamma psi radiative mode
155
checkNArg
( 0 );
156
checkNDaug
( 2 );
157
checkSpinDaughter
( 0,
EvtSpinType::PHOTON
);
158
checkSpinDaughter
( 1,
EvtSpinType::VECTOR
);
159
160
}
else
if
(
getNDaug
() == 3 ) {
// chi -> psi lepton lepton
161
checkSpinParent
(
EvtSpinType::SCALAR
);
162
checkSpinDaughter
( 0,
EvtSpinType::VECTOR
);
163
checkSpinDaughter
( 1,
EvtSpinType::DIRAC
);
164
checkSpinDaughter
( 2,
EvtSpinType::DIRAC
);
165
checkNArg
( 1 );
166
m_delta
=
getArg
( 0 );
167
}
168
}
169
170
void
EvtSVP::initProbMax
()
171
{
172
if
(
getNDaug
() == 2 ) {
173
setProbMax
( 2.2 );
174
175
}
else
if
(
getNDaug
() == 3 ) {
176
const
EvtId
daugId =
getDaug
( 1 );
177
178
if
( daugId ==
EvtPDL::getId
(
"mu+"
) ||
179
daugId ==
EvtPDL::getId
(
"mu-"
) ) {
180
setProbMax
( 130.0 );
181
}
else
if
( daugId ==
EvtPDL::getId
(
"e+"
) ||
182
daugId ==
EvtPDL::getId
(
"e-"
) ) {
183
setProbMax
( 4100.0 );
184
}
185
}
186
}
EvtLeptonVCurrent
EvtVector4C EvtLeptonVCurrent(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
Definition
EvtDiracSpinor.cpp:208
EvtDiracSpinor.hh
EvtPDL.hh
EvtParticle.hh
EvtSVP.hh
EvtSpinType.hh
EvtVector4C.hh
EvtVector4R.hh
EvtComplex
Definition
EvtComplex.hh:29
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::getDaug
EvtId getDaug(int i) const
Definition
EvtDecayBase.hh:66
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
EvtDiracSpinor
Definition
EvtDiracSpinor.hh:32
EvtId
Definition
EvtId.hh:27
EvtPDL::getId
static EvtId getId(const std::string &name)
Definition
EvtPDL.cpp:283
EvtParticle
Definition
EvtParticle.hh:45
EvtParticle::epsParent
virtual EvtVector4C epsParent(int i) const
Definition
EvtParticle.cpp:611
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::spParent
virtual EvtDiracSpinor spParent(int) const
Definition
EvtParticle.cpp:660
EvtParticle::getP4
const EvtVector4R & getP4() const
Definition
EvtParticle.cpp:144
EvtParticle::getDaug
EvtParticle * getDaug(const int i)
Definition
EvtParticle.hh:173
EvtParticle::epsParentPhoton
virtual EvtVector4C epsParentPhoton(int i) const
Definition
EvtParticle.cpp:635
EvtSVP
Definition
EvtSVP.hh:35
EvtSVP::decay
void decay(EvtParticle *p) override
Definition
EvtSVP.cpp:141
EvtSVP::getName
std::string getName() const override
Definition
EvtSVP.cpp:32
EvtSVP::decay_3body
void decay_3body(EvtParticle *p)
Definition
EvtSVP.cpp:74
EvtSVP::decay_2body
void decay_2body(EvtParticle *p)
Definition
EvtSVP.cpp:42
EvtSVP::initProbMax
void initProbMax() override
Definition
EvtSVP.cpp:170
EvtSVP::init
void init() override
Definition
EvtSVP.cpp:150
EvtSVP::clone
EvtDecayBase * clone() const override
Definition
EvtSVP.cpp:37
EvtSVP::m_delta
double m_delta
Definition
EvtSVP.hh:48
EvtSpinType::SCALAR
@ SCALAR
Definition
EvtSpinType.hh:30
EvtSpinType::DIRAC
@ DIRAC
Definition
EvtSpinType.hh:33
EvtSpinType::PHOTON
@ PHOTON
Definition
EvtSpinType.hh:34
EvtSpinType::VECTOR
@ VECTOR
Definition
EvtSpinType.hh:31
EvtVector4C
Definition
EvtVector4C.hh:30
EvtVector4C::conj
EvtVector4C conj() const
Definition
EvtVector4C.hh:204
EvtVector4R
Definition
EvtVector4R.hh:29
Generated by
1.17.0