ThePEG  1.8.0
LorentzSpinorBar.h
1 // -*- C++ -*-
2 //
3 // LorentzSpinorBar.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 2003-2011 Peter Richardson, Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 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>
36 public:
37 
44  for(unsigned int ix=0;ix<4;++ix) _spin[ix]=Value();
45  }
46 
51  LorentzSpinorBar(complex<Value> a, complex<Value> b,
52  complex<Value> c, complex<Value> d,
54  : _type(t) {
55  _spin[0]=a;
56  _spin[1]=b;
57  _spin[2]=c;
58  _spin[3]=d;
59  }
61 
67  complex<Value> operator[](int i) const {
68  assert( i>= 0 && i <= 3 );
69  return _spin[i];
70  }
71 
75  complex<Value> operator()(int i) const {
76  assert( i>= 0 && i <= 3 );
77  return _spin[i];
78  }
79 
83  complex<Value> & operator()(int i) {
84  assert( i>= 0 && i <= 3 );
85  return _spin[i];
86  }
87 
91  complex<Value> & operator[](int i) {
92  assert( i>= 0 && i <= 3 );
93  return _spin[i];
94  }
95 
99  complex<Value> s1() const {return _spin[0];}
100 
104  complex<Value> s2() const {return _spin[1];}
105 
109  complex<Value> s3() const {return _spin[2];}
110 
114  complex<Value> s4() const {return _spin[3];}
115 
119  void setS1(complex<Value> in) {_spin[0]=in;}
120 
124  void setS2(complex<Value> in) {_spin[1]=in;}
125 
129  void setS3(complex<Value> in) {_spin[2]=in;}
130 
134  void setS4(complex<Value> in) {_spin[3]=in;}
136 
142  LorentzSpinor<Value> bar() const;
143 
149  LorentzSpinorBar conjugate() const;
150 
154  LorentzSpinorBar & boost(double,double,double);
155 
159  LorentzSpinorBar & boost(const Boost &);
160 
165 
170  transform(r.half());
171  return *this;
172  }
174 
180  SpinorType Type() const {return _type;}
182 
183 private:
188 
192  complex<Value> _spin[4];
193 };
194 
195 }
196 }
197 
198 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
199 #include "LorentzSpinorBar.tcc"
200 #endif
201 
202 #endif