File indexing completed on 2025-04-19 09:09:54
0001 #ifndef ATOOLS_Phys_Cluster_Leg_H
0002 #define ATOOLS_Phys_Cluster_Leg_H
0003
0004 #include "ATOOLS/Math/Vector.H"
0005 #include "ATOOLS/Phys/Flavour.H"
0006 #include "ATOOLS/Org/CXXFLAGS.H"
0007
0008 namespace ATOOLS {
0009
0010 struct ColorID {
0011 int m_i, m_j;
0012 inline ColorID(const int &i=-1,const int &j=-1): m_i(i), m_j(j) {}
0013 inline ColorID Conj() const { return ColorID(m_j,m_i); }
0014 inline bool operator==(const ColorID &c) const
0015 { return c.m_i==m_i && c.m_j==m_j; }
0016 inline bool Singlet() { return m_i==m_j; }
0017 };
0018
0019 typedef std::vector<ColorID> ColorID_Vector;
0020
0021 std::ostream &operator<<(std::ostream &ostr,const ColorID &col);
0022
0023 class Cluster_Amplitude;
0024 class Cluster_Leg;
0025
0026 class ClusterLeg_PVector: public std::vector<Cluster_Leg*> {
0027 public:
0028
0029 ClusterLeg_PVector();
0030
0031 ~ClusterLeg_PVector();
0032
0033 };
0034
0035 class Cluster_Leg {
0036 private:
0037
0038 Cluster_Amplitude *p_ampl;
0039
0040 size_t m_id, m_st, m_n, m_d, m_k;
0041 Vec4D m_p;
0042 Flavour m_fl;
0043 ColorID m_c;
0044 bool m_fromdec;
0045
0046 double m_kt2[2];
0047
0048 static ClusterLeg_PVector s_legs;
0049
0050 public:
0051
0052 inline Cluster_Leg(Cluster_Amplitude *const ampl,
0053 const Cluster_Leg &ref)
0054 { *this=ref; p_ampl=ampl; }
0055 inline Cluster_Leg(Cluster_Amplitude *const ampl,
0056 const Vec4D &p,const Flavour &fl,
0057 const ColorID &c=ColorID()):
0058 p_ampl(ampl), m_id(0), m_st(0), m_n(0), m_d(0), m_k(0),
0059 m_p(p), m_fl(fl), m_c(c), m_fromdec(false)
0060 { m_kt2[0]=m_kt2[1]=-1.0; }
0061
0062 inline ~Cluster_Leg() {}
0063
0064 static Cluster_Leg *New(Cluster_Amplitude *const ampl,
0065 const Cluster_Leg &ref);
0066 static Cluster_Leg *New(Cluster_Amplitude *const ampl,
0067 const Vec4D &p,const Flavour &fl,
0068 const ColorID &c=ColorID());
0069 void Delete();
0070
0071
0072 inline void SetId(const size_t &id) { m_id=id; }
0073 inline void SetStat(const size_t &st) { m_st=st; }
0074 inline void SetNMax(const size_t &n) { m_n=n; }
0075 inline void SetK(const size_t &k) { m_k=k; }
0076
0077 inline void SetCol(const ColorID &c) { m_c=c; }
0078 inline void SetMom(const Vec4D &p) { m_p=p; }
0079 inline void SetFlav(const Flavour &fl) { m_fl=fl; }
0080
0081 inline void SetKT2(const int i,const double &kt2) { m_kt2[i]=kt2; }
0082
0083 inline Cluster_Amplitude *Amplitude() const { return p_ampl; }
0084
0085 inline Vec4D Mom() const { return m_p; }
0086 inline Flavour Flav() const { return m_fl; }
0087 inline ColorID Col() const { return m_c; }
0088
0089 inline size_t Id() const { return m_id; }
0090 inline size_t Stat() const { return m_st; }
0091 inline size_t NMax() const { return m_n; }
0092 inline size_t K() const { return m_k; }
0093
0094 inline double KT2(const int i) const { return m_kt2[i]; }
0095
0096 inline void SetFromDec(const bool &val){m_fromdec=val;}
0097 inline bool FromDec() const {return m_fromdec;}
0098
0099
0100 };
0101
0102 typedef std::vector<Cluster_Leg*> ClusterLeg_Vector;
0103
0104 std::ostream &operator<<(std::ostream &ostr,const Cluster_Leg &leg);
0105
0106 }
0107
0108 #endif