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
EvtHypNonLepton.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/EvtHypNonLepton.hh
"
22
23
#include "
EvtGenBase/EvtComplex.hh
"
24
#include "
EvtGenBase/EvtDiracSpinor.hh
"
25
#include "
EvtGenBase/EvtGammaMatrix.hh
"
26
#include "
EvtGenBase/EvtPDL.hh
"
27
#include "
EvtGenBase/EvtParticle.hh
"
28
#include "
EvtGenBase/EvtTensor4C.hh
"
29
#include "
EvtGenBase/EvtVector4C.hh
"
30
#include "
EvtGenBase/EvtVector4R.hh
"
31
32
EvtDecayBase
*
EvtHypNonLepton::clone
()
const
33
{
34
return
new
EvtHypNonLepton
;
35
}
36
37
std::string
EvtHypNonLepton::getName
()
const
38
{
39
return
"HypNonLepton"
;
40
}
41
42
void
EvtHypNonLepton::init
()
43
{
44
if
(
getNArg
() < 2 ||
getNArg
() > 3 ) {
// alpha phi gamma delta
45
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
46
<<
" ERROR: EvtHypNonLepton generator expected 2 or 3 arguments but found: "
47
<<
getNArg
() << std::endl;
48
EvtGenReport
(
EVTGEN_INFO
,
"EvtGen"
)
49
<<
" 1. Decay asymmetry parameter - alpha"
<< std::endl;
50
EvtGenReport
(
EVTGEN_INFO
,
"EvtGen"
)
51
<<
" 2. Parameter phi - in degrees (not radians)"
<< std::endl;
52
EvtGenReport
(
EVTGEN_INFO
,
"EvtGen"
)
53
<<
" 3. Note on every x-th decay"
<< std::endl;
54
::abort();
55
}
56
57
if
(
getNDaug
() != 2 ) {
// Check that there are 2 daughters only
58
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
59
<<
" ERROR: EvtHypNonLepton generator expected 2 daughters but found: "
60
<<
getNDaug
() << std::endl;
61
::abort();
62
}
63
64
// Check particles spins
65
if
(
EvtSpinType::getSpin2
(
EvtPDL::getSpinType
(
getParentId
() ) ) != 1 ) {
66
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
67
<<
" ERROR: EvtHypNonLepton generator expected dirac parent particle, but found "
68
<<
EvtSpinType::getSpin2
(
EvtPDL::getSpinType
(
getParentId
() ) )
69
<<
" spin degrees of freedom"
<< std::endl;
70
::abort();
71
}
72
if
(
EvtSpinType::getSpin2
(
EvtPDL::getSpinType
(
getDaug
( 0 ) ) ) != 1 ) {
73
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
74
<<
" ERROR: EvtHypNonLepton generator expected the first child to be dirac particle, but found "
75
<<
EvtSpinType::getSpin2
(
EvtPDL::getSpinType
(
getDaug
( 0 ) ) )
76
<<
" spin degrees of freedom"
<< std::endl;
77
::abort();
78
}
79
if
(
EvtSpinType::getSpin2
(
EvtPDL::getSpinType
(
getDaug
( 1 ) ) ) != 0 ) {
80
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
81
<<
" ERROR: EvtHypNonLepton generator expected the second child to be scalar particle, but found "
82
<<
EvtSpinType::getSpin2
(
EvtPDL::getSpinType
(
getDaug
( 1 ) ) )
83
<<
" spin degrees of freedom"
<< std::endl;
84
::abort();
85
}
86
87
// Read all parameters
88
m_alpha
=
getArg
( 0 );
89
m_phi
=
getArg
( 1 ) *
EvtConst::pi
/ 180;
90
if
(
getNArg
() == 3 )
91
m_noTries
=
static_cast<
decltype(
m_noTries
)
>
(
getArg
( 2 ) );
92
else
93
m_noTries
= 0;
94
95
// calculate additional parameters
96
double
p, M, m1, m2;
97
double
p_to_s, beta, delta, gamma;
98
99
M =
EvtPDL::getMass
(
getParentId
() );
100
m1 =
EvtPDL::getMass
(
getDaug
( 0 ) );
101
m2 =
EvtPDL::getMass
(
getDaug
( 1 ) );
102
103
if
( m1 + m2 >= M ) {
104
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
105
<<
" ERROR: EvtHypNonLepton found impossible decay: "
<< M
106
<<
" --> "
<< m1 <<
" + "
<< m2 <<
" GeV\n"
107
<< std::endl;
108
::abort();
109
}
110
111
p = sqrt( M * M - ( m1 + m2 ) * ( m1 + m2 ) ) *
112
sqrt( M * M - ( m1 - m2 ) * ( m1 - m2 ) ) / 2. / M;
113
114
beta = sqrt( 1. -
m_alpha
*
m_alpha
) * sin(
m_phi
);
115
delta = -atan2( beta,
m_alpha
);
116
gamma = sqrt( 1. -
m_alpha
*
m_alpha
- beta * beta );
117
p_to_s = sqrt( ( 1. - gamma ) / ( 1. + gamma ) );
118
119
m_B_to_A
= p_to_s * ( m1 + sqrt( p * p + m1 * m1 ) ) / p *
120
EvtComplex
( cos( delta ), sin( delta ) );
121
}
122
123
void
EvtHypNonLepton::initProbMax
()
124
{
125
double
maxProb, m1, m2, M, p;
126
127
M =
EvtPDL::getMass
(
getParentId
() );
128
m1 =
EvtPDL::getMass
(
getDaug
( 0 ) );
129
m2 =
EvtPDL::getMass
(
getDaug
( 1 ) );
130
131
if
( m1 + m2 >= M ) {
132
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
133
<<
" ERROR: EvtHypNonLepton found impossible decay: "
<< M
134
<<
" --> "
<< m1 <<
" + "
<< m2 <<
" GeV\n"
135
<< std::endl;
136
::abort();
137
}
138
139
p = sqrt( M * M - ( m1 + m2 ) * ( m1 + m2 ) ) *
140
sqrt( M * M - ( m1 - m2 ) * ( m1 - m2 ) ) / 2 / M;
141
maxProb = 16 * M *
142
( sqrt( p * p + m1 * m1 ) + m1 +
143
abs
(
m_B_to_A
) *
abs
(
m_B_to_A
) *
144
( sqrt( p * p + m1 * m1 ) - m1 ) );
145
//maxProb *= G_F*M_pi*M_pi;
146
147
setProbMax
( maxProb );
148
EvtGenReport
(
EVTGEN_INFO
,
"EvtGen"
)
149
<<
" EvtHypNonLepton set up maximum probability to "
<< maxProb
150
<< std::endl;
151
}
152
153
void
EvtHypNonLepton::decay
(
EvtParticle
* parent )
154
{
155
parent->
initializePhaseSpace
(
getNDaug
(),
getDaugs
() );
156
calcAmp
( &
m_amp2
, parent );
157
}
158
159
void
EvtHypNonLepton::calcAmp
(
EvtAmp
* amp,
EvtParticle
* parent )
160
{
161
static
thread_local
decltype
(
m_noTries
) noTries = 0;
162
int
i;
163
EvtComplex
Matrix[2][2];
164
165
//G_F = 1.16637e-5;
166
//M_pi = 0.13957;
167
168
for
( i = 0; i < 4; i++ ) {
169
//std::cout << "--------------------------------------------------" << std::endl;
170
Matrix[i / 2][i % 2] =
EvtLeptonSCurrent
(
171
parent->
sp
( i / 2 ), parent->
getDaug
( 0 )->
spParent
( i % 2 ) );
172
//std::cout << "Matrix = " << Matrix[i/2][i%2] << std::endl;
173
Matrix[i / 2][i % 2] -=
174
m_B_to_A
*
175
EvtLeptonPCurrent
( parent->
sp
( i / 2 ),
176
parent->
getDaug
( 0 )->
spParent
( i % 2 ) );
177
//std::cout << "Matrix = " << Matrix[i/2][i%2] << std::endl;
178
//Matrix[i/2][i%2] *= G_F*M_pi*M_pi;
179
//std::cout << "Matrix = " << Matrix[i/2][i%2] << std::endl;
180
//std::cout << "--------------------------------------------------" << std::endl;
181
amp->
vertex
( i / 2, i % 2, Matrix[i / 2][i % 2] );
182
}
183
184
if
(
m_noTries
> 0 )
185
if
( !( ( ++noTries ) %
m_noTries
) )
186
EvtGenReport
(
EVTGEN_DEBUG
,
"EvtGen"
)
187
<<
" EvtHypNonLepton already finished "
<< noTries
188
<<
" matrix element calculations"
<< std::endl;
189
}
EvtComplex.hh
abs
double abs(const EvtComplex &c)
Definition
EvtComplex.hh:203
EvtLeptonSCurrent
EvtComplex EvtLeptonSCurrent(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
Definition
EvtDiracSpinor.cpp:247
EvtLeptonPCurrent
EvtComplex EvtLeptonPCurrent(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
Definition
EvtDiracSpinor.cpp:259
EvtDiracSpinor.hh
EvtGammaMatrix.hh
EvtHypNonLepton.hh
EvtPDL.hh
EvtParticle.hh
EvtGenReport
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
Definition
EvtReport.cpp:32
EVTGEN_INFO
@ EVTGEN_INFO
Definition
EvtReport.hh:52
EVTGEN_DEBUG
@ EVTGEN_DEBUG
Definition
EvtReport.hh:53
EVTGEN_ERROR
@ EVTGEN_ERROR
Definition
EvtReport.hh:49
EvtTensor4C.hh
EvtVector4C.hh
EvtVector4R.hh
EvtAmp
Definition
EvtAmp.hh:29
EvtAmp::vertex
void vertex(const EvtComplex &)
Definition
EvtAmp.cpp:453
EvtComplex
Definition
EvtComplex.hh:29
EvtConst::pi
static const double pi
Definition
EvtConst.hh:26
EvtDecayAmp::m_amp2
EvtAmp m_amp2
Definition
EvtDecayAmp.hh:73
EvtDecayBase::EvtDecayBase
EvtDecayBase()=default
EvtDecayBase::getNDaug
int getNDaug() const
Definition
EvtDecayBase.hh:64
EvtDecayBase::getNArg
int getNArg() const
Definition
EvtDecayBase.hh:67
EvtDecayBase::getArg
double getArg(unsigned int j)
Definition
EvtDecayBase.cpp:578
EvtDecayBase::setProbMax
void setProbMax(double prbmx)
Definition
EvtDecayBase.cpp:295
EvtDecayBase::getParentId
EvtId getParentId() const
Definition
EvtDecayBase.hh:60
EvtDecayBase::getDaug
EvtId getDaug(int i) const
Definition
EvtDecayBase.hh:66
EvtDecayBase::getDaugs
const EvtId * getDaugs() const
Definition
EvtDecayBase.hh:65
EvtHypNonLepton
Definition
EvtHypNonLepton.hh:30
EvtHypNonLepton::getName
std::string getName() const override
Definition
EvtHypNonLepton.cpp:37
EvtHypNonLepton::initProbMax
void initProbMax() override
Definition
EvtHypNonLepton.cpp:123
EvtHypNonLepton::m_phi
double m_phi
Definition
EvtHypNonLepton.hh:43
EvtHypNonLepton::init
void init() override
Definition
EvtHypNonLepton.cpp:42
EvtHypNonLepton::m_noTries
std::size_t m_noTries
Definition
EvtHypNonLepton.hh:45
EvtHypNonLepton::calcAmp
void calcAmp(EvtAmp *amp, EvtParticle *parent)
Definition
EvtHypNonLepton.cpp:159
EvtHypNonLepton::clone
EvtDecayBase * clone() const override
Definition
EvtHypNonLepton.cpp:32
EvtHypNonLepton::decay
void decay(EvtParticle *p) override
Definition
EvtHypNonLepton.cpp:153
EvtHypNonLepton::m_alpha
double m_alpha
Definition
EvtHypNonLepton.hh:42
EvtHypNonLepton::m_B_to_A
EvtComplex m_B_to_A
Definition
EvtHypNonLepton.hh:44
EvtPDL::getSpinType
static EvtSpinType::spintype getSpinType(EvtId i)
Definition
EvtPDL.cpp:371
EvtPDL::getMass
static double getMass(EvtId i)
Definition
EvtPDL.cpp:311
EvtParticle
Definition
EvtParticle.hh:45
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::getDaug
EvtParticle * getDaug(const int i)
Definition
EvtParticle.hh:173
EvtParticle::sp
virtual EvtDiracSpinor sp(int) const
Definition
EvtParticle.cpp:672
EvtSpinType::getSpin2
static int getSpin2(spintype stype)
Definition
EvtSpinType.cpp:25
Generated by
1.17.0