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
EvtGenBase
EvtKine.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 "
EvtGenBase/EvtKine.hh
"
22
23
#include "
EvtGenBase/EvtConst.hh
"
24
#include "
EvtGenBase/EvtReport.hh
"
25
#include "
EvtGenBase/EvtTensor4C.hh
"
26
#include "
EvtGenBase/EvtVector4C.hh
"
27
#include "
EvtGenBase/EvtVector4R.hh
"
28
#include "
EvtGenBase/EvtdFunction.hh
"
29
30
#include <cmath>
31
32
double
EvtDecayAngle
(
const
EvtVector4R
& p,
const
EvtVector4R
& q,
33
const
EvtVector4R
& d )
34
{
35
double
pd = p * d;
36
double
pq = p * q;
37
double
qd = q * d;
38
double
mp2 = p.
mass2
();
39
double
mq2 = q.
mass2
();
40
double
md2 = d.
mass2
();
41
42
double
cost = ( pd * mq2 - pq * qd ) /
43
std::sqrt( ( pq * pq - mq2 * mp2 ) * ( qd * qd - mq2 * md2 ) );
44
45
return
cost;
46
}
47
48
double
EvtDecayAngleChi
(
const
EvtVector4R
& p4_p,
const
EvtVector4R
& p4_d1,
49
const
EvtVector4R
& p4_d2,
const
EvtVector4R
& p4_h1,
50
const
EvtVector4R
& p4_h2 )
51
{
52
EvtVector4R
p4_d1p, p4_h1p, p4_h2p, p4_d2p;
53
54
// boost all vectors parent restframe
55
// This does not boost particle to parent rest frame !!!
56
// It goes from parents rest frame to frame where parent has given momentum.
57
p4_d1p =
boostTo
( p4_d1, p4_p,
true
);
58
p4_d2p =
boostTo
( p4_d2, p4_p,
true
);
59
p4_h1p =
boostTo
( p4_h1, p4_p,
true
);
60
p4_h2p =
boostTo
( p4_h2, p4_p,
true
);
61
62
EvtVector4R
d1_perp, d1_prime, h1_perp;
63
EvtVector4R
D;
64
65
D = p4_d1p + p4_d2p;
66
67
d1_perp = p4_d1p - ( D.
dot
( p4_d1p ) / D.
dot
( D ) ) * D;
68
h1_perp = p4_h1p - ( D.
dot
( p4_h1p ) / D.
dot
( D ) ) * D;
69
70
// orthogonal to both D and d1_perp
71
72
d1_prime = D.
cross
( d1_perp );
73
74
d1_perp = d1_perp / d1_perp.
d3mag
();
75
d1_prime = d1_prime / d1_prime.
d3mag
();
76
77
double
x, y;
78
79
x = d1_perp.
dot
( h1_perp );
80
y = d1_prime.
dot
( h1_perp );
81
82
double
chi = std::atan2( y, x );
83
84
if
( chi < 0.0 )
85
chi +=
EvtConst::twoPi
;
86
87
return
chi;
88
}
89
90
double
EvtDecayPlaneNormalAngle
(
const
EvtVector4R
& p,
const
EvtVector4R
& q,
91
const
EvtVector4R
& d1,
const
EvtVector4R
& d2 )
92
{
93
EvtVector4C
lc =
dual
(
EvtGenFunctions::directProd
( d1, d2 ) ).
cont2
( q );
94
95
EvtVector4R
l(
real
( lc.
get
( 0 ) ),
real
( lc.
get
( 1 ) ),
96
real
( lc.
get
( 2 ) ),
real
( lc.
get
( 3 ) ) );
97
98
double
pq = p * q;
99
100
return
q.
mass
() * ( p * l ) /
101
std::sqrt( -( pq * pq - p.
mass2
() * q.
mass2
() ) * l.
mass2
() );
102
}
103
104
// Calculate phi using the given 4 vectors (all in the same frame)
105
double
EvtDecayAnglePhi
(
const
EvtVector4R
& z,
const
EvtVector4R
& p,
106
const
EvtVector4R
& q,
const
EvtVector4R
& d )
107
{
108
double
eq = ( p * q ) / p.
mass
();
109
double
ed = ( p * d ) / p.
mass
();
110
double
mq = q.
mass
();
111
double
q2 = p.
mag2r3
( q );
112
double
qd = p.
dotr3
( q, d );
113
double
zq = p.
dotr3
( z, q );
114
double
zd = p.
dotr3
( z, d );
115
double
alpha = ( eq - mq ) / ( q2 * mq ) * qd - ed / mq;
116
117
double
y = p.
scalartripler3
( z, q, d ) + alpha * p.
scalartripler3
( z, q, q );
118
double
x = ( zq * ( qd + alpha * q2 ) - q2 * ( zd + alpha * zq ) ) /
119
std::sqrt( q2 );
120
121
double
phi = std::atan2( y, x );
122
123
return
phi < 0 ? ( phi +
EvtConst::twoPi
) : phi;
124
}
125
126
EvtComplex
wignerD
(
int
j,
int
m1,
int
m2,
double
phi,
double
theta,
double
gamma )
127
{
128
EvtComplex
gp( 0.0, -phi * m1 );
129
EvtComplex
gm( 0.0, -gamma * m2 );
130
131
return
exp
( gp ) *
EvtdFunction::d
( j, m1, m2, theta ) *
exp
( gm );
132
}
133
134
double
twoBodyMomentum
(
const
double
M,
const
double
m1,
const
double
m2 )
135
{
136
const
double
MSq = M * M;
137
const
double
mSum = m1 + m2;
138
const
double
mDiff = m1 - m2;
139
double
result = ( MSq - mDiff * mDiff ) * ( MSq - mSum * mSum );
140
if
( result < 0 ) {
141
return
0;
142
}
143
return
std::sqrt( result ) / ( 2 * M );
144
}
real
double real(const EvtComplex &c)
Definition
EvtComplex.hh:232
exp
EvtComplex exp(const EvtComplex &c)
Definition
EvtComplex.hh:242
EvtConst.hh
EvtDecayPlaneNormalAngle
double EvtDecayPlaneNormalAngle(const EvtVector4R &p, const EvtVector4R &q, const EvtVector4R &d1, const EvtVector4R &d2)
Definition
EvtKine.cpp:90
EvtDecayAnglePhi
double EvtDecayAnglePhi(const EvtVector4R &z, const EvtVector4R &p, const EvtVector4R &q, const EvtVector4R &d)
Definition
EvtKine.cpp:105
EvtDecayAngle
double EvtDecayAngle(const EvtVector4R &p, const EvtVector4R &q, const EvtVector4R &d)
Definition
EvtKine.cpp:32
wignerD
EvtComplex wignerD(int j, int m1, int m2, double phi, double theta, double gamma)
Definition
EvtKine.cpp:126
EvtDecayAngleChi
double EvtDecayAngleChi(const EvtVector4R &p4_p, const EvtVector4R &p4_d1, const EvtVector4R &p4_d2, const EvtVector4R &p4_h1, const EvtVector4R &p4_h2)
Definition
EvtKine.cpp:48
twoBodyMomentum
double twoBodyMomentum(const double M, const double m1, const double m2)
Definition
EvtKine.cpp:134
EvtKine.hh
boostTo
EvtRaritaSchwinger boostTo(const EvtRaritaSchwinger &rs, const EvtVector4R p4)
Definition
EvtRaritaSchwinger.cpp:34
EvtReport.hh
dual
EvtTensor4C dual(const EvtTensor4C &t2)
Definition
EvtTensor4C.cpp:363
EvtTensor4C.hh
EvtVector4C.hh
EvtVector4R.hh
EvtdFunction.hh
EvtComplex
Definition
EvtComplex.hh:29
EvtConst::twoPi
static const double twoPi
Definition
EvtConst.hh:27
EvtTensor4C::cont2
EvtVector4C cont2(const EvtVector4C &v4) const
Definition
EvtTensor4C.cpp:460
EvtVector4C
Definition
EvtVector4C.hh:30
EvtVector4C::get
const EvtComplex & get(int) const
Definition
EvtVector4C.hh:125
EvtVector4R
Definition
EvtVector4R.hh:29
EvtVector4R::dot
double dot(const EvtVector4R &v2) const
Definition
EvtVector4R.cpp:205
EvtVector4R::mass
double mass() const
Definition
EvtVector4R.cpp:48
EvtVector4R::d3mag
double d3mag() const
Definition
EvtVector4R.cpp:192
EvtVector4R::dotr3
double dotr3(const EvtVector4R &p1, const EvtVector4R &p2) const
Definition
EvtVector4R.cpp:235
EvtVector4R::scalartripler3
double scalartripler3(const EvtVector4R &p1, const EvtVector4R &p2, const EvtVector4R &p3) const
Definition
EvtVector4R.cpp:223
EvtVector4R::mag2r3
double mag2r3(const EvtVector4R &p1) const
Definition
EvtVector4R.cpp:242
EvtVector4R::cross
EvtVector4R cross(const EvtVector4R &v2) const
Definition
EvtVector4R.cpp:177
EvtVector4R::mass2
double mass2() const
Definition
EvtVector4R.hh:100
EvtdFunction::d
static double d(int j, int m1, int m2, double theta)
Definition
EvtdFunction.cpp:30
EvtGenFunctions::directProd
EvtTensor3C directProd(const EvtVector3C &c1, const EvtVector3C &c2)
Definition
EvtTensor3C.cpp:153
Generated by
1.17.0