BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDiracSpinor Class Reference

#include <EvtDiracSpinor.hh>

Public Member Functions

 EvtDiracSpinor ()
 EvtDiracSpinor (const EvtComplex &sp0, const EvtComplex &sp1, const EvtComplex &sp2, const EvtComplex &sp3)
virtual ~EvtDiracSpinor ()
 EvtDiracSpinor (const EvtDiracSpinor &dspinor)
EvtDiracSpinoroperator= (const EvtDiracSpinor &dspinor)
EvtDiracSpinoroperator+= (const EvtDiracSpinor &u2)
EvtDiracSpinoroperator-= (const EvtDiracSpinor &u2)
void set (const EvtComplex &sp0, const EvtComplex &sp1, const EvtComplex &sp2, const EvtComplex &sp3)
void set_spinor (int i, const EvtComplex &sp)
const EvtComplexget_spinor (int i) const
EvtDiracSpinor conj () const
void applyRotateEuler (double alpha, double beta, double gamma)
void applyBoostTo (const EvtVector4R &p4)
void applyBoostTo (const EvtVector3R &boost)
EvtDiracSpinor adjoint () const

Friends

EvtDiracSpinor rotateEuler (const EvtDiracSpinor &sp, double alpha, double beta, double gamma)
EvtDiracSpinor boostTo (const EvtDiracSpinor &sp, const EvtVector4R p4)
EvtDiracSpinor boostTo (const EvtDiracSpinor &sp, const EvtVector3R boost)
EvtVector4C EvtLeptonVACurrent (const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtVector4C EvtLeptonVCurrent (const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtVector4C EvtLeptonACurrent (const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtComplex EvtLeptonSCurrent (const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtComplex EvtLeptonPCurrent (const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtTensor4C EvtLeptonTCurrent (const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtTensor4C EvtLeptonTg5Current (const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtDiracSpinor operator+ (const EvtDiracSpinor &u1, const EvtDiracSpinor &u2)
EvtDiracSpinor operator- (const EvtDiracSpinor &u1, const EvtDiracSpinor &u2)
EvtDiracSpinor operator* (const EvtComplex &c, const EvtDiracSpinor &d)
std::ostream & operator<< (std::ostream &s, const EvtDiracSpinor &c)

Detailed Description

Definition at line 52 of file EvtDiracSpinor.hh.

Constructor & Destructor Documentation

◆ EvtDiracSpinor() [1/3]

EvtDiracSpinor::EvtDiracSpinor ( )
inline

Definition at line 96 of file EvtDiracSpinor.hh.

96 {
97
98 spinor[0] = EvtComplex();
99 spinor[1] = EvtComplex();
100 spinor[2] = EvtComplex();
101 spinor[3] = EvtComplex();
102}

Referenced by adjoint(), boostTo, boostTo, conj(), EvtDiracSpinor(), EvtLeptonACurrent, EvtLeptonPCurrent, EvtLeptonSCurrent, EvtLeptonTCurrent, EvtLeptonTg5Current, EvtLeptonVACurrent, EvtLeptonVCurrent, operator*, operator+, operator+=(), operator-, operator-=(), operator<<, operator=(), and rotateEuler.

◆ EvtDiracSpinor() [2/3]

EvtDiracSpinor::EvtDiracSpinor ( const EvtComplex & sp0,
const EvtComplex & sp1,
const EvtComplex & sp2,
const EvtComplex & sp3 )

Definition at line 34 of file EvtDiracSpinor.cc.

35 {
36 set( sp0, sp1, sp2, sp3 );
37}
void set(const EvtComplex &sp0, const EvtComplex &sp1, const EvtComplex &sp2, const EvtComplex &sp3)

◆ ~EvtDiracSpinor()

EvtDiracSpinor::~EvtDiracSpinor ( )
virtual

Definition at line 32 of file EvtDiracSpinor.cc.

32{}

◆ EvtDiracSpinor() [3/3]

EvtDiracSpinor::EvtDiracSpinor ( const EvtDiracSpinor & dspinor)
inline

Definition at line 104 of file EvtDiracSpinor.hh.

104 {
105
106 spinor[0] = dspinor.spinor[0];
107 spinor[1] = dspinor.spinor[1];
108 spinor[2] = dspinor.spinor[2];
109 spinor[3] = dspinor.spinor[3];
110}

Member Function Documentation

◆ adjoint()

EvtDiracSpinor EvtDiracSpinor::adjoint ( ) const

Definition at line 363 of file EvtDiracSpinor.cc.

363 {
364 EvtDiracSpinor d = this->conj(); // first conjugate, then multiply with gamma0
365 EvtGammaMatrix g0 = EvtGammaMatrix::g0();
366 EvtDiracSpinor result; // automatically initialized to 0
367
368 for ( int i = 0; i < 4; ++i )
369 for ( int j = 0; j < 4; ++j ) result.spinor[i] += d.spinor[j] * g0.gamma[i][j];
370
371 return result;
372}
EvtDiracSpinor conj() const
static const EvtGammaMatrix & g0()

Referenced by EvtLambdaP_BarGamma::decay().

◆ applyBoostTo() [1/2]

void EvtDiracSpinor::applyBoostTo ( const EvtVector3R & boost)

Definition at line 92 of file EvtDiracSpinor.cc.

92 {
93
94 double bx, by, bz, gamma, b2, f1, f2;
95 EvtComplex spinorp[4];
96
97 bx = boost.get( 0 );
98 by = boost.get( 1 );
99 bz = boost.get( 2 );
100 b2 = bx * bx + by * by + bz * bz;
101
102 if ( b2 == 0.0 ) { return; }
103
104 assert( b2 < 1.0 );
105
106 gamma = 1.0 / sqrt( 1 - b2 );
107
108 f1 = sqrt( ( gamma + 1.0 ) / 2.0 );
109 f2 = f1 * gamma / ( gamma + 1.0 );
110
111 spinorp[0] = f1 * spinor[0] + f2 * bz * spinor[2] + f2 * EvtComplex( bx, -by ) * spinor[3];
112 spinorp[1] = f1 * spinor[1] + f2 * EvtComplex( bx, by ) * spinor[2] - f2 * bz * spinor[3];
113 spinorp[2] = f2 * bz * spinor[0] + f2 * EvtComplex( bx, -by ) * spinor[1] + f1 * spinor[2];
114 spinorp[3] = f2 * EvtComplex( bx, by ) * spinor[0] - f2 * bz * spinor[1] + f1 * spinor[3];
115
116 spinor[0] = spinorp[0];
117 spinor[1] = spinorp[1];
118 spinor[2] = spinorp[2];
119 spinor[3] = spinorp[3];
120
121 return;
122}
TFile * f1
double get(int i) const

◆ applyBoostTo() [2/2]

void EvtDiracSpinor::applyBoostTo ( const EvtVector4R & p4)

Definition at line 81 of file EvtDiracSpinor.cc.

81 {
82
83 double e = p4.get( 0 );
84
85 EvtVector3R boost( p4.get( 1 ) / e, p4.get( 2 ) / e, p4.get( 3 ) / e );
86
87 applyBoostTo( boost );
88
89 return;
90}
void applyBoostTo(const EvtVector4R &p4)
double get(int i) const

Referenced by applyBoostTo(), EvtRaritaSchwinger::applyBoostTo(), boostTo, and boostTo.

◆ applyRotateEuler()

void EvtDiracSpinor::applyRotateEuler ( double alpha,
double beta,
double gamma )

Definition at line 124 of file EvtDiracSpinor.cc.

124 {
125
126 EvtComplex retVal[4];
127
128 double cb2 = cos( 0.5 * beta );
129 double sb2 = sin( 0.5 * beta );
130 double capg2 = cos( 0.5 * ( alpha + gamma ) );
131 double camg2 = cos( 0.5 * ( alpha - gamma ) );
132 double sapg2 = sin( 0.5 * ( alpha + gamma ) );
133 double samg2 = sin( 0.5 * ( alpha - gamma ) );
134
135 EvtComplex m11( cb2 * capg2, -cb2 * sapg2 );
136 EvtComplex m12( -sb2 * camg2, sb2 * samg2 );
137 EvtComplex m21( sb2 * camg2, sb2 * samg2 );
138 EvtComplex m22( cb2 * capg2, cb2 * sapg2 );
139
140 retVal[0] = m11 * spinor[0] + m12 * spinor[1];
141 retVal[1] = m21 * spinor[0] + m22 * spinor[1];
142 retVal[2] = m11 * spinor[2] + m12 * spinor[3];
143 retVal[3] = m21 * spinor[2] + m22 * spinor[3];
144
145 spinor[0] = retVal[0];
146 spinor[1] = retVal[1];
147 spinor[2] = retVal[2];
148 spinor[3] = retVal[3];
149
150 return;
151}
double alpha

Referenced by EvtDiracParticle::rotateToHelicityBasis().

◆ conj()

EvtDiracSpinor EvtDiracSpinor::conj ( ) const

Definition at line 153 of file EvtDiracSpinor.cc.

153 {
154
156
157 for ( int i = 0; i < 4; i++ ) sp.set_spinor( i, ::conj( spinor[i] ) );
158
159 return sp;
160}
void set_spinor(int i, const EvtComplex &sp)

Referenced by adjoint(), and conj().

◆ get_spinor()

const EvtComplex & EvtDiracSpinor::get_spinor ( int i) const

◆ operator+=()

EvtDiracSpinor & EvtDiracSpinor::operator+= ( const EvtDiracSpinor & u2)
inline

Definition at line 122 of file EvtDiracSpinor.hh.

122 {
123
124 spinor[0] += u2.spinor[0];
125 spinor[1] += u2.spinor[1];
126 spinor[2] += u2.spinor[2];
127 spinor[3] += u2.spinor[3];
128
129 return *this;
130}

◆ operator-=()

EvtDiracSpinor & EvtDiracSpinor::operator-= ( const EvtDiracSpinor & u2)
inline

Definition at line 137 of file EvtDiracSpinor.hh.

137 {
138
139 spinor[0] -= u2.spinor[0];
140 spinor[1] -= u2.spinor[1];
141 spinor[2] -= u2.spinor[2];
142 spinor[3] -= u2.spinor[3];
143
144 return *this;
145}

◆ operator=()

EvtDiracSpinor & EvtDiracSpinor::operator= ( const EvtDiracSpinor & dspinor)
inline

Definition at line 112 of file EvtDiracSpinor.hh.

112 {
113
114 spinor[0] = dspinor.spinor[0];
115 spinor[1] = dspinor.spinor[1];
116 spinor[2] = dspinor.spinor[2];
117 spinor[3] = dspinor.spinor[3];
118
119 return *this;
120}

◆ set()

void EvtDiracSpinor::set ( const EvtComplex & sp0,
const EvtComplex & sp1,
const EvtComplex & sp2,
const EvtComplex & sp3 )

◆ set_spinor()

void EvtDiracSpinor::set_spinor ( int i,
const EvtComplex & sp )

Definition at line 48 of file EvtDiracSpinor.cc.

48{ spinor[i] = sp; }

Referenced by conj(), and EvtGammaMatrix::operator*.

◆ boostTo [1/2]

EvtDiracSpinor boostTo ( const EvtDiracSpinor & sp,
const EvtVector3R boost )
friend

Definition at line 74 of file EvtDiracSpinor.cc.

74 {
75
76 EvtDiracSpinor tmp( sp );
77 tmp.applyBoostTo( boost );
78 return tmp;
79}

◆ boostTo [2/2]

EvtDiracSpinor boostTo ( const EvtDiracSpinor & sp,
const EvtVector4R p4 )
friend

Definition at line 67 of file EvtDiracSpinor.cc.

67 {
68
69 EvtDiracSpinor tmp( sp );
70 tmp.applyBoostTo( p4 );
71 return tmp;
72}

◆ EvtLeptonACurrent

EvtVector4C EvtLeptonACurrent ( const EvtDiracSpinor & d,
const EvtDiracSpinor & dp )
friend

Definition at line 207 of file EvtDiracSpinor.cc.

207 {
208
209 EvtVector4C temp;
210
211 EvtGammaMatrix mat;
212
213 // no conjugate here; done in the multiplication
214 // yes this is stupid and fooled me to for a long time (ryd)
215
217 temp.set( 0, d * ( mat * dp ) );
218
220 temp.set( 1, d * ( mat * dp ) );
221
223 temp.set( 2, d * ( mat * dp ) );
224
226 temp.set( 3, d * ( mat * dp ) );
227
228 return temp;
229}
static const EvtGammaMatrix & va1()
static const EvtGammaMatrix & v0()
static const EvtGammaMatrix & va3()
static const EvtGammaMatrix & v2()
static const EvtGammaMatrix & va0()
static const EvtGammaMatrix & va2()
static const EvtGammaMatrix & v1()
static const EvtGammaMatrix & v3()
void set(int, const EvtComplex &)

◆ EvtLeptonPCurrent

EvtComplex EvtLeptonPCurrent ( const EvtDiracSpinor & d,
const EvtDiracSpinor & dp )
friend

Definition at line 243 of file EvtDiracSpinor.cc.

243 {
244
245 EvtComplex temp;
246
247 // no conjugate here; done in the multiplication
248 // yes this is stupid and fooled me to for a long time (ryd)
249 static EvtGammaMatrix m = EvtGammaMatrix::g0() * EvtGammaMatrix::g5();
250 temp = d * ( m * dp );
251
252 return temp;
253}
static const EvtGammaMatrix & g5()

◆ EvtLeptonSCurrent

EvtComplex EvtLeptonSCurrent ( const EvtDiracSpinor & d,
const EvtDiracSpinor & dp )
friend

Definition at line 231 of file EvtDiracSpinor.cc.

231 {
232
233 EvtComplex temp;
234
235 // no conjugate here; done in the multiplication
236 // yes this is stupid and fooled me to for a long time (ryd)
237
238 temp = d * ( EvtGammaMatrix::g0() * dp );
239
240 return temp;
241}

◆ EvtLeptonTCurrent

EvtTensor4C EvtLeptonTCurrent ( const EvtDiracSpinor & d,
const EvtDiracSpinor & dp )
friend

Definition at line 255 of file EvtDiracSpinor.cc.

255 {
256
257 EvtTensor4C temp;
258 temp.zero();
259 EvtComplex i2( 0, 0.5 );
260
261 static EvtGammaMatrix mat01 =
264 static EvtGammaMatrix mat02 =
267 static EvtGammaMatrix mat03 =
270 static EvtGammaMatrix mat12 =
273 static EvtGammaMatrix mat13 =
276 static EvtGammaMatrix mat23 =
279
280 temp.set( 0, 1, i2 * ( d * ( mat01 * dp ) ) );
281 temp.set( 1, 0, -temp.get( 0, 1 ) );
282
283 temp.set( 0, 2, i2 * ( d * ( mat02 * dp ) ) );
284 temp.set( 2, 0, -temp.get( 0, 2 ) );
285
286 temp.set( 0, 3, i2 * ( d * ( mat03 * dp ) ) );
287 temp.set( 3, 0, -temp.get( 0, 3 ) );
288
289 temp.set( 1, 2, i2 * ( d * ( mat12 * dp ) ) );
290 temp.set( 2, 1, -temp.get( 1, 2 ) );
291
292 temp.set( 1, 3, i2 * ( d * ( mat13 * dp ) ) );
293 temp.set( 3, 1, -temp.get( 1, 3 ) );
294
295 temp.set( 2, 3, i2 * ( d * ( mat23 * dp ) ) );
296 temp.set( 3, 2, -temp.get( 2, 3 ) );
297
298 return temp;
299}
static const EvtGammaMatrix & g2()
static const EvtGammaMatrix & g1()
static const EvtGammaMatrix & g3()
void set(int i, int j, const EvtComplex &c)
const EvtComplex & get(int i, int j) const

◆ EvtLeptonTg5Current

EvtTensor4C EvtLeptonTg5Current ( const EvtDiracSpinor & d,
const EvtDiracSpinor & dp )
friend

Definition at line 301 of file EvtDiracSpinor.cc.

302 { // sigma^{mu,nu} gamma_5
303
304 EvtTensor4C temp;
305 temp.zero();
306 EvtComplex i2( 0, 0.5 );
307
308 static EvtGammaMatrix mat01 = EvtGammaMatrix::g0() *
312 static EvtGammaMatrix mat02 = EvtGammaMatrix::g0() *
316 static EvtGammaMatrix mat03 = EvtGammaMatrix::g0() *
320 static EvtGammaMatrix mat12 = EvtGammaMatrix::g0() *
324 static EvtGammaMatrix mat13 = EvtGammaMatrix::g0() *
328 static EvtGammaMatrix mat23 = EvtGammaMatrix::g0() *
332
333 temp.set( 0, 1, i2 * ( d * ( mat01 * dp ) ) );
334 temp.set( 1, 0, -temp.get( 0, 1 ) );
335
336 temp.set( 0, 2, i2 * ( d * ( mat02 * dp ) ) );
337 temp.set( 2, 0, -temp.get( 0, 2 ) );
338
339 temp.set( 0, 3, i2 * ( d * ( mat03 * dp ) ) );
340 temp.set( 3, 0, -temp.get( 0, 3 ) );
341
342 temp.set( 1, 2, i2 * ( d * ( mat12 * dp ) ) );
343 temp.set( 2, 1, -temp.get( 1, 2 ) );
344
345 temp.set( 1, 3, i2 * ( d * ( mat13 * dp ) ) );
346 temp.set( 3, 1, -temp.get( 1, 3 ) );
347
348 temp.set( 2, 3, i2 * ( d * ( mat23 * dp ) ) );
349 temp.set( 3, 2, -temp.get( 2, 3 ) );
350
351 return temp;
352}

◆ EvtLeptonVACurrent

EvtVector4C EvtLeptonVACurrent ( const EvtDiracSpinor & d,
const EvtDiracSpinor & dp )
friend

Definition at line 162 of file EvtDiracSpinor.cc.

162 {
163
164 // Old code; below is a new specialized code that does it more efficiently.
165 // EvtGammaMatrix mat;
166 // EvtVector4C temp;
167 // mat.va0();
168 // temp.set(0,d*(mat*dp));
169 // mat.va1();
170 // temp.set(1,d*(mat*dp));
171 // mat.va2();
172 // temp.set(2,d*(mat*dp));
173 // mat.va3();
174 // temp.set(3,d*(mat*dp));
175 // return temp;
176
177 EvtComplex u02 = ::conj( d.spinor[0] - d.spinor[2] );
178 EvtComplex u13 = ::conj( d.spinor[1] - d.spinor[3] );
179
180 EvtComplex v02 = dp.spinor[0] - dp.spinor[2];
181 EvtComplex v13 = dp.spinor[1] - dp.spinor[3];
182
183 EvtComplex a = u02 * v02;
184 EvtComplex b = u13 * v13;
185
186 EvtComplex c = u02 * v13;
187 EvtComplex e = u13 * v02;
188
189 return EvtVector4C( a + b, -( c + e ), EvtComplex( 0, 1 ) * ( c - e ), b - a );
190}

◆ EvtLeptonVCurrent

EvtVector4C EvtLeptonVCurrent ( const EvtDiracSpinor & d,
const EvtDiracSpinor & dp )
friend

Definition at line 192 of file EvtDiracSpinor.cc.

192 {
193
194 EvtVector4C temp;
195
196 // no conjugate here; done in the multiplication
197 // yes this is stupid and fooled me to for a long time (ryd)
198
199 temp.set( 0, d * ( EvtGammaMatrix::v0() * dp ) );
200 temp.set( 1, d * ( EvtGammaMatrix::v1() * dp ) );
201 temp.set( 2, d * ( EvtGammaMatrix::v2() * dp ) );
202 temp.set( 3, d * ( EvtGammaMatrix::v3() * dp ) );
203
204 return temp;
205}

◆ operator*

EvtDiracSpinor operator* ( const EvtComplex & c,
const EvtDiracSpinor & d )
friend

Definition at line 354 of file EvtDiracSpinor.cc.

354 {
355 EvtDiracSpinor result;
356 result.spinor[0] = c * d.spinor[0];
357 result.spinor[1] = c * d.spinor[1];
358 result.spinor[2] = c * d.spinor[2];
359 result.spinor[3] = c * d.spinor[3];
360 return result;
361}

◆ operator+

EvtDiracSpinor operator+ ( const EvtDiracSpinor & u1,
const EvtDiracSpinor & u2 )
friend

Definition at line 132 of file EvtDiracSpinor.hh.

132 {
133
134 return EvtDiracSpinor( u1 ) += u2;
135}

◆ operator-

EvtDiracSpinor operator- ( const EvtDiracSpinor & u1,
const EvtDiracSpinor & u2 )
friend

Definition at line 147 of file EvtDiracSpinor.hh.

147 {
148
149 return EvtDiracSpinor( u1 ) -= u2;
150}

◆ operator<<

std::ostream & operator<< ( std::ostream & s,
const EvtDiracSpinor & c )
friend

◆ rotateEuler

EvtDiracSpinor rotateEuler ( const EvtDiracSpinor & sp,
double alpha,
double beta,
double gamma )
friend

Definition at line 59 of file EvtDiracSpinor.cc.

60 {
61
62 EvtDiracSpinor tmp( sp );
63 tmp.applyRotateEuler( alpha, beta, gamma );
64 return tmp;
65}

The documentation for this class was generated from the following files: