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
EvtDiracParticle.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/EvtDiracParticle.hh
"
22
23
#include "
EvtGenBase/EvtComplex.hh
"
24
#include "
EvtGenBase/EvtGammaMatrix.hh
"
25
#include "
EvtGenBase/EvtPDL.hh
"
26
#include "
EvtGenBase/EvtReport.hh
"
27
#include "
EvtGenBase/EvtSpinDensity.hh
"
28
#include "
EvtGenBase/EvtVector4R.hh
"
29
30
#include <iostream>
31
#include <math.h>
32
#include <stdlib.h>
33
using
std::endl;
34
35
void
EvtDiracParticle::init
(
EvtId
part_n,
const
EvtVector4R
& p4 )
36
{
37
m_validP4
=
true
;
38
setp
( p4 );
39
setpart_num
( part_n );
40
41
if
(
EvtPDL::getStdHep
( part_n ) == 0 ) {
42
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
43
<<
"Error in EvtDiracParticle::init, part_n="
<< part_n.
getId
()
44
<< endl;
45
::abort();
46
}
47
48
if
(
EvtPDL::getStdHep
( part_n ) > 0 ) {
49
m_spinorRest
[0].set(
EvtComplex
( sqrt( 2.0 *
mass
() ), 0.0 ),
50
EvtComplex
( 0.0, 0.0 ),
EvtComplex
( 0.0, 0.0 ),
51
EvtComplex
( 0.0, 0.0 ) );
52
m_spinorRest
[1].set(
EvtComplex
( 0.0, 0.0 ),
53
EvtComplex
( sqrt( 2.0 *
mass
() ), 0.0 ),
54
EvtComplex
( 0.0, 0.0 ),
EvtComplex
( 0.0, 0.0 ) );
55
56
m_spinorParent
[0] =
boostTo
(
m_spinorRest
[0], p4 );
57
m_spinorParent
[1] =
boostTo
(
m_spinorRest
[1], p4 );
58
59
}
else
{
60
m_spinorRest
[0].set(
EvtComplex
( 0.0, 0.0 ),
EvtComplex
( 0.0, 0.0 ),
61
EvtComplex
( sqrt( 2.0 *
mass
() ), 0.0 ),
62
EvtComplex
( 0.0, 0.0 ) );
63
m_spinorRest
[1].set(
EvtComplex
( 0.0, 0.0 ),
EvtComplex
( 0.0, 0.0 ),
64
EvtComplex
( 0.0, 0.0 ),
65
EvtComplex
( sqrt( 2.0 *
mass
() ), 0.0 ) );
66
67
m_spinorParent
[0] =
boostTo
(
m_spinorRest
[0], p4 );
68
m_spinorParent
[1] =
boostTo
(
m_spinorRest
[1], p4 );
69
}
70
71
setLifetime
();
72
}
73
74
void
EvtDiracParticle::init
(
EvtId
part_n,
const
EvtVector4R
& p4,
75
const
EvtDiracSpinor
& prod1,
76
const
EvtDiracSpinor
& prod2,
77
const
EvtDiracSpinor
& rest1,
78
const
EvtDiracSpinor
& rest2 )
79
{
80
m_validP4
=
true
;
81
setp
( p4 );
82
setpart_num
( part_n );
83
84
if
(
EvtPDL::getStdHep
( part_n ) == 0 ) {
85
EvtGenReport
(
EVTGEN_ERROR
,
"EvtGen"
)
86
<<
"Error in EvtDiracParticle::init, part_n="
<< part_n.
getId
()
87
<< std::endl;
88
::abort();
89
}
90
m_spinorRest
[0] = rest1;
91
m_spinorRest
[1] = rest2;
92
m_spinorParent
[0] = prod1;
93
m_spinorParent
[1] = prod2;
94
95
setLifetime
();
96
}
97
98
EvtSpinDensity
EvtDiracParticle::rotateToHelicityBasis
()
const
99
{
100
EvtDiracSpinor
spplus;
101
EvtDiracSpinor
spminus;
102
103
double
sqmt2 = sqrt( 2. * (
getP4
().
mass
() ) );
104
105
if
(
EvtPDL::getStdHep
(
getId
() ) > 0 ) {
106
spplus.
set
( 1.0, 0.0, 0.0, 0.0 );
107
spminus.
set
( 0.0, 1.0, 0.0, 0.0 );
108
}
else
{
109
spplus.
set
( 0.0, 0.0, 1.0, 0.0 );
110
spminus.
set
( 0.0, 0.0, 0.0, 1.0 );
111
}
112
113
EvtSpinDensity
R;
114
R.
setDim
( 2 );
115
116
for
(
int
i = 0; i < 2; i++ ) {
117
R.
set
( 0, i, ( spplus *
m_spinorRest
[i] ) / sqmt2 );
118
R.
set
( 1, i, ( spminus *
m_spinorRest
[i] ) / sqmt2 );
119
}
120
121
return
R;
122
}
123
124
EvtSpinDensity
EvtDiracParticle::rotateToHelicityBasis
(
double
alpha,
double
beta,
125
double
gamma )
const
126
{
127
EvtDiracSpinor
spplus;
128
EvtDiracSpinor
spminus;
129
130
double
sqmt2 = sqrt( 2. * (
getP4
().
mass
() ) );
131
132
if
(
EvtPDL::getStdHep
(
getId
() ) > 0 ) {
133
spplus.
set
( 1.0, 0.0, 0.0, 0.0 );
134
spminus.
set
( 0.0, 1.0, 0.0, 0.0 );
135
}
else
{
136
spplus.
set
( 0.0, 0.0, 1.0, 0.0 );
137
spminus.
set
( 0.0, 0.0, 0.0, 1.0 );
138
}
139
140
spplus.
applyRotateEuler
( alpha, beta, gamma );
141
spminus.
applyRotateEuler
( alpha, beta, gamma );
142
143
EvtSpinDensity
R;
144
R.
setDim
( 2 );
145
146
for
(
int
i = 0; i < 2; i++ ) {
147
R.
set
( 0, i, ( spplus *
m_spinorRest
[i] ) / sqmt2 );
148
R.
set
( 1, i, ( spminus *
m_spinorRest
[i] ) / sqmt2 );
149
}
150
151
return
R;
152
}
EvtComplex.hh
EvtDiracParticle.hh
EvtGammaMatrix.hh
EvtPDL.hh
boostTo
EvtRaritaSchwinger boostTo(const EvtRaritaSchwinger &rs, const EvtVector4R p4)
Definition
EvtRaritaSchwinger.cpp:34
EvtReport.hh
EvtGenReport
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=nullptr)
Definition
EvtReport.cpp:32
EVTGEN_ERROR
@ EVTGEN_ERROR
Definition
EvtReport.hh:49
EvtSpinDensity.hh
EvtVector4R.hh
EvtComplex
Definition
EvtComplex.hh:29
EvtDiracParticle::rotateToHelicityBasis
EvtSpinDensity rotateToHelicityBasis() const override
Definition
EvtDiracParticle.cpp:98
EvtDiracParticle::init
void init(EvtId part_n, const EvtVector4R &p4) override
Definition
EvtDiracParticle.cpp:35
EvtDiracParticle::m_spinorParent
EvtDiracSpinor m_spinorParent[2]
Definition
EvtDiracParticle.hh:48
EvtDiracParticle::m_spinorRest
EvtDiracSpinor m_spinorRest[2]
Definition
EvtDiracParticle.hh:47
EvtDiracSpinor
Definition
EvtDiracSpinor.hh:32
EvtDiracSpinor::set
void set(const EvtComplex &sp0, const EvtComplex &sp1, const EvtComplex &sp2, const EvtComplex &sp3)
Definition
EvtDiracSpinor.cpp:39
EvtDiracSpinor::applyRotateEuler
void applyRotateEuler(double alpha, double beta, double gamma)
Definition
EvtDiracSpinor.cpp:139
EvtId
Definition
EvtId.hh:27
EvtId::getId
int getId() const
Definition
EvtId.hh:41
EvtPDL::getStdHep
static int getStdHep(EvtId id)
Definition
EvtPDL.cpp:356
EvtParticle::getId
EvtId getId() const
Definition
EvtParticle.cpp:124
EvtParticle::setLifetime
void setLifetime()
Definition
EvtParticle.cpp:100
EvtParticle::getP4
const EvtVector4R & getP4() const
Definition
EvtParticle.cpp:144
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::mass
double mass() const
Definition
EvtParticle.cpp:159
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
EvtVector4R
Definition
EvtVector4R.hh:29
Generated by
1.17.0