Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:10:03

0001 #ifndef DIRE__Tools__Parton_H
0002 #define DIRE__Tools__Parton_H
0003 
0004 #include "ATOOLS/Phys/Flavour.H"
0005 #include "ATOOLS/Math/Vector.H"
0006 #include "DIRE/Tools/Color.H"
0007 
0008 namespace DIRE {
0009 
0010   class Amplitude;
0011   class Splitting;
0012 
0013   class Parton {
0014   public:
0015 
0016     struct Weight {
0017       double m_t, m_w;
0018       std::vector<double> m_v;
0019       inline Weight(const double &t=-1.0,
0020             const double &w=0.0,
0021             const std::vector<double> &v=
0022             std::vector<double>()):
0023     m_t(t), m_w(w), m_v(v) {}
0024       inline Weight(const size_t &n):
0025     m_t(0.0), m_w(1.0), m_v(n,1.0) {}
0026     };// end of struct Weight
0027 
0028     typedef std::vector<Weight> Weight_Vector;
0029 
0030     typedef std::map<const Parton*,Weight_Vector> Weight_Map;
0031 
0032   private:
0033 
0034     Amplitude *p_ampl;
0035 
0036     ATOOLS::Flavour m_f;
0037     ATOOLS::Vec4D   m_p, m_sp;
0038 
0039     Color m_c, m_sc;
0040     int   m_h, m_b;
0041 
0042     double m_t[2];
0043 
0044     Parton *p_out[2], *p_in;
0045 
0046     size_t m_id;
0047 
0048     Weight_Map m_ws;
0049 
0050     static size_t s_cnt;
0051 
0052   public:
0053 
0054     Parton(Amplitude *const ampl,const ATOOLS::Flavour &f,
0055        const ATOOLS::Vec4D &p=ATOOLS::Vec4D(),
0056        const Color &c=Color(),const int h=0);
0057 
0058     ~Parton();
0059 
0060     double GetXB() const;
0061 
0062     void AddWeight(const Splitting &c,const int acc);
0063 
0064     double GetWeight(const double &t,std::vector<double> &v) const;
0065 
0066     void SetColor(const Color &c);
0067 
0068     inline const ATOOLS::Flavour &Flav() const { return m_f; }
0069     inline const ATOOLS::Vec4D   &Mom() const  { return m_p; }
0070     inline const Color           &Col() const  { return m_c; }
0071 
0072     inline void SetFlav(const ATOOLS::Flavour &f) { m_f=f; }
0073     inline void SetMom(const ATOOLS::Vec4D &p)    { m_p=p; }
0074     inline void SetCol(const Color &c)            { m_c=c; }
0075 
0076     inline double T(int i) const              { return m_t[i]; }
0077     inline void   SetT(int i,const double &t) { m_t[i]=t;      }
0078 
0079     inline int  Hel() const   { return m_h; }
0080     inline void SetHel(int h) { m_h=h;      }
0081 
0082     inline int  Beam() const   { return m_b; }
0083     inline void SetBeam(int b) { m_b=b;      }
0084 
0085     inline size_t Id() const              { return m_id; }
0086     inline void   SetId(const size_t &id) { m_id=id;     }
0087 
0088     inline Parton *Out(int i) const              { return p_out[i]; }
0089     inline void    SetOut(int i,Parton *const p) { p_out[i]=p;      }
0090 
0091     inline Parton *In() const             { return p_in; }
0092     inline void    SetIn(Parton *const p) { p_in=p;      }
0093 
0094     inline void Store()   { m_sp=m_p; m_sc=m_c; }
0095     inline void Restore() { m_p=m_sp; m_c=m_sc; }
0096 
0097     inline Amplitude *Ampl() const { return p_ampl; }
0098 
0099     inline static size_t Counter() { return s_cnt; }
0100 
0101     inline const Weight_Map &Weights() const { return m_ws; }
0102 
0103     inline void ClearWeights() { m_ws.clear(); }
0104 
0105   };// end of class Parton
0106 
0107   std::ostream &operator<<(std::ostream &s,const Parton &p);
0108 
0109   typedef std::vector<Parton*> Parton_Vector;
0110 
0111 }// end of namespace DIRE
0112 
0113 #endif