thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
LorentzRSSpinorBar.h
1// -*- C++ -*-
2//
3// LorentzRSSpinorBar.h is a part of ThePEG - Toolkit for HEP Event Generation
4// Copyright (C) 2003-2019 Peter Richardson, Leif Lonnblad
5//
6// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8//
9#ifndef ThePEG_LorentzRSSpinorBar_H
10#define ThePEG_LorentzRSSpinorBar_H
11// This is the declaration of the LorentzRSSpinorBar class.
12
15#include "HelicityDefinitions.h"
16#include "LorentzRSSpinor.fh"
17#include "LorentzRSSpinorBar.fh"
18#include "LorentzSpinorBar.h"
19#include "LorentzSpinor.h"
20#include "LorentzPolarizationVector.h"
21
22namespace ThePEG {
23namespace Helicity {
24
37template <typename Value>
39
40public:
41
48
53 LorentzRSSpinorBar(complex<Value> a1,complex<Value> b1,
54 complex<Value> c1,complex<Value> d1,
55 complex<Value> a2,complex<Value> b2,
56 complex<Value> c2,complex<Value> d2,
57 complex<Value> a3,complex<Value> b3,
58 complex<Value> c3,complex<Value> d3,
59 complex<Value> a4,complex<Value> b4,
60 complex<Value> c4,complex<Value> d4,
62 : _type(t), _spin{{ {{a1,b1,c1,d1}},
63 {{a2,b2,c2,d2}},
64 {{a3,b3,c3,d3}},
65 {{a4,b4,c4,d4}}
66 }} {}
67
68 template <typename U>
69 LorentzRSSpinorBar(const LorentzRSSpinorBar<U> & other)
70 : _type(other._type), _spin(other._spin) {}
72
78 complex<Value> operator()(int i, int j) const {
79 assert( i >= 0 && i <= 3 && j>=0 && j<=3 );
80 return _spin[i][j];
81 }
82
86 complex<Value> & operator () (int i, int j) {
87 assert( i >= 0 && i <= 3 && j>=0 && j<=3 );
88 return _spin[i][j];
89 }
90
94 complex<Value> xs1() const {return _spin[0][0];}
95
99 complex<Value> xs2() const {return _spin[0][1];}
100
104 complex<Value> xs3() const {return _spin[0][2];}
105
109 complex<Value> xs4() const {return _spin[0][3];}
110
114 complex<Value> ys1() const {return _spin[1][0];}
115
119 complex<Value> ys2() const {return _spin[1][1];}
120
124 complex<Value> ys3() const {return _spin[1][2];}
125
129 complex<Value> ys4() const {return _spin[1][3];}
130
134 complex<Value> zs1() const {return _spin[2][0];}
135
139 complex<Value> zs2() const {return _spin[2][1];}
140
144 complex<Value> zs3() const {return _spin[2][2];}
145
149 complex<Value> zs4() const {return _spin[2][3];}
150
154 complex<Value> ts1() const {return _spin[3][0];}
155
159 complex<Value> ts2() const {return _spin[3][1];}
160
164 complex<Value> ts3() const {return _spin[3][2];}
165
169 complex<Value> ts4() const {return _spin[3][3];}
170
174 void setXS1(complex<Value> in) {_spin[0][0]=in;}
175
179 void setXS2(complex<Value> in) {_spin[0][1]=in;}
180
184 void setXS3(complex<Value> in) {_spin[0][2]=in;}
185
189 void setXS4(complex<Value> in) {_spin[0][3]=in;}
190
194 void setYS1(complex<Value> in) {_spin[1][0]=in;}
195
199 void setYS2(complex<Value> in) {_spin[1][1]=in;}
200
204 void setYS3(complex<Value> in) {_spin[1][2]=in;}
205
209 void setYS4(complex<Value> in) {_spin[1][3]=in;}
210
214 void setZS1(complex<Value> in) {_spin[2][0]=in;}
215
219 void setZS2(complex<Value> in) {_spin[2][1]=in;}
220
224 void setZS3(complex<Value> in) {_spin[2][2]=in;}
225
229 void setZS4(complex<Value> in) {_spin[2][3]=in;}
230
234 void setTS1(complex<Value> in) {_spin[3][0]=in;}
235
239 void setTS2(complex<Value> in) {_spin[3][1]=in;}
240
244 void setTS3(complex<Value> in) {_spin[3][2]=in;}
245
249 void setTS4(complex<Value> in ) {_spin[3][3]=in;}
251
253
254 template <typename ValueB>
256 for(unsigned int ix=0;ix<4;++ix)
257 for(unsigned int iy=0;iy<4;++iy)
258 _spin[ix][iy] += a._spin[ix][iy];
259 return *this;
260 }
261
262 template <typename ValueB>
263 LorentzRSSpinorBar<Value> & operator-=(const LorentzRSSpinorBar<ValueB> & a) {
264 for(unsigned int ix=0;ix<4;++ix)
265 for(unsigned int iy=0;iy<4;++iy)
266 _spin[ix][iy] -= a._spin[ix][iy];
267 return *this;
268 }
269
270 LorentzRSSpinorBar<Value> & operator*=(double a) {
271 for(unsigned int ix=0;ix<4;++ix)
272 for(unsigned int iy=0;iy<4;++iy)
273 _spin[ix][iy] *=a;
274 return *this;
275 }
276
277 LorentzRSSpinorBar<Value> & operator/=(double a) {
278 for(unsigned int ix=0;ix<4;++ix)
279 for(unsigned int iy=0;iy<4;++iy)
280 _spin[ix][iy] /=a;
281 return *this;
282 }
284
291 LorentzSpinorBar<Value> output(_type);
292 for(unsigned int ix=0;ix<4;++ix) {
293 output[ix]=_spin[3][ix]*vec.t()-_spin[0][ix]*vec.x()
294 -_spin[1][ix]*vec.y()-_spin[2][ix]*vec.z();
295 }
296 return output;
297 }
298
303 LorentzSpinorBar<Value> output(_type);
304 LorentzVector<double> vec = UnitRemoval::InvE * invec;
305 unsigned int ix;
306 for(ix=0;ix<4;++ix) {
307 output[ix]=_spin[3][ix]*vec.t()-_spin[0][ix]*vec.x()
308 -_spin[1][ix]*vec.y()-_spin[2][ix]*vec.z();
309 }
310 return output;
311 }
313
320
324 LorentzRSSpinorBar & boost(double,double,double);
325
330
336
342 SpinorType Type() const {return _type;}
344
351 template <typename ValueB>
354 -> LorentzVector<decltype(left*this->ts1()*f.s1())>
355 {
356 typedef decltype(left*ts1()*f.s1()) ResultT;
357 ResultT output[4];
358 unsigned int iz;
359 for(iz=0;iz<4;++iz){
360 output[iz]= left*(_spin[iz][0]*f.s1()+_spin[iz][1]*f.s2())
361 +right*(_spin[iz][2]*f.s3()+_spin[iz][3]*f.s4());
362 }
363 return LorentzVector<ResultT>(output[0],output[1],
364 output[2],output[3]);
365 }
366
367private:
372
376 std::array<std::array<complex<Value>,4>,4> _spin;
377};
378
380
381template <typename Value>
383operator/(const LorentzRSSpinorBar<Value> & v, Value a) {
384 return LorentzRSSpinorBar<double>(v.xs1()/a, v.xs2()/a, v.xs3()/a, v.xs4()/a,
385 v.ys1()/a, v.ys2()/a, v.ys3()/a, v.ys4()/a,
386 v.zs1()/a, v.zs2()/a, v.zs3()/a, v.zs4()/a,
387 v.ts1()/a, v.ts2()/a, v.ts3()/a, v.ts4()/a,
388 v.Type());
389}
390
391inline LorentzRSSpinorBar<double>
392operator/(const LorentzRSSpinorBar<double> & v, Complex a) {
393 return LorentzRSSpinorBar<double>(v.xs1()/a, v.xs2()/a, v.xs3()/a, v.xs4()/a,
394 v.ys1()/a, v.ys2()/a, v.ys3()/a, v.ys4()/a,
395 v.zs1()/a, v.zs2()/a, v.zs3()/a, v.zs4()/a,
396 v.ts1()/a, v.ts2()/a, v.ts3()/a, v.ts4()/a,
397 v.Type());
398}
399
400template <typename Value>
401inline LorentzRSSpinorBar<Value> operator-(const LorentzRSSpinorBar<Value> & v) {
402 return LorentzRSSpinorBar<Value>(-v.xs1(),-v.xs2(),-v.xs3(),-v.xs4(),
403 -v.ys1(),-v.ys2(),-v.ys3(),-v.ys4(),
404 -v.zs1(),-v.zs2(),-v.zs3(),-v.zs4(),
405 -v.ts1(),-v.ts2(),-v.ts3(),-v.ts4(),
406 v.Type());
407}
408
409template <typename ValueA, typename ValueB>
410inline LorentzRSSpinorBar<ValueA>
411operator+(LorentzRSSpinorBar<ValueA> a, const LorentzRSSpinorBar<ValueB> & b) {
412 return a += b;
413}
414
415template <typename ValueA, typename ValueB>
416inline LorentzRSSpinorBar<ValueA>
417operator-(LorentzRSSpinorBar<ValueA> a, const LorentzRSSpinorBar<ValueB> & b) {
418 return a -= b;
419}
420
421template <typename Value>
422inline LorentzRSSpinorBar<Value>
423operator*(const LorentzRSSpinorBar<Value> & a, double b) {
424 return LorentzRSSpinorBar<Value>(a.xs1()*b, a.xs2()*b, a.xs3()*b, a.xs4()*b,
425 a.ys1()*b, a.ys2()*b, a.ys3()*b, a.ys4()*b,
426 a.zs1()*b, a.zs2()*b, a.zs3()*b, a.zs4()*b,
427 a.ts1()*b, a.ts2()*b, a.ts3()*b, a.ts4()*b,a.Type());
428}
429
430template <typename Value>
431inline LorentzRSSpinorBar<Value>
432operator*(double b, LorentzRSSpinorBar<Value> a) {
433 return a *= b;
434}
435
436template <typename Value>
437inline LorentzRSSpinorBar<Value>
438operator*(const LorentzRSSpinorBar<Value> & a, Complex b) {
439 return LorentzRSSpinorBar<Value>(a.xs1()*b, a.xs2()*b, a.xs3()*b, a.xs4()*b,
440 a.ys1()*b, a.ys2()*b, a.ys3()*b, a.ys4()*b,
441 a.zs1()*b, a.zs2()*b, a.zs3()*b, a.zs4()*b,
442 a.ts1()*b, a.ts2()*b, a.ts3()*b, a.ts4()*b,a.Type());
443}
444
445template <typename ValueA, typename ValueB>
446inline auto operator*(complex<ValueB> a, const LorentzRSSpinorBar<ValueA> & v)
447 -> LorentzRSSpinorBar<decltype(a.real()*v.xs1().real())>
448{
449 return {a*v.xs1(), a*v.xs2(), a*v.xs3(), a*v.xs4(),
450 a*v.ys1(), a*v.ys2(), a*v.ys3(), a*v.ys4(),
451 a*v.zs1(), a*v.zs2(), a*v.zs3(), a*v.zs4(),
452 a*v.ts1(), a*v.ts2(), a*v.ts3(), a*v.ts4(),v.Type()};
453}
454
455template <typename ValueA, typename ValueB>
456inline auto operator*(const LorentzRSSpinorBar<ValueA> & v, complex<ValueB> b)
457 -> LorentzRSSpinorBar<decltype(b.real()*v.xs1().real())>
458{
459 return b*v;
460}
461
462template <typename ValueA, typename ValueB>
463inline auto operator/(const LorentzRSSpinorBar<ValueA> & v, complex<ValueB> b)
464 -> LorentzRSSpinorBar<decltype(v.xs1().real()/b.real())>
465{
466 return {v.xs1()/b, v.xs2()/b, v.xs3()/b, v.xs4()/b,
467 v.ys1()/b, v.ys2()/b, v.ys3()/b, v.ys4()/b,
468 v.zs1()/b, v.zs2()/b, v.zs3()/b, v.zs4()/b,
469 v.ts1()/b, v.ts2()/b, v.ts3()/b, v.ts4()/b,v.Type()};
470}
471
472template <typename ValueA, typename ValueB>
473inline auto operator*(ValueB a, const LorentzRSSpinorBar<ValueA> & v)
474 -> LorentzRSSpinorBar<decltype(a*v.xs1().real())>
475{
476 return {a*v.xs1(), a*v.xs2(), a*v.xs3(), a*v.xs4(),
477 a*v.ys1(), a*v.ys2(), a*v.ys3(), a*v.ys4(),
478 a*v.zs1(), a*v.zs2(), a*v.zs3(), a*v.zs4(),
479 a*v.ts1(), a*v.ts2(), a*v.ts3(), a*v.ts4(),v.Type()};
480}
481
482template <typename ValueA, typename ValueB>
483inline auto operator*(const LorentzRSSpinorBar<ValueA> & v, ValueB b)
484 -> LorentzRSSpinorBar<decltype(b*v.xs1().real())>
485{
486 return b*v;
487}
488
489template <typename ValueA, typename ValueB>
490inline auto operator/(const LorentzRSSpinorBar<ValueA> & v, ValueB b)
491 -> LorentzRSSpinorBar<decltype(v.xs1().real()/b)>
492{
493 return {v.xs1()/b, v.xs2()/b, v.xs3()/b, v.xs4()/b,
494 v.ys1()/b, v.ys2()/b, v.ys3()/b, v.ys4()/b,
495 v.zs1()/b, v.zs2()/b, v.zs3()/b, v.zs4()/b,
496 v.ts1()/b, v.ts2()/b, v.ts3()/b, v.ts4()/b,v.Type()};
497}
499
500}
501}
502#ifndef ThePEG_TEMPLATES_IN_CC_FILE
503#include "LorentzRSSpinorBar.tcc"
504#endif
505
506#endif
This file contains enumerations used by LorentzSpinor and LorentzSpinorBar classes.
This is the main config header file for ThePEG.
contains the ThreeVector class.
The LorentzRSSpinorBar class implements the storage of a barred Lorentz Rarita-Schwinger Spinor for a...
void setZS2(complex< Value > in)
Set second spinor component for the z vector.
complex< Value > ys1() const
Get first spinor component for the y vector.
LorentzSpinorBar< Value > dot(const LorentzMomentum &invec) const
dot product with a 4-momentum
complex< Value > zs3() const
Get third spinor component for the z vector.
complex< Value > xs4() const
Get fourth spinor component for the x vector.
std::array< std::array< complex< Value >, 4 >, 4 > _spin
Storage of the components.
LorentzRSSpinorBar(complex< Value > a1, complex< Value > b1, complex< Value > c1, complex< Value > d1, complex< Value > a2, complex< Value > b2, complex< Value > c2, complex< Value > d2, complex< Value > a3, complex< Value > b3, complex< Value > c3, complex< Value > d3, complex< Value > a4, complex< Value > b4, complex< Value > c4, complex< Value > d4, SpinorType t=SpinorType::unknown)
Constructor with complex numbers specifying the components, optionally specifying t,...
complex< Value > xs2() const
Get second spinor component for the x vector.
complex< Value > operator()(int i, int j) const
Subscript operator to return spinor components.
void setXS4(complex< Value > in)
Set fourth spinor component for the x vector.
complex< Value > ts4() const
Get fourth spinor component for the t vector.
void setZS3(complex< Value > in)
Set third spinor component for the z vector.
void setTS3(complex< Value > in)
Set third spinor component for the t vector.
void setXS2(complex< Value > in)
Set second spinor component for the x vector.
complex< Value > zs2() const
Get second spinor component for the z vector.
void setXS3(complex< Value > in)
Set third spinor component for the x vector.
complex< Value > xs3() const
Get third spinor component for the x vector.
void setYS1(complex< Value > in)
Set first spinor component for the y vector.
SpinorType Type() const
Return the type of the spinor.
void setXS1(complex< Value > in)
Set first spinor component for the x vector.
complex< Value > ts3() const
Get third spinor component for the t vector.
LorentzRSSpinorBar & boost(const Boost &)
Standard Lorentz boost specifying the beta vector.
auto generalCurrent(LorentzSpinor< ValueB > &f, Complex left, Complex right) -> LorentzVector< decltype(left *this->ts1() *f.s1())>
Current for general couplings.
LorentzRSSpinorBar & transform(const LorentzRotation &)
General transform.
complex< Value > ys4() const
Get fourth spinor component for the y vector.
LorentzRSSpinor< Value > bar() const
return the barred spinor
complex< Value > ts2() const
Get second spinor component for the t vector.
void setZS4(complex< Value > in)
Set fourth spinor component for the z vector.
void setYS4(complex< Value > in)
Set fourth spinor component for the y vector.
LorentzRSSpinorBar(SpinorType t=SpinorType::unknown)
Default zero constructor, optionally specifying t, the type.
void setTS1(complex< Value > in)
Set first spinor component for the t vector.
void setTS4(complex< Value > in)
Set fourth spinor component for the t vector.
void setTS2(complex< Value > in)
Set second spinor component for the t vector.
complex< Value > zs1() const
Get first spinor component for the z vector.
complex< Value > ys3() const
Get third spinor component for the y vector.
complex< Value > zs4() const
Get fourth spinor component for the z vector.
void setYS3(complex< Value > in)
Set third spinor component for the y vector.
complex< Value > ys2() const
Get second spinor component for the y vector.
LorentzSpinorBar< Value > dot(const LorentzPolarizationVector &vec) const
dot product with a polarization vector
void setYS2(complex< Value > in)
Set second spinor component for the y vector.
LorentzRSSpinorBar & boost(double, double, double)
Standard Lorentz boost specifying the components of the beta vector.
void setZS1(complex< Value > in)
Set first spinor component for the z vector.
complex< Value > xs1() const
Get first spinor component for the x vector.
complex< Value > ts1() const
Get first spinor component for the t vector.
The LorentzRSSpinor class is designed to store a Rarita-Schwinger spinor for a spin-3/2 particle.
The LorentzSpinorBar class implements the storage of a barred LorentzSpinor.
The LorentzSpinor class is designed to store a spinor.
Definition: LorentzSpinor.h:71
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
A 3-component vector.
Definition: ThreeVector.h:35
SpinorType
Enumeration to specify spinor type.
@ unknown
Undefined spinor type.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
std::complex< double > Complex
ThePEG code should use Complex for all complex scalars.
Definition: Complex.h:23
ostream & right(ostream &os)
Stream manipulator setting an ostream to right-adjust its ouput.
Definition: std.h:167
ostream & left(ostream &os)
Stream manipulator setting an ostream to left-adjust its ouput.
Definition: std.h:161