File indexing completed on 2025-04-19 09:10:05
0001 #ifndef MCATNLO_Tools_Parton_H
0002 #define MCATNLO_Tools_Parton_H
0003
0004 #include "ATOOLS/Phys/Flavour.H"
0005 #include "ATOOLS/Phys/Particle.H"
0006 #include "ATOOLS/Math/Poincare.H"
0007 #include "ATOOLS/Phys/Cluster_Leg.H"
0008 #include "ATOOLS/Org/Message.H"
0009 #include <list>
0010
0011 namespace MCATNLO {
0012
0013 class Singlet;
0014 class Splitting_Function_Base;
0015
0016 struct pst {
0017 enum code {
0018 IS = -1,
0019 FS = 1,
0020 none = 0
0021 };
0022 };
0023
0024 struct Sudakov_Reweighting_Info {
0025 bool accepted;
0026 double scale;
0027 double accwgt;
0028 double lastj;
0029 double lastcpl;
0030 Splitting_Function_Base* sf;
0031 double x, y, z;
0032 ATOOLS::Flavour flspec;
0033 };
0034 typedef std::vector<Sudakov_Reweighting_Info> Sudakov_Reweighting_Infos;
0035
0036 class Parton;
0037
0038 struct Color_Info {
0039 int m_i[2], m_j[2], m_k[2], m_new;
0040 inline Color_Info(): m_new(0)
0041 { m_i[0]=m_i[1]=m_j[0]=m_j[1]=m_k[0]=m_k[1]=0; }
0042 inline Color_Info(ATOOLS::ColorID ci,ATOOLS::ColorID cj,
0043 ATOOLS::ColorID ck,const int nc=-1): m_new(nc)
0044 {
0045 m_i[0]=ci.m_i; m_i[1]=ci.m_j;
0046 m_j[0]=cj.m_i; m_j[1]=cj.m_j;
0047 m_k[0]=ck.m_i; m_k[1]=ck.m_j;
0048 }
0049 };
0050
0051 std::ostream &operator<<(std::ostream &str,const Color_Info &ci);
0052
0053 class Parton {
0054 private:
0055 ATOOLS::Flavour m_flav;
0056 ATOOLS::Vec4D m_mom;
0057 ATOOLS::Flow m_flow,m_meflow;
0058 pst::code m_pst;
0059 int m_beam,m_kin,m_col;
0060 double m_kt_start, m_kt_veto, m_kt_test;
0061 double m_kt_max, m_phi;
0062 double m_z_test, m_y_test, m_xBj;
0063 Parton * p_spect;
0064 Singlet * p_sing;
0065 size_t m_id, m_idx;
0066 ATOOLS::Poincare_Sequence m_lt;
0067
0068 Sudakov_Reweighting_Infos m_sudakovrewinfos;
0069
0070 std::vector<Parton*> m_specs;
0071 Splitting_Function_Base *p_sf;
0072
0073 Color_Info m_ci;
0074
0075 public:
0076 inline Parton();
0077 inline Parton(const ATOOLS::Flavour &,const ATOOLS::Vec4D &,pst::code=pst::none);
0078 inline Parton(const ATOOLS::Particle *,pst::code=pst::none);
0079
0080 inline std::vector<Parton*> &Specs() { return m_specs; }
0081
0082 inline void SetLT(const ATOOLS::Poincare_Sequence <) { m_lt=lt; }
0083 inline const ATOOLS::Poincare_Sequence <() const { return m_lt; }
0084
0085 Sudakov_Reweighting_Infos& SudakovReweightingInfos() { return m_sudakovrewinfos; }
0086
0087 inline ATOOLS::Flavour const GetFlavour() const;
0088 inline ATOOLS::Vec4D const Momentum() const;
0089 inline ATOOLS::Vec4D Momentum();
0090 inline pst::code GetType() const;
0091 inline int GetFlow(const int) const;
0092 inline int GetMEFlow(const int) const;
0093 inline int GetRFlow(const int) const;
0094 inline int Beam() const;
0095 inline int Kin() const { return m_kin; }
0096 inline int Col() const { return m_col; }
0097 inline Color_Info &Color() { return m_ci; }
0098 inline size_t Id() const;
0099 inline size_t Idx() const { return m_idx; }
0100 inline Splitting_Function_Base *SF() const { return p_sf; }
0101 inline double KtMax() const;
0102 inline double KtStart() const;
0103 inline double KtVeto() const;
0104 inline double KtTest() const;
0105 inline double ZTest() const;
0106 inline double YTest() const;
0107 inline double Xbj() const;
0108 inline double Phi() const;
0109 inline Parton * GetSpect();
0110 inline Singlet* GetSing();
0111 inline void SetFlavour(const ATOOLS::Flavour &);
0112 inline void SetMomentum(const ATOOLS::Vec4D &);
0113 inline void SetStart(const double);
0114 inline void SetKtMax(const double);
0115 inline void SetVeto(const double);
0116 inline void SetKtTest(const double);
0117 inline void SetZTest(const double);
0118 inline void SetYTest(const double);
0119 inline void SetTest(const double,const double,const double,const double);
0120 inline void SetXbj(const double);
0121 inline void SetPhi(const double);
0122 inline void SetSpect(Parton *);
0123 inline void SetSing(Singlet *);
0124 inline void SetFlow(int code_index,int code=0);
0125 inline void SetMEFlow(int code_index,int code=0);
0126 inline void SetBeam(int);
0127 inline void SetKin(int kin) { m_kin=kin; }
0128 inline void SetCol(int col) { m_col=col; }
0129 inline void SetId(size_t);
0130 inline void SetIdx(size_t idx) { m_idx=idx; }
0131 inline void SetSF(Splitting_Function_Base *const sf) { p_sf=sf; }
0132 friend std::ostream& operator<<(std::ostream &,const Parton &);
0133 };
0134
0135 Parton::Parton() :
0136 m_flav(ATOOLS::Flavour(kf_none)),
0137 m_mom(ATOOLS::Vec4D(0.,0.,0.,0.)),
0138 m_pst(pst::none), m_beam(0), m_kin(0),
0139 m_kt_start(0.), m_kt_veto(0.), m_kt_test(0.),
0140 m_kt_max(0.), m_phi(2.0*M_PI),
0141 m_z_test(1.), m_y_test(1.), m_xBj(1.),
0142 p_spect(NULL), p_sing(NULL), m_id(0), m_idx(0)
0143 {
0144 m_flow.SetCode(1,0);
0145 m_flow.SetCode(2,0);
0146 }
0147
0148 Parton::Parton(const ATOOLS::Flavour & flav,const ATOOLS::Vec4D & mom,pst::code pst) :
0149 m_flav(flav), m_mom(mom), m_pst(pst), m_beam(0), m_kin(0),
0150 m_kt_start(0.), m_kt_veto(0.), m_kt_test(0.),
0151 m_kt_max(0.), m_phi(2.0*M_PI),
0152 m_z_test(1.), m_y_test(1.), m_xBj(1.),
0153 p_spect(NULL), p_sing(NULL), m_id(0), m_idx(0)
0154 {
0155 m_flow.SetCode(1,0);
0156 m_flow.SetCode(2,0);
0157 }
0158
0159 Parton::Parton(const ATOOLS::Particle * part,pst::code pst) :
0160 m_flav(part->Flav()), m_mom(part->Momentum()),
0161 m_pst(pst), m_beam(0), m_kin(0),
0162 m_kt_start(0.), m_kt_veto(0.), m_kt_test(0.),
0163 m_kt_max(0.), m_phi(0.),
0164 m_z_test(1.), m_y_test(1.), m_xBj(1.),
0165 p_spect(NULL), p_sing(NULL), m_id(0), m_idx(0)
0166 {
0167 if (m_pst==pst::FS) {
0168 m_flow.SetCode(1,part->GetFlow(1));
0169 m_flow.SetCode(2,part->GetFlow(2));
0170 }
0171 else {
0172 m_flow.SetCode(1,part->GetFlow(2));
0173 m_flow.SetCode(2,part->GetFlow(1));
0174 }
0175 }
0176 ATOOLS::Flavour const Parton::GetFlavour() const { return m_flav; }
0177 ATOOLS::Vec4D const Parton::Momentum() const { return m_mom; }
0178 ATOOLS::Vec4D Parton::Momentum() { return m_mom; }
0179 pst::code Parton::GetType() const { return m_pst; }
0180 int Parton::GetFlow(const int index) const {
0181 return m_flow.Code(index);
0182 }
0183 int Parton::GetMEFlow(const int index) const {
0184 return m_meflow.Code(index);
0185 }
0186 int Parton::GetRFlow(const int index) const {
0187 if (m_meflow.Code(index)>0) return m_meflow.Code(index);
0188 return m_flow.Code(index);
0189 }
0190 double Parton::KtStart() const { return m_kt_start; }
0191 double Parton::KtMax() const { return m_kt_max; }
0192 double Parton::KtVeto() const { return m_kt_veto; }
0193 double Parton::KtTest() const { return m_kt_test; }
0194 double Parton::ZTest() const { return m_z_test; }
0195 double Parton::YTest() const { return m_y_test; }
0196 double Parton::Xbj() const { return m_xBj; }
0197 double Parton::Phi() const { return m_phi; }
0198 int Parton::Beam() const { return m_beam; }
0199 size_t Parton::Id() const { return m_id; }
0200 Parton * Parton::GetSpect() { return p_spect; }
0201 Singlet* Parton::GetSing() { return p_sing; }
0202 void Parton::SetFlavour(const ATOOLS::Flavour & fl) { m_flav = fl; }
0203 void Parton::SetMomentum(const ATOOLS::Vec4D & mom) { m_mom = mom; }
0204 void Parton::SetStart(const double kt) { m_kt_start = kt; }
0205 void Parton::SetKtMax(const double kt) { m_kt_max = kt; }
0206 void Parton::SetVeto(const double kt) { m_kt_veto = kt; }
0207 void Parton::SetKtTest(const double kt) { m_kt_test = kt; }
0208 void Parton::SetZTest(const double z) { m_z_test = z; }
0209 void Parton::SetYTest(const double y) { m_y_test = y; }
0210 void Parton::SetTest(const double kt,
0211 const double z,
0212 const double y,
0213 const double phi) { m_kt_test = kt;
0214 m_z_test = z;
0215 m_y_test = y;
0216 m_phi = phi; }
0217 void Parton::SetXbj(const double x) { m_xBj = x; }
0218 void Parton::SetPhi(const double phi) { m_phi = phi; }
0219 void Parton::SetSpect(Parton * part) { p_spect = part; }
0220 void Parton::SetSing(Singlet* sing) { p_sing = sing; }
0221 void Parton::SetFlow(const int index, const int code) {
0222 if ((!m_flav.IsDiQuark()) && (!m_flav.Strong())) return;
0223 m_flow.SetCode(index,code);
0224 }
0225 void Parton::SetMEFlow(const int index, const int code) {
0226 if ((!m_flav.IsDiQuark()) && (!m_flav.Strong())) return;
0227 m_meflow.SetCode(index,code);
0228 }
0229 void Parton::SetBeam(const int beam) { m_beam = beam;}
0230 void Parton::SetId(const size_t id) { m_id = id;}
0231 typedef std::list<Parton *> Parton_List;
0232 typedef Parton_List::iterator PLiter;
0233
0234 }
0235
0236 #endif