File indexing completed on 2025-04-19 09:10:01
0001 #ifndef CSSHOWER_Tools_Parton_H
0002 #define CSSHOWER_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/Org/My_Limits.H"
0008 #include "ATOOLS/Org/Message.H"
0009
0010 namespace CSSHOWER {
0011
0012 class Singlet;
0013 class Splitting_Function_Base;
0014
0015 struct pst {
0016 enum code {
0017 IS = -1,
0018 FS = 1,
0019 none = 0
0020 };
0021 };
0022
0023 struct Sudakov_Reweighting_Info {
0024 bool accepted;
0025 double scale;
0026 double accwgt;
0027 double lastj;
0028 double lastcpl;
0029 Splitting_Function_Base* sf;
0030 double x, y, z;
0031 ATOOLS::Flavour flspec;
0032 };
0033 typedef std::vector<Sudakov_Reweighting_Info> Sudakov_Reweighting_Infos;
0034
0035 class Parton {
0036 private:
0037 ATOOLS::Flavour m_flav;
0038 ATOOLS::Vec4D m_mom;
0039 ATOOLS::Flow m_flow;
0040 pst::code m_pst;
0041 bool m_forcedsplitting;
0042 int m_beam,m_stat,m_kin,m_kscheme,m_col,m_nforced;
0043 double m_kt_start, m_kt_veto, m_kt_test;
0044 double m_z_test, m_y_test, m_phi, m_weight, m_xBj, m_t;
0045 double m_kt_soft[2];
0046 bool m_fromdec;
0047 Parton * p_left, * p_right;
0048 Parton * p_spect, * p_prev, * p_next;
0049 Singlet * p_sing;
0050 size_t m_id;
0051 ATOOLS::Poincare_Sequence m_lt;
0052
0053 std::vector<std::pair<double,double> > m_weights;
0054 Sudakov_Reweighting_Infos m_sudakovrewinfos;
0055
0056 public:
0057 inline Parton();
0058 inline Parton(const ATOOLS::Flavour &,const ATOOLS::Vec4D &,pst::code=pst::none);
0059 inline Parton(const ATOOLS::Particle *,pst::code=pst::none);
0060
0061 void DeleteAll();
0062
0063 Parton *FollowUp();
0064 void UpdateDaughters();
0065 void UpdateColours(int newr,int newa);
0066
0067 inline void SetKScheme(const int kscheme) { m_kscheme=kscheme; }
0068 inline int KScheme() const { return m_kscheme; }
0069
0070 inline void SetLT(const ATOOLS::Poincare_Sequence <) { m_lt=lt; }
0071 inline const ATOOLS::Poincare_Sequence <() const { return m_lt; }
0072
0073 inline std::vector<std::pair<double,double> > &Weights() { return m_weights; }
0074 Sudakov_Reweighting_Infos& SudakovReweightingInfos() { return m_sudakovrewinfos; }
0075
0076 double Weight(const double &scale);
0077
0078 inline ATOOLS::Flavour const GetFlavour() const;
0079 inline ATOOLS::Vec4D const Momentum() const;
0080 inline ATOOLS::Vec4D Momentum();
0081 inline pst::code GetType() const;
0082 inline int GetFlow(const int) const;
0083 inline int Beam() const;
0084 inline int Stat() const;
0085 inline int Kin() const { return m_kin; }
0086 inline int Col() const { return m_col; }
0087 inline size_t Id() const;
0088 inline double KtStart() const;
0089 inline double KtSoft(int i) const;
0090 inline double KtVeto() const;
0091 inline double KtTest() const;
0092 inline double ZTest() const;
0093 inline double YTest() const;
0094 inline double Weight() const;
0095 inline double Xbj() const;
0096 inline double Mass2() const { return m_t; }
0097 inline double Phi() const;
0098 inline bool ForcedSplitting() const;
0099 inline size_t ForcedTrials() const { return m_nforced; }
0100 inline Parton * GetLeft();
0101 inline Parton * GetRight();
0102 inline Parton * GetSpect();
0103 inline Parton * GetPrev();
0104 inline Parton * GetNext();
0105 inline Singlet* GetSing();
0106
0107 inline void SetFlavour(const ATOOLS::Flavour &);
0108 inline void SetMomentum(const ATOOLS::Vec4D &);
0109 inline void SetStart(const double);
0110 inline void SetSoft(int i,const double);
0111 inline void SetVeto(const double);
0112 inline void SetKtTest(const double);
0113 inline void SetKtStart(const double);
0114 inline void SetZTest(const double);
0115 inline void SetYTest(const double);
0116 inline void SetWeight(const double);
0117 inline void SetTest(const double,const double,const double,const double);
0118 inline void SetXbj(const double);
0119 inline void SetMass2(const double t) { m_t=t; }
0120 inline void SetPhi(const double);
0121 inline void SetForcedSplitting(const bool);
0122 inline void IncForcedTrials() { m_nforced++; }
0123 void SetLeftOf(Parton *);
0124 void SetRightOf(Parton *);
0125 inline void SetLeft(Parton *);
0126 inline void SetRight(Parton *);
0127 inline void SetSpect(Parton *);
0128 inline void SetPrev(Parton *);
0129 inline void SetNext(Parton *);
0130 inline void SetSing(Singlet *);
0131 inline void SetFlow(int code_index,int code=0);
0132 inline void SetBeam(int);
0133 inline void SetStat(int);
0134 inline void SetKin(int kin) { m_kin=kin; }
0135 inline void SetCol(int col) { m_col=col; }
0136 inline void SetId(size_t);
0137 inline void SetFromDec(const bool &val){m_fromdec=val;}
0138 inline bool FromDec() const {return m_fromdec;}
0139 friend std::ostream& operator<<(std::ostream &,const Parton &);
0140 };
0141
0142 Parton::Parton() :
0143 m_flav(ATOOLS::Flavour(kf_none)),
0144 m_mom(ATOOLS::Vec4D(0.,0.,0.,0.)),
0145 m_pst(pst::none), m_forcedsplitting(false),
0146 m_beam(0), m_stat(0), m_kin(0), m_kscheme(0), m_col(0), m_nforced(0),
0147 m_kt_start(0.), m_kt_veto(0.), m_kt_test(0.),
0148 m_z_test(1.), m_y_test(1.), m_phi(2.0*M_PI), m_weight(1.0), m_xBj(1.),
0149 p_left(NULL), p_right(NULL), p_spect(NULL), p_prev(NULL), p_next(NULL), p_sing(NULL),
0150 m_id(0),m_fromdec(false)
0151 {
0152 m_kt_soft[0]=m_kt_soft[1]=std::numeric_limits<double>::max();
0153 m_flow.SetCode(1,0);
0154 m_flow.SetCode(2,0);
0155 }
0156
0157 Parton::Parton(const ATOOLS::Flavour & flav,const ATOOLS::Vec4D & mom,pst::code pst) :
0158 m_flav(flav), m_mom(mom), m_pst(pst), m_forcedsplitting(false),
0159 m_beam(0), m_stat(0), m_kin(0), m_kscheme(0), m_col(0), m_nforced(0),
0160 m_kt_start(0.), m_kt_veto(0.), m_kt_test(0.),
0161 m_z_test(1.), m_y_test(1.), m_phi(2.0*M_PI), m_weight(1.0), m_xBj(1.),
0162 p_left(NULL), p_right(NULL), p_spect(NULL), p_prev(NULL), p_next(NULL), p_sing(NULL),
0163 m_id(0), m_fromdec(false)
0164 {
0165 m_kt_soft[0]=m_kt_soft[1]=std::numeric_limits<double>::max();
0166 m_flow.SetCode(1,0);
0167 m_flow.SetCode(2,0);
0168 }
0169
0170 Parton::Parton(const ATOOLS::Particle * part,pst::code pst) :
0171 m_flav(part->Flav()), m_mom(part->Momentum()),
0172 m_pst(pst), m_forcedsplitting(false),
0173 m_beam(0), m_stat(0), m_kin(0), m_kscheme(0), m_col(0), m_nforced(0),
0174 m_kt_start(0.), m_kt_veto(0.), m_kt_test(0.),
0175 m_z_test(1.), m_y_test(1.), m_phi(2.0*M_PI), m_weight(1.0), m_xBj(1.),
0176 p_left(NULL), p_right(NULL), p_spect(NULL), p_prev(NULL), p_next(NULL), p_sing(NULL),
0177 m_id(0), m_fromdec(part->FromDec())
0178 {
0179 m_kt_soft[0]=m_kt_soft[1]=std::numeric_limits<double>::max();
0180 if (m_pst==pst::FS) {
0181 m_flow.SetCode(1,part->GetFlow(1));
0182 m_flow.SetCode(2,part->GetFlow(2));
0183 }
0184 else {
0185 m_flow.SetCode(1,part->GetFlow(2));
0186 m_flow.SetCode(2,part->GetFlow(1));
0187 }
0188 }
0189 ATOOLS::Flavour const Parton::GetFlavour() const { return m_flav; }
0190 ATOOLS::Vec4D const Parton::Momentum() const { return m_mom; }
0191 ATOOLS::Vec4D Parton::Momentum() { return m_mom; }
0192 pst::code Parton::GetType() const { return m_pst; }
0193 int Parton::GetFlow(const int index) const {
0194 return m_flow.Code(index);
0195 }
0196 double Parton::KtStart() const { return m_kt_start; }
0197 double Parton::KtSoft(int i) const { return m_kt_soft[i]; }
0198 double Parton::KtVeto() const { return m_kt_veto; }
0199 double Parton::KtTest() const { return m_kt_test; }
0200 double Parton::ZTest() const { return m_z_test; }
0201 double Parton::YTest() const { return m_y_test; }
0202 double Parton::Weight() const { return m_weight; }
0203 double Parton::Xbj() const { return m_xBj; }
0204 double Parton::Phi() const { return m_phi; }
0205 bool Parton::ForcedSplitting() const { return m_forcedsplitting; }
0206 int Parton::Beam() const { return m_beam; }
0207 int Parton::Stat() const { return m_stat; }
0208 size_t Parton::Id() const { return m_id; }
0209 Parton * Parton::GetLeft() { return p_left; }
0210 Parton * Parton::GetRight() { return p_right; }
0211 Parton * Parton::GetSpect() { return p_spect; }
0212 Parton * Parton::GetPrev() { return p_prev; }
0213 Parton * Parton::GetNext() { return p_next; }
0214 Singlet* Parton::GetSing() { return p_sing; }
0215 void Parton::SetFlavour(const ATOOLS::Flavour & fl) { m_flav = fl; }
0216 void Parton::SetMomentum(const ATOOLS::Vec4D & mom) { m_mom = mom; }
0217 void Parton::SetStart(const double kt) { m_kt_start = kt; }
0218 void Parton::SetSoft(int i,const double kt) { m_kt_soft[i] = kt; }
0219 void Parton::SetVeto(const double kt) { m_kt_veto = kt; }
0220 void Parton::SetKtTest(const double kt) { m_kt_test = kt; }
0221 void Parton::SetKtStart(const double kt) { m_kt_start = kt; }
0222 void Parton::SetZTest(const double z) { m_z_test = z; }
0223 void Parton::SetYTest(const double y) { m_y_test = y; }
0224 void Parton::SetWeight(const double weight) { m_weight = weight; }
0225 void Parton::SetTest(const double kt,
0226 const double z,
0227 const double y,
0228 const double phi) { m_kt_test = kt;
0229 m_z_test = z;
0230 m_y_test = y;
0231 m_phi = phi; }
0232 void Parton::SetXbj(const double x) { m_xBj = x; }
0233 void Parton::SetPhi(const double phi) { m_phi = phi; }
0234 void Parton::SetForcedSplitting(const bool fs) { m_forcedsplitting = fs; }
0235 void Parton::SetLeft(Parton * part) { p_left = part; }
0236 void Parton::SetRight(Parton * part) { p_right = part; }
0237 void Parton::SetSpect(Parton * part) { p_spect = part; }
0238 void Parton::SetPrev(Parton * part) { p_prev = part; }
0239 void Parton::SetNext(Parton * part) { p_next = part; }
0240 void Parton::SetSing(Singlet* sing) { p_sing = sing; }
0241 void Parton::SetFlow(const int index, const int code) {
0242 m_flow.SetCode(index,code);
0243 }
0244 void Parton::SetBeam(const int beam) { m_beam = beam;}
0245 void Parton::SetStat(const int stat) { m_stat = stat;}
0246 void Parton::SetId(const size_t id) { m_id = id;}
0247 typedef std::list<Parton *> Parton_List;
0248 typedef Parton_List::iterator PLiter;
0249
0250 }
0251
0252 #endif