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