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
33using std::endl;
34
36
38
39void 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
76}
77
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
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
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
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}
EvtDiracSpinor boostTo(const EvtDiracSpinor &sp, const EvtVector4R p4)
double alpha
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:34
@ ERROR
Definition EvtReport.hh:49
void init(EvtId part_n, const EvtVector4R &p4)
EvtSpinDensity rotateToHelicityBasis() const
virtual ~EvtDiracParticle()
void set(const EvtComplex &sp0, const EvtComplex &sp1, const EvtComplex &sp2, const EvtComplex &sp3)
void applyRotateEuler(double alpha, double beta, double gamma)
Definition EvtId.hh:27
int getId() const
Definition EvtId.hh:40
static int getStdHep(EvtId id)
Definition EvtPDL.hh:61
EvtId getId() const
void setLifetime()
const EvtVector4R & getP4() const
void setp(double e, double px, double py, double pz)
double mass() const
void setpart_num(EvtId particle_number)