thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.2.1
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
246
private
:
250
SpinorType
_type
;
251
255
std::array<complex<Value>,4>
_spin
;
256
};
257
259
260
template
<
typename
Value>
261
inline
LorentzSpinorBar<double>
262
operator/(
const
LorentzSpinorBar<Value>
&
v
, Value a) {
263
return
LorentzSpinorBar<double>
(v.
s1
()/a, v.
s2
()/a, v.
s3
()/a, v.
s4
()/a,v.
Type
());
264
}
265
266
inline
LorentzSpinorBar<double>
267
operator/(
const
LorentzSpinorBar<double>
&
v
,
Complex
a) {
268
return
LorentzSpinorBar<double>
(v.
s1
()/a, v.
s2
()/a, v.
s3
()/a, v.
s4
()/a,v.
Type
());
269
}
270
271
template
<
typename
Value>
272
inline
LorentzSpinorBar<Value>
operator-(
const
LorentzSpinorBar<Value>
& v) {
273
return
LorentzSpinorBar<Value>
(-v.
s1
(),-v.
s2
(),-v.
s3
(),-v.
s4
(),v.
Type
());
274
}
275
276
template
<
typename
ValueA,
typename
ValueB>
277
inline
LorentzSpinorBar<ValueA>
278
operator+(
LorentzSpinorBar<ValueA>
a,
const
LorentzSpinorBar<ValueB>
& b) {
279
return
a += b;
280
}
281
282
template
<
typename
ValueA,
typename
ValueB>
283
inline
LorentzSpinorBar<ValueA>
284
operator-(
LorentzSpinorBar<ValueA>
a,
const
LorentzSpinorBar<ValueB>
& b) {
285
return
a -= b;
286
}
287
288
template
<
typename
Value>
289
inline
LorentzSpinorBar<Value>
290
operator*(
const
LorentzSpinorBar<Value>
& a,
double
b) {
291
return
LorentzSpinorBar<Value>
(a.
s1
()*b, a.
s2
()*b, a.
s3
()*b, a.
s4
()*b,a.
Type
());
292
}
293
294
template
<
typename
Value>
295
inline
LorentzSpinorBar<Value>
296
operator*(
double
b,
LorentzSpinorBar<Value>
a) {
297
return
a *= b;
298
}
299
300
template
<
typename
Value>
301
inline
LorentzSpinorBar<Value>
302
operator*(
const
LorentzSpinorBar<Value>
& a,
Complex
b) {
303
return
LorentzSpinorBar<Value>
(a.
s1
()*b, a.
s2
()*b, a.
s3
()*b, a.
s4
()*b,a.
Type
());
304
}
305
306
template
<
typename
ValueA,
typename
ValueB>
307
inline
auto
operator*(complex<ValueB> a,
const
LorentzSpinorBar<ValueA>
& v)
308
->
LorentzSpinorBar
<decltype(a.real()*v.
s1
().real())>
309
{
310
return
{a*v.
s1
(), a*v.
s2
(), a*v.
s3
(), a*v.
s4
(),v.
Type
()};
311
}
312
313
template
<
typename
ValueA,
typename
ValueB>
314
inline
auto
operator*(
const
LorentzSpinorBar<ValueA>
& v, complex<ValueB> b)
315
->
LorentzSpinorBar
<decltype(b.real()*v.
s1
().real())>
316
{
317
return
b*
v
;
318
}
319
320
template
<
typename
ValueA,
typename
ValueB>
321
inline
auto
operator/(
const
LorentzSpinorBar<ValueA>
& v, complex<ValueB> b)
322
->
LorentzSpinorBar
<decltype(v.
s1
().real()/b.real())>
323
{
324
return
{v.
s1
()/b, v.
s2
()/b, v.
s3
()/b, v.
s4
()/b,v.
Type
()};
325
}
326
327
template
<
typename
ValueA,
typename
ValueB>
328
inline
auto
operator*(ValueB a,
const
LorentzSpinorBar<ValueA>
& v)
329
->
LorentzSpinorBar
<decltype(a*v.
s1
().real())>
330
{
331
return
{a*v.
s1
(), a*v.
s2
(), a*v.
s3
(), a*v.
s4
(),v.
Type
()};
332
}
333
334
template
<
typename
ValueA,
typename
ValueB>
335
inline
auto
operator*(
const
LorentzSpinorBar<ValueA>
& v, ValueB b)
336
->
LorentzSpinorBar
<decltype(b*v.
s1
().real())>
337
{
338
return
b*
v
;
339
}
340
341
template
<
typename
ValueA,
typename
ValueB>
342
inline
auto
operator/(
const
LorentzSpinorBar<ValueA>
& v, ValueB b)
343
->
LorentzSpinorBar
<decltype(v.
s1
().real()/b)>
344
{
345
return
{v.
s1
()/b, v.
s2
()/b, v.
s3
()/b, v.
s4
()/b,v.
Type
()};
346
}
347
348
}
349
}
350
351
#ifndef ThePEG_TEMPLATES_IN_CC_FILE
352
#include "LorentzSpinorBar.tcc"
353
#endif
354
355
#endif
ThePEG::LorentzVector
A 4-component Lorentz vector.
Definition:
LorentzVector.h:35
ThePEG::Complex
std::complex< double > Complex
ThePEG code should use Complex for all complex scalars.
Definition:
Complex.h:23
ThePEG::Helicity::LorentzSpinorBar::boost
LorentzSpinorBar & boost(double, double, double)
Standard Lorentz boost specifying the components of the beta vector.
ThePEG::Helicity::LorentzSpinorBar::transform
LorentzSpinorBar & transform(const SpinHalfLorentzRotation &)
General Lorentz transformation.
HelicityDefinitions.h
This file contains enumerations used by LorentzSpinor and LorentzSpinorBar classes.
ThePEG::ThreeVector
A 3-component vector.
Definition:
ThreeVector.h:34
ThePEG::Helicity::LorentzSpinorBar::helicityProjectionOperator
LorentzSpinorBar helicityProjectionOperator(const Complex &gL, const Complex &gR) const
Apply .
Definition:
LorentzSpinorBar.h:236
ThePEG::LorentzRotation
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
Definition:
LorentzRotation.h:27
ThePEG::Helicity::LorentzSpinorBar::s3
complex< Value > s3() const
Get third component.
Definition:
LorentzSpinorBar.h:107
ThePEG::Helicity::LorentzSpinorBar::operator[]
complex< Value > & operator[](int i)
Set components by index.
Definition:
LorentzSpinorBar.h:89
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::Helicity::LorentzSpinorBar::setS4
void setS4(complex< Value > in)
Set fourth component.
Definition:
LorentzSpinorBar.h:132
ThePEG.h
This is the main config header file for ThePEG.
ThePEG::Helicity::LorentzSpinorBar::bar
LorentzSpinor< Value > bar() const
Return the barred spinor.
ThePEG::Helicity::LorentzSpinor
The LorentzSpinor class is designed to store a spinor.
Definition:
LorentzSpinor.h:71
ThePEG::LorentzRotation::half
const SpinHalfLorentzRotation & half() const
The spin- transformation.
Definition:
LorentzRotation.h:197
ThePEG::Helicity::LorentzSpinorBar::operator()
complex< Value > & operator()(int i)
Set components by index.
Definition:
LorentzSpinorBar.h:81
ThePEG::Helicity::LorentzSpinorBar::operator()
complex< Value > operator()(int i) const
Subscript operator to return spinor components.
Definition:
LorentzSpinorBar.h:73
ThePEG::Helicity::LorentzSpinorBar::s1
complex< Value > s1() const
Get first component.
Definition:
LorentzSpinorBar.h:97
ThePEG::Helicity::LorentzSpinorBar::setS3
void setS3(complex< Value > in)
Set third component.
Definition:
LorentzSpinorBar.h:127
ThePEG::Helicity::LorentzSpinorBar::s2
complex< Value > s2() const
Get second component.
Definition:
LorentzSpinorBar.h:102
ThePEG::Helicity::LorentzSpinorBar::setS2
void setS2(complex< Value > in)
Set second component.
Definition:
LorentzSpinorBar.h:122
ThePEG::Helicity::SpinorType::unknown
Undefined spinor type.
ThePEG::Helicity::LorentzSpinorBar::LorentzSpinorBar
LorentzSpinorBar(SpinorType t=SpinorType::unknown)
Default zero constructor, optionally specifying t, the type.
Definition:
LorentzSpinorBar.h:43
ThePEG::Helicity::LorentzSpinorBar::Type
SpinorType Type() const
Return the type of the spinor.
Definition:
LorentzSpinorBar.h:203
ThePEG::Helicity::LorentzSpinorBar::operator[]
complex< Value > operator[](int i) const
Subscript operator to return spinor components.
Definition:
LorentzSpinorBar.h:65
ThePEG::Helicity::LorentzSpinorBar::projectionOperator
auto projectionOperator(const LorentzVector< ValueB > &p, const ValueB &m) const -> LorentzSpinorBar< decltype(m *Value())>
Apply .
Definition:
LorentzSpinorBar.h:214
ThreeVector.h
contains the ThreeVector class.
ThePEG::Helicity::SpinorType
SpinorType
Enumeration to specify spinor type.
Definition:
HelicityDefinitions.h:37
ThePEG::Helicity::LorentzSpinorBar::setS1
void setS1(complex< Value > in)
Set first component.
Definition:
LorentzSpinorBar.h:117
ThePEG::Helicity::LorentzSpinorBar::s4
complex< Value > s4() const
Get fourth component.
Definition:
LorentzSpinorBar.h:112
ThePEG::Helicity::SpinorType::v
v spinor.
ThePEG::Helicity::LorentzSpinorBar::conjugate
LorentzSpinorBar conjugate() const
Return the conjugated spinor .
ThePEG::SpinHalfLorentzRotation
The SpinHalfLorentzRotation class is designed to offer the same features as the HepLorentzRotation cl...
Definition:
SpinHalfLorentzRotation.h:31
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::_type
SpinorType _type
Type of spinor.
Definition:
LorentzSpinorBar.h:250
ThePEG::Helicity::LorentzSpinorBar::transform
LorentzSpinorBar & transform(const LorentzRotation &r)
General Lorentz transformation.
Definition:
LorentzSpinorBar.h:192
ThePEG::Helicity::LorentzSpinorBar
The LorentzSpinorBar class implements the storage of a barred LorentzSpinor.
Definition:
LorentzSpinorBar.h:35
ThePEG::Helicity::LorentzSpinorBar::_spin
std::array< complex< Value >, 4 > _spin
Storage of the components.
Definition:
LorentzSpinorBar.h:255
Generated on Sat Apr 11 2020 14:31:17 for ThePEG by
1.8.13