#include "METOOLS/Explicit/Lorentz_Calculator.H" #include "METOOLS/Currents/C_Spinor.H" #include "METOOLS/Currents/C_Vector.H" #include "METOOLS/Explicit/Vertex.H" #include "MODEL/Main/Single_Vertex.H" #include "ATOOLS/Org/Message.H" #include "ATOOLS/Org/Exception.H" using namespace ATOOLS; namespace METOOLS { template class FFV_Worker { public: typedef std::complex SComplex; typedef CSpinor CSpinorType; typedef CVec4 CVec4Type; inline SComplex PPlus(const CVec4 &p) const { return p[0]+p[ATOOLS::Spinor::R3()]; } inline SComplex PMinus(const CVec4 &p) const { return p[0]-p[ATOOLS::Spinor::R3()]; } inline SComplex PT(const CVec4 &p) const { return p[ATOOLS::Spinor::R1()]+ SComplex(0.0,1.0)*p[ATOOLS::Spinor::R2()]; } inline SComplex PTC(const CVec4 &p) const { return p[ATOOLS::Spinor::R1()]- SComplex(0.0,1.0)*p[ATOOLS::Spinor::R2()]; } inline bool CalcLeft(const CSpinorType &a, const CSpinorType &b) { return a.B()<0 ? a.On()&2 && b.On()&1 : a.On()&1 && b.On()&2; } inline bool CalcRight(const CSpinorType &a, const CSpinorType &b) { return a.B()<0 ? a.On()&1 && b.On()&2 : a.On()&2 && b.On()&1; } inline bool CalcLeft(const CSpinorType &a) { return a.B()<0 ? a.On()&2 : a.On()&1; } inline bool CalcRight(const CSpinorType &a) { return a.B()<0 ? a.On()&1 : a.On()&2; } CVec4 *LorentzLeft(const CSpinorType &a,const CSpinorType &b) { #ifdef DEBUG__BG msg_Debugging()<<"<> L "<::R3()]=(j01-j02); (*j)[Spinor::R1()]=(j11+j12); (*j)[Spinor::R2()]=SComplex(j112.imag(),-j112.real()); return j; } CVec4 *LorentzRight(const CSpinorType &a,const CSpinorType &b) { #ifdef DEBUG__BG msg_Debugging()<<"<> R "<::R3()]=(j01-j02); (*j)[Spinor::R1()]=(j11+j12); (*j)[Spinor::R2()]=SComplex(j112.imag(),-j112.real()); return j; } CVec4 *LorentzLeftRight(const CSpinorType &a,const CSpinorType &b) { #ifdef DEBUG__BG msg_Debugging()<<"<> LR "<::R3()]=(l01-l02)+(r01-r02); (*j)[Spinor::R1()]=(l11+l12)+(r11+r12); (*j)[Spinor::R2()]= SComplex(l112.imag(),-l112.real())+ SComplex(r112.imag(),-r112.real()); return j; } CSpinor *LorentzLeft(const CSpinorType &a,const CVec4Type &b) { switch (a.B()) { case -1: { #ifdef DEBUG__BG msg_Debugging()<<"<|g L "< L "< *LorentzRight(const CSpinorType &a,const CVec4Type &b) { switch (a.B()) { case -1: { #ifdef DEBUG__BG msg_Debugging()<<"<|g R "< R "< *LorentzLeftRight(const CSpinorType &a,const CVec4Type &b) { switch (a.B()) { case -1: { #ifdef DEBUG__BG msg_Debugging()<<"<|g LR "< LR "<; template class FFV_Calculator: public Lorentz_Calculator, public FFV_Worker { public: typedef CSpinor CSpinorType; typedef CVec4 CVec4Type; FFV_Calculator(const Vertex_Key &key): Lorentz_Calculator(key) {} std::string Label() const { return "FFV"; } CObject *Evaluate(const CObject_Vector &jj) { if (p_v->V()->id.back()==2) { CSpinorType *a(jj[1]->Get()); CSpinorType *b(jj[0]->Get()); bool cl(this->CalcLeft(*a,*b)), cr(this->CalcRight(*a,*b)); if (!(cl || cr)) return NULL; CVec4Type *j(NULL); if (cl && cr) j=this->LorentzLeftRight(*a,*b); else if (cl) j=this->LorentzLeft(*a,*b); else if (cr) j=this->LorentzRight(*a,*b); return j; } const CSpinorType &a(*jj[p_v->V()->id.back()]->Get()); const CVec4Type &b(*jj[1-p_v->V()->id.back()]->Get()); bool cl(this->CalcLeft(a)), cr(this->CalcRight(a)); if (!(cl || cr)) return NULL; CSpinorType *j(NULL); if (cl && cr) j=this->LorentzLeftRight(a,b); else if (cl) j=this->LorentzLeft(a,b); else if (cr) j=this->LorentzRight(a,b); return j; } };// end of class FFV_Calculator template class FFV_Calculator; template class FFVL_Calculator: public Lorentz_Calculator, public FFV_Worker { public: typedef CSpinor CSpinorType; typedef CVec4 CVec4Type; FFVL_Calculator(const Vertex_Key &key): Lorentz_Calculator(key) {} std::string Label() const { return "FFVL"; } CObject *Evaluate(const CObject_Vector &jj) { if (p_v->V()->id.back()==2) { CSpinorType *a(jj[1]->Get()); CSpinorType *b(jj[0]->Get()); if (!this->CalcLeft(*a,*b)) return NULL; return this->LorentzLeft(*a,*b); } const CSpinorType &a(*jj[p_v->V()->id.back()]->Get()); const CVec4Type &b(*jj[1-p_v->V()->id.back()]->Get()); if (!this->CalcLeft(a)) return NULL; return this->LorentzLeft(a,b); } };// end of class FFVL_Calculator template class FFVL_Calculator; template class FFVR_Calculator: public Lorentz_Calculator, public FFV_Worker { public: typedef CSpinor CSpinorType; typedef CVec4 CVec4Type; FFVR_Calculator(const Vertex_Key &key): Lorentz_Calculator(key) {} std::string Label() const { return "FFVR"; } CObject *Evaluate(const CObject_Vector &jj) { if (p_v->V()->id.back()==2) { CSpinorType *a(jj[1]->Get()); CSpinorType *b(jj[0]->Get()); if (!this->CalcRight(*a,*b)) return NULL; return this->LorentzRight(*a,*b); } const CSpinorType &a(*jj[p_v->V()->id.back()]->Get()); const CVec4Type &b(*jj[1-p_v->V()->id.back()]->Get()); if (!this->CalcRight(a)) return NULL; return this->LorentzRight(a,b); } };// end of class FFVR_Calculator template class FFVR_Calculator; }// end of namespace METOOLS using namespace METOOLS; DECLARE_GETTER(FFV_Calculator,"DFFV", Lorentz_Calculator,Vertex_Key); Lorentz_Calculator *ATOOLS::Getter >:: operator()(const Vertex_Key &key) const { return new FFV_Calculator(key); } void ATOOLS::Getter >:: PrintInfo(std::ostream &str,const size_t width) const { str<<"FFV vertex"; } DECLARE_GETTER(FFVL_Calculator,"DFFVL", Lorentz_Calculator,Vertex_Key); Lorentz_Calculator *ATOOLS::Getter >:: operator()(const Vertex_Key &key) const { return new FFVL_Calculator(key); } void ATOOLS::Getter >:: PrintInfo(std::ostream &str,const size_t width) const { str<<"FFVL vertex"; } DECLARE_GETTER(FFVR_Calculator,"DFFVR", Lorentz_Calculator,Vertex_Key); Lorentz_Calculator *ATOOLS::Getter >:: operator()(const Vertex_Key &key) const { return new FFVR_Calculator(key); } void ATOOLS::Getter >:: PrintInfo(std::ostream &str,const size_t width) const { str<<"FFVR vertex"; }