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
EvtVectorParticle.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/EvtVectorParticle.hh
"
22
23
#include "
EvtGenBase/EvtComplex.hh
"
24
#include "
EvtGenBase/EvtPDL.hh
"
25
#include "
EvtGenBase/EvtReport.hh
"
26
#include "
EvtGenBase/EvtVector4C.hh
"
27
28
#include <iostream>
29
#include <math.h>
30
#include <stdlib.h>
31
32
void
EvtVectorParticle::init
(
EvtId
part_n,
double
e,
double
px,
double
py,
33
double
pz )
34
{
35
m_validP4
=
true
;
36
setp
( e, px, py, pz );
37
setpart_num
( part_n );
38
39
m_eps
[0].set( 0.0, 1.0, 0.0, 0.0 );
40
m_eps
[1].set( 0.0, 0.0, 1.0, 0.0 );
41
m_eps
[2].set( 0.0, 0.0, 0.0, 1.0 );
42
43
setLifetime
();
44
}
45
46
void
EvtVectorParticle::init
(
EvtId
part_n,
const
EvtVector4R
& p4 )
47
{
48
m_validP4
=
true
;
49
setp
( p4 );
50
setpart_num
( part_n );
51
52
m_eps
[0].set( 0.0, 1.0, 0.0, 0.0 );
53
m_eps
[1].set( 0.0, 0.0, 1.0, 0.0 );
54
m_eps
[2].set( 0.0, 0.0, 0.0, 1.0 );
55
setLifetime
();
56
}
57
58
void
EvtVectorParticle::init
(
EvtId
part_n,
const
EvtVector4R
& p4,
59
const
EvtVector4C
& epsin1,
60
const
EvtVector4C
& epsin2,
61
const
EvtVector4C
& epsin3 )
62
{
63
m_validP4
=
true
;
64
setp
( p4 );
65
setpart_num
( part_n );
66
67
m_eps
[0] = epsin1;
68
m_eps
[1] = epsin2;
69
m_eps
[2] = epsin3;
70
71
setLifetime
();
72
}
73
74
EvtSpinDensity
EvtVectorParticle::rotateToHelicityBasis
()
const
75
{
76
static
const
EvtVector4C
eplus( 0.0, -1.0 / sqrt( 2.0 ),
77
EvtComplex
( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
78
static
const
EvtVector4C
ezero( 0.0, 0.0, 0.0, 1.0 );
79
static
const
EvtVector4C
eminus( 0.0, 1.0 / sqrt( 2.0 ),
80
EvtComplex
( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
81
82
static
const
EvtVector4C
eplusC( eplus.
conj
() );
83
static
const
EvtVector4C
ezeroC( ezero.
conj
() );
84
static
const
EvtVector4C
eminusC( eminus.
conj
() );
85
86
EvtSpinDensity
R;
87
R.
setDim
( 3 );
88
89
for
(
int
i = 0; i < 3; i++ ) {
90
R.
set
( 0, i, eplusC *
m_eps
[i] );
91
R.
set
( 1, i, ezeroC *
m_eps
[i] );
92
R.
set
( 2, i, eminusC *
m_eps
[i] );
93
}
94
95
return
R;
96
}
97
98
EvtSpinDensity
EvtVectorParticle::rotateToHelicityBasis
(
double
alpha,
99
double
beta,
100
double
gamma )
const
101
{
102
EvtVector4C
eplus( 0.0, -1.0 / sqrt( 2.0 ),
103
EvtComplex
( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
104
EvtVector4C
ezero( 0.0, 0.0, 0.0, 1.0 );
105
EvtVector4C
eminus( 0.0, 1.0 / sqrt( 2.0 ),
106
EvtComplex
( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
107
108
eplus.
applyRotateEuler
( alpha, beta, gamma );
109
ezero.
applyRotateEuler
( alpha, beta, gamma );
110
eminus.
applyRotateEuler
( alpha, beta, gamma );
111
112
EvtSpinDensity
R;
113
R.
setDim
( 3 );
114
115
for
(
int
i = 0; i < 3; i++ ) {
116
R.
set
( 0, i, eplus.
conj
() *
m_eps
[i] );
117
R.
set
( 1, i, ezero.
conj
() *
m_eps
[i] );
118
R.
set
( 2, i, eminus.
conj
() *
m_eps
[i] );
119
}
120
121
return
R;
122
}
EvtComplex.hh
EvtPDL.hh
EvtReport.hh
EvtVector4C.hh
EvtVectorParticle.hh
EvtComplex
Definition
EvtComplex.hh:29
EvtId
Definition
EvtId.hh:27
EvtParticle::setLifetime
void setLifetime()
Definition
EvtParticle.cpp:100
EvtParticle::m_validP4
bool m_validP4
Definition
EvtParticle.hh:460
EvtParticle::setp
void setp(double e, double px, double py, double pz)
Definition
EvtParticle.hh:442
EvtParticle::setpart_num
void setpart_num(EvtId particle_number)
Definition
EvtParticle.hh:454
EvtSpinDensity
Definition
EvtSpinDensity.hh:28
EvtSpinDensity::setDim
void setDim(int n)
Definition
EvtSpinDensity.cpp:79
EvtSpinDensity::set
void set(int i, int j, const EvtComplex &rhoij)
Definition
EvtSpinDensity.cpp:106
EvtVector4C
Definition
EvtVector4C.hh:30
EvtVector4C::applyRotateEuler
void applyRotateEuler(double alpha, double beta, double gamma)
Definition
EvtVector4C.cpp:128
EvtVector4C::conj
EvtVector4C conj() const
Definition
EvtVector4C.hh:204
EvtVector4R
Definition
EvtVector4R.hh:29
EvtVectorParticle::rotateToHelicityBasis
EvtSpinDensity rotateToHelicityBasis() const override
Definition
EvtVectorParticle.cpp:74
EvtVectorParticle::m_eps
std::array< EvtVector4C, 3 > m_eps
Definition
EvtVectorParticle.hh:58
EvtVectorParticle::init
void init(EvtId part_n, double e, double px, double py, double pz)
Definition
EvtVectorParticle.cpp:32
Generated by
1.17.0