BOSS
8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDiracParticle.cc
Go to the documentation of this file.
1
//--------------------------------------------------------------------------
2
//
3
// Environment:
4
// This software is part of the EvtGen package developed jointly
5
// for the BaBar and CLEO collaborations. If you use all or part
6
// of it, please give an appropriate acknowledgement.
7
//
8
// Copyright Information: See EvtGen/COPYRIGHT
9
// Copyright (C) 1998 Caltech, UCSB
10
//
11
// Module: EvtDiracParticle.cc
12
//
13
// Description: Class to describe spin 1/2 particles.
14
//
15
// Modification history:
16
//
17
// DJL/RYD September 25, 1996 Module created
18
//
19
//------------------------------------------------------------------------
20
//
21
#include "
EvtDiracParticle.hh
"
22
#include "
EvtComplex.hh
"
23
#include "
EvtGammaMatrix.hh
"
24
#include "
EvtPDL.hh
"
25
#include "
EvtPatches.hh
"
26
#include "
EvtReport.hh
"
27
#include "
EvtSpinDensity.hh
"
28
#include "
EvtVector4R.hh
"
29
#include <iostream>
30
#include <math.h>
31
#include <stdlib.h>
32
33
using
std::endl;
34
35
EvtDiracParticle::~EvtDiracParticle
() {}
36
37
EvtDiracParticle::EvtDiracParticle
() {
return
; }
38
39
void
EvtDiracParticle::init
(
EvtId
part_n,
const
EvtVector4R
& p4 ) {
40
41
_validP4
=
true
;
42
setp
( p4 );
43
setpart_num
( part_n );
44
45
if
(
EvtPDL::getStdHep
( part_n ) == 0 )
46
{
47
report
(
ERROR
,
"EvtGen"
) <<
"Error in EvtDiracParticle::init, part_n="
<< part_n.
getId
()
48
<< endl;
49
::abort();
50
}
51
52
if
(
EvtPDL::getStdHep
( part_n ) > 0 )
53
{
54
55
_spinorRest[0].set(
EvtComplex
( sqrt( 2.0 *
mass
() ), 0.0 ),
EvtComplex
( 0.0, 0.0 ),
56
EvtComplex
( 0.0, 0.0 ),
EvtComplex
( 0.0, 0.0 ) );
57
_spinorRest[1].set(
EvtComplex
( 0.0, 0.0 ),
EvtComplex
( sqrt( 2.0 *
mass
() ), 0.0 ),
58
EvtComplex
( 0.0, 0.0 ),
EvtComplex
( 0.0, 0.0 ) );
59
60
_spinorParent[0] =
boostTo
( _spinorRest[0], p4 );
61
_spinorParent[1] =
boostTo
( _spinorRest[1], p4 );
62
}
63
else
64
{
65
66
_spinorRest[0].set(
EvtComplex
( 0.0, 0.0 ),
EvtComplex
( 0.0, 0.0 ),
67
EvtComplex
( sqrt( 2.0 *
mass
() ), 0.0 ),
EvtComplex
( 0.0, 0.0 ) );
68
_spinorRest[1].set(
EvtComplex
( 0.0, 0.0 ),
EvtComplex
( 0.0, 0.0 ),
EvtComplex
( 0.0, 0.0 ),
69
EvtComplex
( sqrt( 2.0 *
mass
() ), 0.0 ) );
70
71
_spinorParent[0] =
boostTo
( _spinorRest[0], p4 );
72
_spinorParent[1] =
boostTo
( _spinorRest[1], p4 );
73
}
74
75
setLifetime
();
76
}
77
78
EvtSpinDensity
EvtDiracParticle::rotateToHelicityBasis
()
const
{
79
80
EvtDiracSpinor
spplus;
81
EvtDiracSpinor
spminus;
82
83
double
sqmt2 = sqrt( 2. * (
getP4
().
mass
() ) );
84
85
if
(
EvtPDL::getStdHep
(
getId
() ) > 0 )
86
{
87
spplus.
set
( 1.0, 0.0, 0.0, 0.0 );
88
spminus.
set
( 0.0, 1.0, 0.0, 0.0 );
89
}
90
else
91
{
92
spplus.
set
( 0.0, 0.0, 1.0, 0.0 );
93
spminus.
set
( 0.0, 0.0, 0.0, 1.0 );
94
}
95
96
EvtSpinDensity
R;
97
R.SetDim( 2 );
98
99
for
(
int
i = 0; i < 2; i++ )
100
{
101
R.Set( 0, i, ( spplus * _spinorRest[i] ) / sqmt2 );
102
R.Set( 1, i, ( spminus * _spinorRest[i] ) / sqmt2 );
103
}
104
105
return
R;
106
}
107
108
EvtSpinDensity
EvtDiracParticle::rotateToHelicityBasis
(
double
alpha
,
double
beta,
109
double
gamma )
const
{
110
111
EvtDiracSpinor
spplus;
112
EvtDiracSpinor
spminus;
113
114
double
sqmt2 = sqrt( 2. * (
getP4
().
mass
() ) );
115
116
if
(
EvtPDL::getStdHep
(
getId
() ) > 0 )
117
{
118
spplus.
set
( 1.0, 0.0, 0.0, 0.0 );
119
spminus.
set
( 0.0, 1.0, 0.0, 0.0 );
120
}
121
else
122
{
123
spplus.
set
( 0.0, 0.0, 1.0, 0.0 );
124
spminus.
set
( 0.0, 0.0, 0.0, 1.0 );
125
}
126
127
spplus.
applyRotateEuler
(
alpha
, beta, gamma );
128
spminus.
applyRotateEuler
(
alpha
, beta, gamma );
129
130
EvtSpinDensity
R;
131
R.SetDim( 2 );
132
133
for
(
int
i = 0; i < 2; i++ )
134
{
135
R.Set( 0, i, ( spplus * _spinorRest[i] ) / sqmt2 );
136
R.Set( 1, i, ( spminus * _spinorRest[i] ) / sqmt2 );
137
}
138
139
return
R;
140
}
EvtComplex.hh
EvtDiracParticle.hh
boostTo
EvtDiracSpinor boostTo(const EvtDiracSpinor &sp, const EvtVector4R p4)
Definition
EvtDiracSpinor.cc:67
EvtGammaMatrix.hh
EvtPDL.hh
EvtPatches.hh
alpha
double alpha
Definition
EvtPhokharaDef.hh:17
report
ostream & report(Severity severity, const char *facility)
Definition
EvtReport.cc:34
EvtReport.hh
ERROR
@ ERROR
Definition
EvtReport.hh:49
EvtSpinDensity.hh
EvtVector4R.hh
EvtComplex
Definition
EvtComplex.hh:28
EvtDiracParticle::init
void init(EvtId part_n, const EvtVector4R &p4)
Definition
EvtDiracParticle.cc:39
EvtDiracParticle::rotateToHelicityBasis
EvtSpinDensity rotateToHelicityBasis() const
Definition
EvtDiracParticle.cc:78
EvtDiracParticle::EvtDiracParticle
EvtDiracParticle()
Definition
EvtDiracParticle.cc:37
EvtDiracParticle::~EvtDiracParticle
virtual ~EvtDiracParticle()
Definition
EvtDiracParticle.cc:35
EvtDiracSpinor
Definition
EvtDiracSpinor.hh:52
EvtDiracSpinor::set
void set(const EvtComplex &sp0, const EvtComplex &sp1, const EvtComplex &sp2, const EvtComplex &sp3)
Definition
EvtDiracSpinor.cc:39
EvtDiracSpinor::applyRotateEuler
void applyRotateEuler(double alpha, double beta, double gamma)
Definition
EvtDiracSpinor.cc:124
EvtId
Definition
EvtId.hh:27
EvtId::getId
int getId() const
Definition
EvtId.hh:40
EvtPDL::getStdHep
static int getStdHep(EvtId id)
Definition
EvtPDL.hh:61
EvtParticle::_validP4
bool _validP4
Definition
EvtParticle.hh:398
EvtParticle::getId
EvtId getId() const
Definition
EvtParticle.cc:100
EvtParticle::setLifetime
void setLifetime()
Definition
EvtParticle.cc:86
EvtParticle::getP4
const EvtVector4R & getP4() const
Definition
EvtParticle.cc:108
EvtParticle::setp
void setp(double e, double px, double py, double pz)
Definition
EvtParticle.hh:392
EvtParticle::mass
double mass() const
Definition
EvtParticle.cc:114
EvtParticle::setpart_num
void setpart_num(EvtId particle_number)
Definition
EvtParticle.hh:394
EvtSpinDensity
Definition
EvtSpinDensity.hh:26
EvtVector4R
Definition
EvtVector4R.hh:29
8.0.0
BOSS_Gen
BesEvtGen
src
EvtGen
EvtGenBase
EvtDiracParticle.cc
Generated by
1.16.1