BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtDiracSpinor.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: EvtDiracSpinor.cc
12//
13// Description: Class to describe (EvtDiracParticle) spinors.
14//
15// Modification history:
16//
17// DJL/RYD September 25, 1996 Module created
18//
19//------------------------------------------------------------------------
20//
21#include "EvtDiracSpinor.hh"
22#include "EvtComplex.hh"
23#include "EvtGammaMatrix.hh"
24#include "EvtPatches.hh"
25#include "EvtReport.hh"
26#include "EvtTensor4C.hh"
27#include "EvtVector4C.hh"
28#include <assert.h>
29#include <math.h>
30using std::ostream;
31
33
35 const EvtComplex& sp2, const EvtComplex& sp3 ) {
36 set( sp0, sp1, sp2, sp3 );
37}
38
39void EvtDiracSpinor::set( const EvtComplex& sp0, const EvtComplex& sp1, const EvtComplex& sp2,
40 const EvtComplex& sp3 ) {
41
42 spinor[0] = sp0;
43 spinor[1] = sp1;
44 spinor[2] = sp2;
45 spinor[3] = sp3;
46}
47
48void EvtDiracSpinor::set_spinor( int i, const EvtComplex& sp ) { spinor[i] = sp; }
49
50ostream& operator<<( ostream& s, const EvtDiracSpinor& sp ) {
51
52 s << "[" << sp.spinor[0] << "," << sp.spinor[1] << "," << sp.spinor[2] << "," << sp.spinor[3]
53 << "]";
54 return s;
55}
57const EvtComplex& EvtDiracSpinor::get_spinor( int i ) const { return spinor[i]; }
59EvtDiracSpinor rotateEuler( const EvtDiracSpinor& sp, double alpha, double beta,
60 double gamma ) {
62 EvtDiracSpinor tmp( sp );
63 tmp.applyRotateEuler( alpha, beta, gamma );
64 return tmp;
65}
66
68
69 EvtDiracSpinor tmp( sp );
70 tmp.applyBoostTo( p4 );
71 return tmp;
72}
73
75
76 EvtDiracSpinor tmp( sp );
77 tmp.applyBoostTo( boost );
78 return tmp;
79}
80
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}
91
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}
123
124void EvtDiracSpinor::applyRotateEuler( double alpha, double beta, double gamma ) {
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}
152
154
156
157 for ( int i = 0; i < 4; i++ ) sp.set_spinor( i, ::conj( spinor[i] ) );
158
159 return sp;
160}
161
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}
191
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}
206
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}
230
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}
242
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)
250 temp = d * ( m * dp );
251
252 return temp;
253}
254
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}
300
302 const EvtDiracSpinor& dp ) { // 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}
353
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}
362
364 EvtDiracSpinor d = this->conj(); // first conjugate, then multiply with gamma0
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}
TFile * f1
Evt3Rank3C conj(const Evt3Rank3C &t2)
EvtDiracSpinor operator*(const EvtComplex &c, const EvtDiracSpinor &d)
EvtVector4C EvtLeptonVACurrent(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtTensor4C EvtLeptonTCurrent(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtVector4C EvtLeptonACurrent(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtTensor4C EvtLeptonTg5Current(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtDiracSpinor rotateEuler(const EvtDiracSpinor &sp, double alpha, double beta, double gamma)
EvtComplex EvtLeptonSCurrent(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtVector4C EvtLeptonVCurrent(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
ostream & operator<<(ostream &s, const EvtDiracSpinor &sp)
EvtComplex EvtLeptonPCurrent(const EvtDiracSpinor &d, const EvtDiracSpinor &dp)
EvtDiracSpinor boostTo(const EvtDiracSpinor &sp, const EvtVector4R p4)
double alpha
XmlRpcServer s
EvtDiracSpinor conj() const
const EvtComplex & get_spinor(int i) const
void set(const EvtComplex &sp0, const EvtComplex &sp1, const EvtComplex &sp2, const EvtComplex &sp3)
EvtDiracSpinor adjoint() const
void applyRotateEuler(double alpha, double beta, double gamma)
void applyBoostTo(const EvtVector4R &p4)
virtual ~EvtDiracSpinor()
void set_spinor(int i, const EvtComplex &sp)
static const EvtGammaMatrix & va1()
static const EvtGammaMatrix & v0()
static const EvtGammaMatrix & g0()
static const EvtGammaMatrix & g2()
static const EvtGammaMatrix & g1()
static const EvtGammaMatrix & va3()
static const EvtGammaMatrix & g3()
static const EvtGammaMatrix & v2()
static const EvtGammaMatrix & va0()
static const EvtGammaMatrix & va2()
static const EvtGammaMatrix & g5()
static const EvtGammaMatrix & v1()
static const EvtGammaMatrix & v3()
void set(int i, int j, const EvtComplex &c)
const EvtComplex & get(int i, int j) const
double get(int i) const
void set(int, const EvtComplex &)
double get(int i) const