Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/ThePEG/Helicity/LorentzSpinor.tcc is written in an unsupported language. File is not indexed.

0001 // -*- C++ -*-
0002 //
0003 // LorentzSpinor.tcc is a part of ThePEG - Toolkit for HEP Event Generation
0004 // Copyright (C) 2003-2019 Peter Richardson, Leif Lonnblad
0005 //
0006 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 //
0010 // This is the implementation of the non-inlined member
0011 // functions of the LorentzSpinor class.
0012 //
0013 // Author: Peter Richardson
0014 //
0015 
0016 #include "LorentzSpinor.h"
0017 #include "LorentzSpinorBar.h"
0018 
0019 using namespace ThePEG;
0020 using namespace ThePEG::Helicity;
0021 
0022 // return the barred spinor
0023 template <typename Value>
0024 LorentzSpinorBar<Value> LorentzSpinor<Value>::bar() const
0025 {
0026   complex<Value> output[4];
0027   // HELAS
0028   output[0] = conj(_spin[2]);
0029   output[1] = conj(_spin[3]);
0030   output[2] = conj(_spin[0]);
0031   output[3] = conj(_spin[1]);
0032   return LorentzSpinorBar<Value>(output[0],output[1],output[2],output[3],_type);
0033 }
0034 
0035 // boost the spinor
0036 template <typename Value>
0037 LorentzSpinor<Value> & LorentzSpinor<Value>::boost(double bx,double by,double bz)
0038 {
0039   // work out beta and chi
0040   double beta=sqrt(bx*bx+by*by+bz*bz);
0041   double chi = atanh(beta);
0042   double sinhchi = sinh(0.5*chi)/beta, coshchi = cosh(0.5*chi);
0043   // calculate the new spinor
0044   complex<Value> out[4];
0045   Complex ii(0.,1.);
0046   Complex nxminy=bx-ii*by;
0047   Complex nxpiny=bx+ii*by;
0048   out[0] = coshchi*_spin[0]+sinhchi*(-bz*_spin[0]-nxminy*_spin[1]);
0049   out[1] = coshchi*_spin[1]+sinhchi*(+bz*_spin[1]-nxpiny*_spin[0]);
0050   out[2] = coshchi*_spin[2]+sinhchi*(+bz*_spin[2]+nxminy*_spin[3]);
0051   out[3] = coshchi*_spin[3]+sinhchi*(-bz*_spin[3]+nxpiny*_spin[2]);
0052   for(unsigned int ix=0;ix<4;++ix) _spin[ix]=out[ix];
0053   return *this;
0054 }
0055 
0056 // boost the spinor
0057 template <typename Value>
0058 LorentzSpinor<Value> & LorentzSpinor<Value>::boost(const Boost & boostv)
0059 {
0060   double beta = boostv.mag();
0061   double bx=boostv.x(),by=boostv.y(),bz=boostv.z();
0062   double chi = atanh(beta);
0063   double sinhchi = sinh(0.5*chi)/beta, coshchi = cosh(0.5*chi);
0064   complex<Value> out[4];
0065   Complex ii(0.,1.);
0066   Complex nxminy=bx-ii*by;
0067   Complex nxpiny=bx+ii*by;
0068   out[0] = coshchi*_spin[0]+sinhchi*(-bz*_spin[0]-nxminy*_spin[1]);
0069   out[1] = coshchi*_spin[1]+sinhchi*(+bz*_spin[1]-nxpiny*_spin[0]);
0070   out[2] = coshchi*_spin[2]+sinhchi*(+bz*_spin[2]+nxminy*_spin[3]);
0071   out[3] = coshchi*_spin[3]+sinhchi*(-bz*_spin[3]+nxpiny*_spin[2]);
0072   for(unsigned int ix=0;ix<4;++ix) _spin[ix]=out[ix];
0073   return *this;
0074 }
0075 
0076 // general transform
0077 template <typename Value>
0078 LorentzSpinor<Value> & LorentzSpinor<Value>::
0079 transform(const SpinHalfLorentzRotation & r) {
0080   unsigned int ix,iy;
0081   complex<Value> out[4];
0082   for(ix=0;ix<4;++ix) {
0083     out[ix]=complex<Value>();
0084     for(iy=0;iy<4;++iy) out[ix]+=r(ix,iy)*_spin[iy];
0085   }
0086   for(ix=0;ix<4;++ix) _spin[ix]=out[ix];
0087   return *this;
0088 }
0089 
0090 
0091 // conjugation
0092 template <typename Value>
0093 LorentzSpinor<Value> LorentzSpinor<Value>::conjugate() const {
0094   SpinorType new_type;
0095   switch(_type) {
0096   case SpinorType::u:
0097     new_type=SpinorType::v;
0098     break;
0099   case SpinorType::v:
0100     new_type=SpinorType::u;
0101     break;
0102   case SpinorType::unknown:
0103   default:
0104     new_type=SpinorType::unknown;
0105     break;
0106   }
0107   return LorentzSpinor<Value>( conj(_spin[3]),
0108                               -conj(_spin[2]),
0109                               -conj(_spin[1]),
0110                               +conj(_spin[0]),
0111                                new_type);
0112 }