Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef EXTAMP_Process_CS_Dipole_H
0002 #define EXTAMP_Process_CS_Dipole_H
0003 
0004 #include <string>
0005 #include <algorithm>
0006 #include "ATOOLS/Math/Vector.H"
0007 #include "ATOOLS/Phys/Flavour.H"
0008 #include "ATOOLS/Phys/NLO_Types.H"
0009 
0010 namespace PHASIC {
0011   class Spin_Color_Correlated_ME2;
0012 }
0013 
0014 namespace EXTAMP {
0015 
0016   class Dipole_Wrapper_Process;
0017   class Spin_Color_Correlated_ME2;
0018 
0019   enum SplittingType { FF,IF,FI,II };
0020   std::ostream &operator<<(std::ostream &str,const SplittingType& st);
0021 
0022 
0023   enum FlavourType { gtogg,gtoqq,qtoqg };
0024   std::ostream &operator<<(std::ostream &str,const FlavourType& ft);
0025   
0026 
0027   struct Dipole_Info {
0028     
0029     Dipole_Info(const ATOOLS::Flavour_Vector& flavs,
0030                 const size_t& i, const size_t& j, const size_t& k,
0031                 const ATOOLS::subscheme::code& subtrtype,
0032                 const double& alphamin, const double& alphamax);
0033 
0034     SplittingType          m_split_type;
0035     FlavourType            m_flav_type;
0036     ATOOLS::Flavour_Vector m_real_flavs;
0037     
0038     /* Indices i,j,k in momentum/flavour vector of corresponding real
0039        emission process */
0040     size_t m_real_i, m_real_j, m_real_k;
0041     
0042     /* Subtraction scheme: plain CS, Dire, or CSS (modfied CS, as used in CSS) */
0043     ATOOLS::subscheme::code m_subtype;
0044 
0045     /* Cuts on alpha as defined in hep-ph/0307268 */
0046     double m_alphamin, m_alphamax;
0047     
0048   };
0049 
0050 
0051   std::ostream &operator<<(std::ostream &str,const Dipole_Info& di);
0052 
0053 
0054   struct Dipole_Kinematics {
0055 
0056     ATOOLS::Vec4D_Vector m_born_mom;
0057 
0058     /* Alpha parameter as defined in hep-ph/0307268 */
0059     virtual double Alpha() const = 0;
0060 
0061     /* Get shower-like variables */
0062     virtual double ShowerX()  const = 0;
0063     virtual double ShowerY()  const = 0;
0064     virtual double ShowerQ2() const = 0;
0065 
0066     bool PassesAlphaMin(const double& alphamin) const
0067     { return (Alpha() > alphamin); }
0068 
0069     /* Check whether alpha lies in the given interval */
0070     bool PassesAlphaCuts(const double& alphamin,
0071              const double& alphamax) const
0072     {
0073       const double& alpha = Alpha();
0074       return (alpha > alphamin) && (alpha < alphamax);
0075     }
0076     
0077   };
0078 
0079 
0080   class CS_Dipole {
0081 
0082     friend class EXTAMP::Dipole_Wrapper_Process;
0083 
0084   public:
0085 
0086     CS_Dipole(const Dipole_Info& di);
0087     virtual ~CS_Dipole() {};
0088 
0089     const Dipole_Info& Info() const { return m_dip_info; }
0090 
0091     /* Calculate contribution to differential cross section: Call
0092        CalcKinematics first, then get XS from Calc() method.
0093        CalcKinematics stores results, resulting born momenta can be
0094        accessed through Momenta() method. */
0095     virtual void  CalcKinematics(const ATOOLS::Vec4D_Vector& p) = 0;
0096     virtual const ATOOLS::Vec4D_Vector& Momenta() const = 0;
0097     double  Calc() const;
0098 
0099     bool PassesAlphaCuts() const;
0100     bool PassesAlphaMin () const;
0101     
0102     /* Indices i,j,k in the real emission flavour config */
0103     const size_t& I() const { return m_dip_info.m_real_i; }
0104     const size_t& J() const { return m_dip_info.m_real_j; }
0105     const size_t& K() const { return m_dip_info.m_real_k; }
0106 
0107     /* Indices (ij) and k in the born flavour config */
0108     const size_t& BornIJ() const { return Emitter(); }
0109     size_t BornK () const { return (K()<Emitted()? K() : K()-1); }
0110 
0111     /* Convention: consider min(i,j) the emitter, max(i,j) the
0112        emitted */
0113     const size_t& Emitter() const { return std::min(I(),J()); }
0114     const size_t& Emitted() const { return std::max(I(),J()); }
0115 
0116     const std::vector<size_t>& IDVector() const {return m_id_vector; }
0117 
0118     const FlavourType&   FlavType()  const { return m_dip_info.m_flav_type;  }
0119     const SplittingType& SplitType() const { return m_dip_info.m_split_type; }
0120 
0121     const ATOOLS::Flavour_Vector& Flavours()     const {return m_born_flavs; }
0122     const ATOOLS::Flavour_Vector& RealFlavours() const {return m_dip_info.m_real_flavs; }
0123     const ATOOLS::Flavour& FlavI()  const { return m_dip_info.m_real_flavs[I()]; }
0124     const ATOOLS::Flavour& FlavJ()  const { return m_dip_info.m_real_flavs[J()]; }
0125     const ATOOLS::Flavour& FlavIJ() const { return m_born_flavs[BornIJ()]; }
0126 
0127     /* Given two indices i,j, and a flavour vector, construct born a
0128        flavour configuration by combining partons i and j */
0129     static ATOOLS::Flavour_Vector ConstructBornFlavours(const size_t& i, const size_t& j,
0130                             const ATOOLS::Flavour_Vector& flavs);
0131 
0132     /* Construct an ID vector encoding the id's of particles as they
0133        are ordered in the born flavour vector m_born_flavs. This is
0134        needed for ATOOLS::NLO_Subevents, which own a pointer to such a
0135        vector. Note: id's are in binary encoding, meaning the i'th
0136        particle has id 1<<i and the combined particles i and j have
0137        inded (1<<i|1<<j). */
0138     static std::vector<size_t> ConstructIDVector(const size_t& i, const size_t& j,
0139                          const ATOOLS::Flavour_Vector& flavs);
0140 
0141     const ATOOLS::subscheme::code& SubtractionType() const
0142     { return m_dip_info.m_subtype; }
0143     void SetSubtractionType(ATOOLS::subscheme::code subtype)
0144     { m_dip_info.m_subtype = subtype; }
0145 
0146     virtual const Dipole_Kinematics* const LastKinematics() const = 0;
0147 
0148     PHASIC::Spin_Color_Correlated_ME2* CorrelatedME() { return p_corr_me; }
0149 
0150   protected:
0151 
0152     /* Calc() relies on the implementation of all pure virtual
0153        functions below. They are implemented by child classes
0154        representing FF, II, FI, and IF dipoles. */
0155     double CalcCorrelator() const;
0156     virtual double CalcKinDependentPrefac() const = 0;
0157     /* Calc \tilde{p}^\mu similar to table 1 of arXiv:0709.2881v1 */
0158     virtual ATOOLS::Vec4D CalcPtilde() const = 0;
0159     /* Prefactor of spin- and color-correlated contribution, enters as
0160        CalcB() * <1,...,m;a,b| ptilde^\mu T_ij T_k ptilde^\nu |b,a;m,...m1> * T_ij^{-2} * ptilde^{-2} */
0161     virtual double CalcB() const = 0;
0162     /* Prefactor of purely color-correlated contribution,  enters as
0163        CalcA() * <1,...,m;a,b| T_ij T_k |b,a;m,...m1> * T_ij^{-2} */
0164     virtual double CalcA() const = 0;
0165 
0166     /* Determine the mother flavour ij of QCD splitting ij -> i+j */
0167     static ATOOLS::Flavour CombinedFlavour(const size_t& i, const size_t& j,
0168                        const ATOOLS::Flavour_Vector& flavs);
0169 
0170     constexpr static double m_CF = 4./3.;
0171     constexpr static double m_CA = 3.0;
0172     constexpr static double m_TR = 1./2.;
0173 
0174   private:
0175     
0176     PHASIC::Spin_Color_Correlated_ME2* p_corr_me;
0177 
0178     ATOOLS::Flavour_Vector m_born_flavs;
0179 
0180     /* An ID vector encoding the id's of particles as they are ordered
0181        in the born flavour vector m_born_flavs. This is needed for
0182        ATOOLS::NLO_Subevents, which own a pointer to such a vector. */
0183     std::vector<size_t> m_id_vector;
0184 
0185     /* Kinematics-independent factor of splitting operators, e.g.
0186        prefactor of eq (5.8) of hep-ph/9605323v3 for case of FF
0187        dipole */
0188     double m_const_prefac;
0189 
0190     Dipole_Info m_dip_info;
0191 
0192   };
0193 
0194 }
0195 
0196 #endif