diff --git a/Helicity/LorentzSpinorBar.h b/Helicity/LorentzSpinorBar.h --- a/Helicity/LorentzSpinorBar.h +++ b/Helicity/LorentzSpinorBar.h @@ -1,235 +1,235 @@ // -*- C++ -*- // // LorentzSpinorBar.h is a part of ThePEG - Toolkit for HEP Event Generation // Copyright (C) 2003-2017 Peter Richardson, Leif Lonnblad // // ThePEG is licenced under version 3 of the GPL, see COPYING for details. // Please respect the MCnet academic guidelines, see GUIDELINES for details. // #ifndef ThePEG_LorentzSpinorBar_H #define ThePEG_LorentzSpinorBar_H // This is the declaration of the LorentzSpinorBar class. #include "ThePEG/Config/ThePEG.h" #include "ThePEG/Vectors/LorentzRotation.h" #include "ThePEG/Vectors/ThreeVector.h" #include "HelicityDefinitions.h" #include "LorentzSpinor.fh" #include "LorentzSpinorBar.fh" namespace ThePEG { namespace Helicity { /** * The LorentzSpinorBar class implements the storage of a barred * LorentzSpinor. The design is based on that of the LorentzSpinor * class where the details of the implemented are discussed in more * detail. * * @see LorentzSpinor * * @author Peter Richardson */ template class LorentzSpinorBar { public: /** @name Standard constructors. */ //@{ /** * Default zero constructor, optionally specifying \a t, the type */ LorentzSpinorBar(SpinorType t = SpinorType::unknown) : _type(t), _spin() {} /** * Constructor with complex numbers specifying the components, * optionally specifying \a t, the type */ LorentzSpinorBar(complex a, complex b, complex c, complex d, SpinorType t = SpinorType::unknown) : _type(t), _spin{{a,b,c,d}} {} //@} /** @name Access the components. */ //@{ /** * Subscript operator to return spinor components */ complex operator[](int i) const { assert( i>= 0 && i <= 3 ); return _spin[i]; } /** * Subscript operator to return spinor components */ complex operator()(int i) const { assert( i>= 0 && i <= 3 ); return _spin[i]; } /** * Set components by index. */ complex & operator()(int i) { assert( i>= 0 && i <= 3 ); return _spin[i]; } /** * Set components by index. */ complex & operator[](int i) { assert( i>= 0 && i <= 3 ); return _spin[i]; } /** * Get first component. */ complex s1() const {return _spin[0];} /** * Get second component. */ complex s2() const {return _spin[1];} /** * Get third component. */ complex s3() const {return _spin[2];} /** * Get fourth component. */ complex s4() const {return _spin[3];} /** * Set first component. */ void setS1(complex in) {_spin[0]=in;} /** * Set second component. */ void setS2(complex in) {_spin[1]=in;} /** * Set third component. */ void setS3(complex in) {_spin[2]=in;} /** * Set fourth component. */ void setS4(complex in) {_spin[3]=in;} //@} /** @name Transformations. */ //@{ /** * Return the barred spinor */ LorentzSpinor bar() const; /** * Return the conjugated spinor \f$u_c=C\bar{u}^T\f$. This operation * transforms u-spinors to v-spinors and vice-versa and is required when * dealing with majorana particles. */ LorentzSpinorBar conjugate() const; /** * Standard Lorentz boost specifying the components of the beta vector. */ LorentzSpinorBar & boost(double,double,double); /** * Standard Lorentz boost specifying the beta vector. */ LorentzSpinorBar & boost(const Boost &); /** * General Lorentz transformation */ LorentzSpinorBar & transform(const SpinHalfLorentzRotation &) ; /** * General Lorentz transformation */ LorentzSpinorBar & transform(const LorentzRotation & r) { transform(r.half()); return *this; } //@} /** @name Functions related to type. */ //@{ /** * Return the type of the spinor. */ SpinorType Type() const {return _type;} //@} /** * @name Functions to apply the projection operator */ //@{ /** * Apply \f$p\!\!\!\!\!\not\,\,\,+m\f$ */ template auto projectionOperator(const LorentzVector & p, const ValueB & m) const - -> LorentzSpinorBar + -> LorentzSpinorBar { - typedef decltype(m*s1()) ResultT; + typedef decltype(m*Value()) ResultT; LorentzSpinorBar spin; static const Complex ii(0.,1.); complex p0pp3=p.t()+p.z(); complex p0mp3=p.t()-p.z(); complex p1pp2=p.x()+ii*p.y(); complex p1mp2=p.x()-ii*p.y(); spin.setS1(m*s1()+p0pp3*s3()+p1pp2*s4()); spin.setS2(m*s2()+p0mp3*s4()+p1mp2*s3()); spin.setS3(m*s3()+p0mp3*s1()-p1pp2*s2()); spin.setS4(m*s4()+p0pp3*s2()-p1mp2*s1()); return spin; } /** * Apply \f$g^LP_L+g^RP_R\f$ */ LorentzSpinorBar helicityProjectionOperator(const Complex & gL, const Complex & gR) const { LorentzSpinorBar spin; spin.setS1(gL*s1()); spin.setS2(gL*s2()); spin.setS3(gR*s3()); spin.setS4(gR*s4()); return spin; } //@} private: /** * Type of spinor */ SpinorType _type; /** * Storage of the components. */ std::array,4> _spin; }; } } #ifndef ThePEG_TEMPLATES_IN_CC_FILE #include "LorentzSpinorBar.tcc" #endif #endif