00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ThePEG_LorentzSpinor_H
00010 #define ThePEG_LorentzSpinor_H
00011
00012 #include "ThePEG/Config/ThePEG.h"
00013 #include "ThePEG/Vectors/LorentzRotation.h"
00014 #include "ThePEG/Vectors/ThreeVector.h"
00015 #include "HelicityDefinitions.h"
00016 #include "LorentzSpinor.fh"
00017 #include "LorentzSpinorBar.h"
00018 #include "LorentzPolarizationVector.h"
00019
00020 namespace ThePEG{
00021 namespace Helicity{
00022
00068 template<typename Value>
00069 class LorentzSpinor {
00070 public:
00071
00077 LorentzSpinor(SpinorType t = unknown_spinortype) : _type(t) {
00078 for(unsigned int ix=0;ix<4;++ix) _spin[ix]=Value();
00079 }
00080
00085 LorentzSpinor(complex<Value> a,complex<Value> b,
00086 complex<Value> c,complex<Value> d,
00087 SpinorType s = unknown_spinortype) : _type(s) {
00088 _spin[0]=a;
00089 _spin[1]=b;
00090 _spin[2]=c;
00091 _spin[3]=d;
00092 }
00094
00100 complex<Value> operator[](int i) const {
00101 assert( i >= 0 && i <= 3 );
00102 return _spin[i];
00103 }
00104
00108 complex<Value> operator()(int i) const {
00109 assert( i >= 0 && i <= 3 );
00110 return _spin[i];
00111 }
00112
00116 complex<Value> & operator()(int i) {
00117 assert( i >= 0 && i <= 3 );
00118 return _spin[i];
00119 }
00120
00124 complex<Value> & operator[](int i) {
00125 assert( i >= 0 && i <= 3 );
00126 return _spin[i];
00127 }
00128
00132 complex<Value> s1() const {return _spin[0];}
00133
00137 complex<Value> s2() const {return _spin[1];}
00138
00142 complex<Value> s3() const {return _spin[2];}
00143
00147 complex<Value> s4() const {return _spin[3];}
00148
00152 void setS1(complex<Value> in) {_spin[0]=in;}
00153
00157 void setS2(complex<Value> in) {_spin[1]=in;}
00158
00162 void setS3(complex<Value> in) {_spin[2]=in;}
00163
00167 void setS4(complex<Value> in) {_spin[3]=in;}
00169
00175 LorentzSpinorBar<Value> bar() const;
00176
00182 LorentzSpinor conjugate() const;
00183
00187 LorentzSpinor & boost(double,double,double);
00188
00192 LorentzSpinor & boost(const Boost &);
00193
00197 LorentzSpinor & transform(const SpinHalfLorentzRotation & );
00198
00202 LorentzSpinor & transform(const LorentzRotation & r) {
00203 transform(r.half());
00204 return *this;
00205 }
00207
00213 SpinorType Type() const {return _type;}
00215
00216
00223 template<typename ValueB>
00224 LorentzVector<complex<typename BinaryOpTraits<Value,ValueB>::MulT> >
00225 leftCurrent(const LorentzSpinorBar<ValueB>& fb) const {
00226 typedef complex<typename BinaryOpTraits<Value,ValueB>::MulT> ResultT;
00227 LorentzVector<ResultT> vec;
00228 Complex ii(0.,1.);
00229 ResultT p1(fb.s3()*s2()),p2(fb.s4()*s1());
00230 vec.setX( -(p1+p2) );
00231 vec.setY( ii*(p1-p2) );
00232 p1 = fb.s3()*s1();p2 = fb.s4()*s2();
00233 vec.setZ( -(p1-p2) );
00234 vec.setT( (p1+p2) );
00235 return vec;
00236 }
00237
00242 template<typename ValueB>
00243 LorentzVector<complex<typename BinaryOpTraits<Value,ValueB>::MulT> >
00244 rightCurrent(const LorentzSpinorBar<ValueB>& fb) const {
00245 typedef complex<typename BinaryOpTraits<Value,ValueB>::MulT> ResultT;
00246 LorentzVector<ResultT> vec;
00247 Complex ii(0.,1.);
00248 ResultT p1(fb.s1()*s4()),p2(fb.s2()*s3());
00249 vec.setX( (p1+p2));
00250 vec.setY( -ii*(p1-p2));
00251 p1 = fb.s1()*s3();p2 = fb.s2()*s4();
00252 vec.setZ( (p1-p2));
00253 vec.setT( (p1+p2));
00254 return vec;
00255 }
00256
00261 template<typename ValueB>
00262 LorentzVector<complex<typename BinaryOpTraits<Value,ValueB>::MulT> >
00263 vectorCurrent(const LorentzSpinorBar<ValueB>& fb) const {
00264 typedef complex<typename BinaryOpTraits<Value,ValueB>::MulT> ResultT;
00265 LorentzVector<ResultT> vec;
00266 Complex ii(0.,1.);
00267 ResultT s1s4(fb.s1()*s4()),s2s3(fb.s2()*s3()),
00268 s3s2(fb.s3()*s2()),s4s1(fb.s4()*s1()),
00269 s1s3(fb.s1()*s3()),s2s4(fb.s2()*s4()),
00270 s3s1(fb.s3()*s1()),s4s2(fb.s4()*s2());
00271 vec.setX( s1s4+s2s3-s3s2-s4s1 );
00272 vec.setY( -ii*(s1s4-s2s3-s3s2+s4s1));
00273 vec.setZ( s1s3-s2s4-s3s1+s4s2 );
00274 vec.setT( s1s3+s2s4+s3s1+s4s2);
00275 return vec;
00276 }
00277
00285 template<typename ValueB>
00286 LorentzVector<complex<typename BinaryOpTraits<Value,ValueB>::MulT> >
00287 generalCurrent(const LorentzSpinorBar<ValueB>& fb,
00288 Complex left, Complex right) const {
00289 typedef complex<typename BinaryOpTraits<Value,ValueB>::MulT> ResultT;
00290 LorentzVector<ResultT> vec;
00291 Complex ii(0.,1.);
00292 ResultT p1(fb.s3()*s2()),p2(fb.s4()*s1());
00293 vec.setX( -left*(p1+p2));
00294 vec.setY( ii*left*(p1-p2));
00295 p1 = fb.s3()*s1();p2 = fb.s4()*s2();
00296 vec.setZ( -left*(p1-p2));
00297 vec.setT( left*(p1+p2));
00298 p1=fb.s1()*s4();p2=fb.s2()*s3();
00299 vec.setX(vec.x()+right*(p1+p2));
00300 vec.setY(vec.y()-ii*right*(p1-p2));
00301 p1 = fb.s1()*s3();p2 = fb.s2()*s4();
00302 vec.setZ(vec.z()+right*(p1-p2));
00303 vec.setT(vec.t()+right*(p1+p2));
00304 return vec;
00305 }
00307
00314 template<typename ValueB>
00315 complex<typename BinaryOpTraits<Value,ValueB>::MulT>
00316 leftScalar(const LorentzSpinorBar<ValueB>& fb) const {
00317 return fb.s1()*s1()+fb.s2()*s2();
00318 }
00319
00324 template<typename ValueB>
00325 complex<typename BinaryOpTraits<Value,ValueB>::MulT>
00326 rightScalar(const LorentzSpinorBar<ValueB>& fb) const {
00327 return fb.s3()*s3()+fb.s4()*s4();
00328 }
00329
00334 template<typename ValueB>
00335 complex<typename BinaryOpTraits<Value,ValueB>::MulT>
00336 scalar(const LorentzSpinorBar<ValueB>& fb) const {
00337 return fb.s1()*s1()+fb.s2()*s2()+fb.s3()*s3()+fb.s4()*s4();
00338 }
00339
00344 template<typename ValueB>
00345 complex<typename BinaryOpTraits<Value,ValueB>::MulT>
00346 pseudoScalar(const LorentzSpinorBar<ValueB>& fb) const {
00347 return -fb.s1()*s1()-fb.s2()*s2()+fb.s3()*s3()+fb.s4()*s4();
00348 }
00349
00357 template<typename ValueB>
00358 complex<typename BinaryOpTraits<Value,ValueB>::MulT>
00359 generalScalar(const LorentzSpinorBar<ValueB>& fb,
00360 Complex left, Complex right) const {
00361 return left*(fb.s1()*s1()+fb.s2()*s2())
00362 + right*(fb.s3()*s3()+fb.s4()*s4());
00363 }
00365
00366 private:
00370 SpinorType _type;
00371
00375 complex<Value> _spin[4];
00376 };
00377
00378 }
00379 }
00380
00381 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
00382 #include "LorentzSpinor.tcc"
00383 #endif
00384
00385 #endif
00386