#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 TauPi_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 TauPi_Calculator: public Lorentz_Calculator, public TauPi_Worker { public: typedef CSpinor CSpinorType; typedef CVec4 CVec4Type; TauPi_Calculator(const Vertex_Key &key): Lorentz_Calculator(key) {} std::string Label() const { return "TauPi"; } CObject *Evaluate(const CObject_Vector &jj) { if (p_v->V()->id.back()==2) THROW(not_implemented,"Implement me!"); const CSpinorType &a(*jj[p_v->V()->id.back()]->Get()); CVec4Type b(p_v->J(1-p_v->V()->id.back())->P()); 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 TauPi_Calculator template class TauPi_Calculator; template class TauPiL_Calculator: public Lorentz_Calculator, public TauPi_Worker { public: typedef CSpinor CSpinorType; typedef CVec4 CVec4Type; TauPiL_Calculator(const Vertex_Key &key): Lorentz_Calculator(key) {} std::string Label() const { return "TauPiL"; } CObject *Evaluate(const CObject_Vector &jj) { if (p_v->V()->id.back()==2) THROW(not_implemented,"Implement me!"); const CSpinorType &a(*jj[p_v->V()->id.back()]->Get()); CVec4Type b(p_v->J(1-p_v->V()->id.back())->P()); if (!this->CalcLeft(a)) return NULL; return this->LorentzLeft(a,b); } };// end of class TauPiL_Calculator template class TauPiL_Calculator; template class TauPiR_Calculator: public Lorentz_Calculator, public TauPi_Worker { public: typedef CSpinor CSpinorType; typedef CVec4 CVec4Type; TauPiR_Calculator(const Vertex_Key &key): Lorentz_Calculator(key) {} std::string Label() const { return "TauPiR"; } CObject *Evaluate(const CObject_Vector &jj) { if (p_v->V()->id.back()==2) THROW(not_implemented,"Implement me!"); const CSpinorType &a(*jj[p_v->V()->id.back()]->Get()); CVec4Type b(p_v->J(1-p_v->V()->id.back())->P()); if (!this->CalcRight(a)) return NULL; return this->LorentzRight(a,b); } };// end of class TauPiR_Calculator template class TauPiR_Calculator; }// end of namespace METOOLS using namespace METOOLS; DECLARE_GETTER(TauPi_Calculator,"DTauPi", Lorentz_Calculator,Vertex_Key); Lorentz_Calculator *ATOOLS::Getter >:: operator()(const Vertex_Key &key) const { return new TauPi_Calculator(key); } void ATOOLS::Getter >:: PrintInfo(std::ostream &str,const size_t width) const { str<<"TauPi vertex"; } DECLARE_GETTER(TauPiL_Calculator,"DTauPiL", Lorentz_Calculator,Vertex_Key); Lorentz_Calculator *ATOOLS::Getter >:: operator()(const Vertex_Key &key) const { return new TauPiL_Calculator(key); } void ATOOLS::Getter >:: PrintInfo(std::ostream &str,const size_t width) const { str<<"TauPiL vertex"; } DECLARE_GETTER(TauPiR_Calculator,"DTauPiR", Lorentz_Calculator,Vertex_Key); Lorentz_Calculator *ATOOLS::Getter >:: operator()(const Vertex_Key &key) const { return new TauPiR_Calculator(key); } void ATOOLS::Getter >:: PrintInfo(std::ostream &str,const size_t width) const { str<<"TauPiR vertex"; }