thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
Helicity
LorentzSpinorBar.h
1
// -*- C++ -*-
2
//
3
// LorentzSpinorBar.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_LorentzSpinorBar_H
10
#define ThePEG_LorentzSpinorBar_H
11
// This is the declaration of the LorentzSpinorBar class.
12
13
#include "
ThePEG/Config/ThePEG.h
"
14
#include "ThePEG/Vectors/LorentzRotation.h"
15
#include "
ThePEG/Vectors/ThreeVector.h
"
16
#include "
HelicityDefinitions.h
"
17
#include "LorentzSpinor.fh"
18
#include "LorentzSpinorBar.fh"
19
20
namespace
ThePEG
{
21
namespace
Helicity {
22
34
template
<
typename
Value>
35
class
LorentzSpinorBar
{
36
public
:
37
43
LorentzSpinorBar
(
SpinorType
t =
SpinorType::unknown
) :
_type
(t),
_spin
() {}
44
49
LorentzSpinorBar
(complex<Value> a, complex<Value> b,
50
complex<Value> c, complex<Value> d,
51
SpinorType
t =
SpinorType::unknown
)
52
:
_type
(t),
_spin
{{a,b,c,d}} {}
53
54
template
<
typename
U>
55
LorentzSpinorBar(
const
LorentzSpinorBar<U> & other)
56
: _type(other._type), _spin(other._spin) {}
57
59
65
complex<Value>
operator[]
(
int
i)
const
{
66
assert( i>= 0 && i <= 3 );
67
return
_spin[i];
68
}
69
73
complex<Value>
operator()
(
int
i)
const
{
74
assert( i>= 0 && i <= 3 );
75
return
_spin[i];
76
}
77
81
complex<Value> &
operator()
(
int
i) {
82
assert( i>= 0 && i <= 3 );
83
return
_spin[i];
84
}
85
89
complex<Value> &
operator[]
(
int
i) {
90
assert( i>= 0 && i <= 3 );
91
return
_spin[i];
92
}
93
97
complex<Value>
s1
()
const
{
return
_spin[0];}
98
102
complex<Value>
s2
()
const
{
return
_spin[1];}
103
107
complex<Value>
s3
()
const
{
return
_spin[2];}
108
112
complex<Value>
s4
()
const
{
return
_spin[3];}
113
117
void
setS1
(complex<Value> in) {_spin[0]=in;}
118
122
void
setS2
(complex<Value> in) {_spin[1]=in;}
123
127
void
setS3
(complex<Value> in) {_spin[2]=in;}
128
132
void
setS4
(complex<Value> in) {_spin[3]=in;}
134
136
137
template
<
typename
ValueB>
138
LorentzSpinorBar<Value>
& operator+=(
const
LorentzSpinorBar<ValueB>
& a) {
139
for
(
unsigned
int
ix=0;ix<4;++ix) _spin[ix] += a.
_spin
[ix];
140
return
*
this
;
141
}
142
143
template
<
typename
ValueB>
144
LorentzSpinorBar<Value> & operator-=(
const
LorentzSpinorBar<ValueB> & a) {
145
for
(
unsigned
int
ix=0;ix<4;++ix) _spin[ix] -= a._spin[ix];
146
return
*
this
;
147
}
148
149
LorentzSpinorBar<Value> & operator*=(
double
a) {
150
for
(
unsigned
int
ix=0;ix<4;++ix) _spin[ix] *=a;
151
return
*
this
;
152
}
153
154
LorentzSpinorBar<Value> & operator/=(
double
a) {
155
for
(
unsigned
int
ix=0;ix<4;++ix) _spin[ix] /=a;
156
return
*
this
;
157
}
159
165
LorentzSpinor<Value>
bar
()
const
;
166
172
LorentzSpinorBar
conjugate
()
const
;
173
177
LorentzSpinorBar
&
boost
(
double
,
double
,
double
);
178
182
LorentzSpinorBar
&
boost
(
const
Boost
&);
183
187
LorentzSpinorBar
&
transform
(
const
SpinHalfLorentzRotation
&) ;
188
192
LorentzSpinorBar
&
transform
(
const
LorentzRotation
& r) {
193
transform(r.
half
());
194
return
*
this
;
195
}
197
203
SpinorType
Type
()
const
{
return
_type;}
205
213
template
<
typename
ValueB>
214
auto
projectionOperator
(
const
LorentzVector<ValueB>
& p,
215
const
ValueB & m)
const
216
->
LorentzSpinorBar
<
decltype
(m*Value())>
217
{
218
typedef
decltype
(m*Value()) ResultT;
219
LorentzSpinorBar<ResultT>
spin;
220
static
const
Complex
ii(0.,1.);
221
complex<ValueB> p0pp3=p.t()+p.z();
222
complex<ValueB> p0mp3=p.t()-p.z();
223
complex<ValueB> p1pp2=p.x()+ii*p.y();
224
complex<ValueB> p1mp2=p.x()-ii*p.y();
225
spin.setS1(m*s1()+p0pp3*s3()+p1pp2*s4());
226
spin.setS2(m*s2()+p0mp3*s4()+p1mp2*s3());
227
spin.setS3(m*s3()+p0mp3*s1()-p1pp2*s2());
228
spin.setS4(m*s4()+p0pp3*s2()-p1mp2*s1());
229
return
spin;
230
}
231
235
LorentzSpinorBar
236
helicityProjectionOperator
(
const
Complex
& gL,
const
Complex
& gR)
const
{
237
LorentzSpinorBar
spin;
238
spin.
setS1
(gL*s1());
239
spin.
setS2
(gL*s2());
240
spin.
setS3
(gR*s3());
241
spin.
setS4
(gR*s4());
242
return
spin;
243
}
245
251
template
<
typename
ValueB>
252
auto
slash
(
const
LorentzVector<ValueB>
& p)
const
253
->
LorentzSpinorBar
<
decltype
(p.t()*Value())>
254
{
255
LorentzSpinorBar
<
decltype
(p.t()*Value())> spin;
256
static
const
Complex
ii(0.,1.);
257
complex<ValueB> p0pp3=p.t()+p.z();
258
complex<ValueB> p0mp3=p.t()-p.z();
259
complex<ValueB> p1pp2=p.x()+ii*p.y();
260
complex<ValueB> p1mp2=p.x()-ii*p.y();
261
spin.setS1(p0pp3*s3()+p1pp2*s4());
262
spin.setS2(p0mp3*s4()+p1mp2*s3());
263
spin.setS3(p0mp3*s1()-p1pp2*s2());
264
spin.setS4(p0pp3*s2()-p1mp2*s1());
265
return
spin;
266
}
267
271
template
<
typename
ValueB>
272
auto
slash
(
const
LorentzVector
<complex<ValueB> > & p)
const
273
->
LorentzSpinor
<
decltype
(ValueB()*Value())>
274
{
275
LorentzSpinor
<
decltype
(ValueB()*Value())> spin;
276
static
const
Complex
ii(0.,1.);
277
complex<ValueB> p0pp3=p.t()+p.z();
278
complex<ValueB> p0mp3=p.t()-p.z();
279
complex<ValueB> p1pp2=p.x()+ii*p.y();
280
complex<ValueB> p1mp2=p.x()-ii*p.y();
281
spin.setS1(p0pp3*s3()+p1pp2*s4());
282
spin.setS2(p0mp3*s4()+p1mp2*s3());
283
spin.setS3(p0mp3*s1()-p1pp2*s2());
284
spin.setS4(p0pp3*s2()-p1mp2*s1());
285
return
spin;
286
}
288
289
private
:
293
SpinorType
_type
;
294
298
std::array<complex<Value>,4>
_spin
;
299
};
300
302
303
template
<
typename
Value>
304
inline
LorentzSpinorBar<double>
305
operator/(
const
LorentzSpinorBar<Value>
& v, Value a) {
306
return
LorentzSpinorBar<double>
(
v
.s1()/a,
v
.s2()/a,
v
.s3()/a,
v
.s4()/a,
v
.Type());
307
}
308
309
inline
LorentzSpinorBar<double>
310
operator/(
const
LorentzSpinorBar<double> & v,
Complex
a) {
311
return
LorentzSpinorBar<double>(v.s1()/a, v.s2()/a, v.s3()/a, v.s4()/a,v.Type());
312
}
313
314
template
<
typename
Value>
315
inline
LorentzSpinorBar<Value> operator-(
const
LorentzSpinorBar<Value> & v) {
316
return
LorentzSpinorBar<Value>(-v.s1(),-v.s2(),-v.s3(),-v.s4(),v.Type());
317
}
318
319
template
<
typename
ValueA,
typename
ValueB>
320
inline
LorentzSpinorBar<ValueA>
321
operator+(LorentzSpinorBar<ValueA> a,
const
LorentzSpinorBar<ValueB> & b) {
322
return
a +=
b
;
323
}
324
325
template
<
typename
ValueA,
typename
ValueB>
326
inline
LorentzSpinorBar<ValueA>
327
operator-(LorentzSpinorBar<ValueA> a,
const
LorentzSpinorBar<ValueB> & b) {
328
return
a -=
b
;
329
}
330
331
template
<
typename
Value>
332
inline
LorentzSpinorBar<Value>
333
operator*(
const
LorentzSpinorBar<Value> & a,
double
b) {
334
return
LorentzSpinorBar<Value>(a.s1()*b, a.s2()*b, a.s3()*b, a.s4()*b,a.Type());
335
}
336
337
template
<
typename
Value>
338
inline
LorentzSpinorBar<Value>
339
operator*(
double
b, LorentzSpinorBar<Value> a) {
340
return
a *=
b
;
341
}
342
343
template
<
typename
Value>
344
inline
LorentzSpinorBar<Value>
345
operator*(
const
LorentzSpinorBar<Value> & a,
Complex
b) {
346
return
LorentzSpinorBar<Value>(a.s1()*b, a.s2()*b, a.s3()*b, a.s4()*b,a.Type());
347
}
348
349
template
<
typename
ValueA,
typename
ValueB>
350
inline
auto
operator*(complex<ValueB> a,
const
LorentzSpinorBar<ValueA> & v)
351
-> LorentzSpinorBar<
decltype
(a.real()*
v
.s1().real())>
352
{
353
return
{a*
v
.s1(), a*
v
.s2(), a*
v
.s3(), a*
v
.s4(),
v
.Type()};
354
}
355
356
template
<
typename
ValueA,
typename
ValueB>
357
inline
auto
operator*(
const
LorentzSpinorBar<ValueA> & v, complex<ValueB> b)
358
-> LorentzSpinorBar<
decltype
(
b
.real()*
v
.s1().real())>
359
{
360
return
b
*
v
;
361
}
362
363
template
<
typename
ValueA,
typename
ValueB>
364
inline
auto
operator/(
const
LorentzSpinorBar<ValueA> & v, complex<ValueB> b)
365
-> LorentzSpinorBar<
decltype
(
v
.s1().real()/
b
.real())>
366
{
367
return
{
v
.s1()/
b
,
v
.s2()/
b
,
v
.s3()/
b
,
v
.s4()/
b
,
v
.Type()};
368
}
369
370
template
<
typename
ValueA,
typename
ValueB>
371
inline
auto
operator*(ValueB a,
const
LorentzSpinorBar<ValueA> & v)
372
-> LorentzSpinorBar<
decltype
(a*
v
.s1().real())>
373
{
374
return
{a*
v
.s1(), a*
v
.s2(), a*
v
.s3(), a*
v
.s4(),
v
.Type()};
375
}
376
377
template
<
typename
ValueA,
typename
ValueB>
378
inline
auto
operator*(
const
LorentzSpinorBar<ValueA> & v, ValueB b)
379
-> LorentzSpinorBar<
decltype
(
b
*
v
.s1().real())>
380
{
381
return
b
*
v
;
382
}
383
384
template
<
typename
ValueA,
typename
ValueB>
385
inline
auto
operator/(
const
LorentzSpinorBar<ValueA> & v, ValueB b)
386
-> LorentzSpinorBar<
decltype
(
v
.s1().real()/
b
)>
387
{
388
return
{
v
.s1()/
b
,
v
.s2()/
b
,
v
.s3()/
b
,
v
.s4()/
b
,
v
.Type()};
389
}
390
391
}
392
}
393
394
#ifndef ThePEG_TEMPLATES_IN_CC_FILE
395
#include "LorentzSpinorBar.tcc"
396
#endif
397
398
#endif
HelicityDefinitions.h
This file contains enumerations used by LorentzSpinor and LorentzSpinorBar classes.
ThePEG.h
This is the main config header file for ThePEG.
ThreeVector.h
contains the ThreeVector class.
ThePEG::Helicity::LorentzSpinorBar
The LorentzSpinorBar class implements the storage of a barred LorentzSpinor.
Definition:
LorentzSpinorBar.h:35
ThePEG::Helicity::LorentzSpinorBar::conjugate
LorentzSpinorBar conjugate() const
Return the conjugated spinor .
ThePEG::Helicity::LorentzSpinorBar::LorentzSpinorBar
LorentzSpinorBar(complex< Value > a, complex< Value > b, complex< Value > c, complex< Value > d, SpinorType t=SpinorType::unknown)
Constructor with complex numbers specifying the components, optionally specifying t,...
Definition:
LorentzSpinorBar.h:49
ThePEG::Helicity::LorentzSpinorBar::boost
LorentzSpinorBar & boost(double, double, double)
Standard Lorentz boost specifying the components of the beta vector.
ThePEG::Helicity::LorentzSpinorBar::boost
LorentzSpinorBar & boost(const Boost &)
Standard Lorentz boost specifying the beta vector.
ThePEG::Helicity::LorentzSpinorBar::operator()
complex< Value > & operator()(int i)
Set components by index.
Definition:
LorentzSpinorBar.h:81
ThePEG::Helicity::LorentzSpinorBar::s4
complex< Value > s4() const
Get fourth component.
Definition:
LorentzSpinorBar.h:112
ThePEG::Helicity::LorentzSpinorBar::Type
SpinorType Type() const
Return the type of the spinor.
Definition:
LorentzSpinorBar.h:203
ThePEG::Helicity::LorentzSpinorBar::LorentzSpinorBar
LorentzSpinorBar(SpinorType t=SpinorType::unknown)
Default zero constructor, optionally specifying t, the type.
Definition:
LorentzSpinorBar.h:43
ThePEG::Helicity::LorentzSpinorBar::transform
LorentzSpinorBar & transform(const SpinHalfLorentzRotation &)
General Lorentz transformation.
ThePEG::Helicity::LorentzSpinorBar::setS4
void setS4(complex< Value > in)
Set fourth component.
Definition:
LorentzSpinorBar.h:132
ThePEG::Helicity::LorentzSpinorBar::_spin
std::array< complex< Value >, 4 > _spin
Storage of the components.
Definition:
LorentzSpinorBar.h:298
ThePEG::Helicity::LorentzSpinorBar::s3
complex< Value > s3() const
Get third component.
Definition:
LorentzSpinorBar.h:107
ThePEG::Helicity::LorentzSpinorBar::setS3
void setS3(complex< Value > in)
Set third component.
Definition:
LorentzSpinorBar.h:127
ThePEG::Helicity::LorentzSpinorBar::operator[]
complex< Value > operator[](int i) const
Subscript operator to return spinor components.
Definition:
LorentzSpinorBar.h:65
ThePEG::Helicity::LorentzSpinorBar::s2
complex< Value > s2() const
Get second component.
Definition:
LorentzSpinorBar.h:102
ThePEG::Helicity::LorentzSpinorBar::setS1
void setS1(complex< Value > in)
Set first component.
Definition:
LorentzSpinorBar.h:117
ThePEG::Helicity::LorentzSpinorBar::helicityProjectionOperator
LorentzSpinorBar helicityProjectionOperator(const Complex &gL, const Complex &gR) const
Apply .
Definition:
LorentzSpinorBar.h:236
ThePEG::Helicity::LorentzSpinorBar::setS2
void setS2(complex< Value > in)
Set second component.
Definition:
LorentzSpinorBar.h:122
ThePEG::Helicity::LorentzSpinorBar::bar
LorentzSpinor< Value > bar() const
Return the barred spinor.
ThePEG::Helicity::LorentzSpinorBar::operator[]
complex< Value > & operator[](int i)
Set components by index.
Definition:
LorentzSpinorBar.h:89
ThePEG::Helicity::LorentzSpinorBar::projectionOperator
auto projectionOperator(const LorentzVector< ValueB > &p, const ValueB &m) const -> LorentzSpinorBar< decltype(m *Value())>
Apply .
Definition:
LorentzSpinorBar.h:214
ThePEG::Helicity::LorentzSpinorBar::s1
complex< Value > s1() const
Get first component.
Definition:
LorentzSpinorBar.h:97
ThePEG::Helicity::LorentzSpinorBar::slash
auto slash(const LorentzVector< complex< ValueB > > &p) const -> LorentzSpinor< decltype(ValueB() *Value())>
Apply .
Definition:
LorentzSpinorBar.h:272
ThePEG::Helicity::LorentzSpinorBar::slash
auto slash(const LorentzVector< ValueB > &p) const -> LorentzSpinorBar< decltype(p.t() *Value())>
Apply .
Definition:
LorentzSpinorBar.h:252
ThePEG::Helicity::LorentzSpinorBar::operator()
complex< Value > operator()(int i) const
Subscript operator to return spinor components.
Definition:
LorentzSpinorBar.h:73
ThePEG::Helicity::LorentzSpinorBar::transform
LorentzSpinorBar & transform(const LorentzRotation &r)
General Lorentz transformation.
Definition:
LorentzSpinorBar.h:192
ThePEG::Helicity::LorentzSpinorBar::_type
SpinorType _type
Type of spinor.
Definition:
LorentzSpinorBar.h:293
ThePEG::Helicity::LorentzSpinor
The LorentzSpinor class is designed to store a spinor.
Definition:
LorentzSpinor.h:71
ThePEG::LorentzRotation
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
Definition:
LorentzRotation.h:27
ThePEG::LorentzRotation::half
const SpinHalfLorentzRotation & half() const
The spin- transformation.
Definition:
LorentzRotation.h:197
ThePEG::LorentzVector
A 4-component Lorentz vector.
Definition:
LorentzVector.h:44
ThePEG::SpinHalfLorentzRotation
The SpinHalfLorentzRotation class is designed to offer the same features as the HepLorentzRotation cl...
Definition:
SpinHalfLorentzRotation.h:31
ThePEG::ThreeVector
A 3-component vector.
Definition:
ThreeVector.h:35
ThePEG::Helicity::SpinorType
SpinorType
Enumeration to specify spinor type.
Definition:
HelicityDefinitions.h:37
ThePEG::Helicity::SpinorType::v
@ v
v spinor.
ThePEG::Helicity::SpinorType::unknown
@ unknown
Undefined spinor type.
ThePEG::ParticleID::b
@ b
(b)
Definition:
EnumParticles.h:48
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::Complex
std::complex< double > Complex
ThePEG code should use Complex for all complex scalars.
Definition:
Complex.h:23
Generated on Thu Jun 20 2024 14:47:00 for ThePEG by
1.9.6