BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/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
33using std::endl;
34
36
37
39
40 return;
41
42}
43
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
83}
84
85
86
87
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
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
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
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
const double alpha
EvtDiracSpinor boostTo(const EvtDiracSpinor &sp, const EvtVector4R p4)
ostream & report(Severity severity, const char *facility)
void set(const EvtComplex &sp0, const EvtComplex &sp1, const EvtComplex &sp2, const EvtComplex &sp3)
void applyRotateEuler(double alpha, double beta, double gamma)
void setp(double e, double px, double py, double pz)