Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-13 10:29:04

0001 #ifndef ATOOLS_Process_NLO_Subevt_H
0002 #define ATOOLS_Process_NLO_Subevt_H
0003 
0004 #include "ATOOLS/Phys/Particle_List.H"
0005 #include "ATOOLS/Phys/Decay_Info.H"
0006 #include "ATOOLS/Phys/NLO_Types.H"
0007 #include "ATOOLS/Phys/Weight_Info.H"
0008 
0009 namespace ATOOLS {
0010 
0011   struct IDip_ID {
0012     size_t m_ijt, m_kt;
0013   public:
0014     inline IDip_ID(const size_t &ijt=0,const size_t &kt=0):
0015       m_ijt(ijt), m_kt(kt) {}
0016     bool operator<(const IDip_ID &di) const;
0017     inline bool operator==(const IDip_ID &di) const
0018     { return m_ijt==di.m_ijt && m_kt==di.m_kt; }
0019   };// end of struct IDip_ID
0020 
0021   std::ostream &operator<<(std::ostream &ostr,const IDip_ID &idi);
0022 
0023   typedef std::set<IDip_ID> IDip_Set;
0024 
0025   typedef std::map<std::string,IDip_Set> StringIDipSet_Map;
0026 
0027   struct DDip_ID {
0028     size_t m_i, m_j, m_k;
0029   public:
0030     inline DDip_ID(const size_t &i=0,
0031            const size_t &j=0,const size_t &k=0):
0032       m_i(i), m_j(j), m_k(k) {}
0033     bool operator<(const DDip_ID &di) const;
0034     inline bool operator==(const DDip_ID &di) const
0035     { return m_i==di.m_i && m_j==di.m_j && m_k==di.m_k; }
0036     std::string PSInfo() const;
0037   };// end of struct DDip_ID
0038 
0039   std::ostream &operator<<(std::ostream &ostr,const DDip_ID &ddi);
0040 
0041   typedef std::set<DDip_ID> DDip_Set;
0042 
0043   typedef std::map<std::string,DDip_Set> StringDDipSet_Map;
0044 
0045   struct Dip_ID: public IDip_ID, public DDip_ID {
0046     inline Dip_ID(const size_t &ijt=0,const size_t &kt=0,
0047           const size_t &i=0,const size_t &j=0,const size_t &k=0):
0048       IDip_ID(ijt,kt), DDip_ID(i,j,k) {}
0049     bool operator<(const Dip_ID &di) const;
0050   };// end of struct Dip_ID
0051 
0052   std::ostream &operator<<(std::ostream &ostr,const Dip_ID &di);
0053 
0054   struct stp {
0055     enum id {
0056       fac     =  0,
0057       ren     =  1,
0058       res     =  2,
0059       size    =  3
0060     };
0061   };// end of struct stp
0062 
0063   class Cluster_Amplitude;
0064 
0065   class NLO_subevt: public Dip_ID {
0066   public:
0067 
0068     const Flavour *p_fl;
0069     const Vec4D   *p_mom;
0070 
0071     const size_t     *p_id;
0072     DecayInfo_Vector *p_dec;
0073 
0074     NLO_subevt *p_real;
0075     void       *p_proc;
0076 
0077     size_t m_n, m_idx, m_oqcd, m_oew;
0078     double m_result, m_me, m_mewgt, m_K;
0079     ATOOLS::Weights_Map m_results;
0080     double m_x1, m_x2, m_xf1, m_xf2, m_alpha, m_kt2;
0081     std::vector<double> m_mu2;
0082 
0083     std::string m_pname;
0084     sbt::subtype m_stype;
0085 
0086     Cluster_Amplitude *p_ampl;
0087 
0088     int m_delete, m_trig;
0089 
0090   public:
0091 
0092     inline NLO_subevt(const size_t &n=0,const size_t *id=NULL,
0093               const Flavour *fl=NULL,const Vec4D *mom=NULL,
0094               const int i=-1,const int j=-1,const int k=-1):
0095       Dip_ID(0,0,i,j,k), p_fl(fl), p_mom(mom), p_id(id), p_dec(NULL),
0096       p_real(NULL), p_proc(NULL), m_n(n), m_idx(0), m_oqcd(0), m_oew(0),
0097       m_result(0.0), m_me(0.0), m_mewgt(0.0), m_K(0.0),
0098       m_results {0.0},
0099       m_x1(0.0), m_x2(0.0), m_xf1(0.0), m_xf2(0.0), m_alpha(0.0), m_kt2(0.0),
0100       m_mu2(2*stp::size,0.0), m_pname(""), m_stype(sbt::none), 
0101       p_ampl(NULL), m_delete(false), m_trig(false)
0102     {
0103     }
0104 
0105     ~NLO_subevt();
0106 
0107     void CopyXSData(const NLO_subevt *sub);
0108 
0109     Particle_List *CreateParticleList() const;
0110 
0111     std::string IDString(const int mode=0) const;
0112     std::string PSInfo() const;
0113 
0114     inline void SetSType(sbt::subtype st) { m_stype=st; }
0115     inline sbt::subtype SType() const { return m_stype; }
0116 
0117     inline void Mult(const double &scal)
0118     { m_result*=scal; m_results*=scal; m_me*=scal; m_mewgt*=scal; }
0119     inline void MultME(const double &scal) { m_me*=scal; m_mewgt*=scal; }
0120     inline void MultMEwgt(const double &scal) { m_mewgt*=scal; }
0121 
0122     inline bool IsReal() const { return m_i==m_j; }
0123 
0124     inline NLO_subevt &operator*=(const double &scal)
0125     { m_result*=scal; m_results*=scal; return *this; }
0126 
0127     template <class Type> inline Type *Proc() const 
0128     { return static_cast<Type*>(p_proc); }
0129 
0130     inline void Reset(const int mode = 1)
0131     {
0132       m_result = m_me = m_mewgt = m_K = 0.0;
0133       m_results.Clear();
0134       m_results = 0.0;
0135       if (mode)
0136         m_trig = false;
0137     }
0138 
0139   };// end of class NLO_subevt
0140 
0141   std::ostream &operator<<(std::ostream &ostr,const NLO_subevt &sevt);
0142 
0143   class NLO_subevtlist: public std::vector<NLO_subevt*> { 
0144   private:
0145     ATOOLS::nlo_type::code m_type;
0146   public:
0147     inline NLO_subevtlist() : m_type(ATOOLS::nlo_type::lo) {}
0148 
0149     void Mult(const double &scal);
0150     void MultME(const double &scal);
0151     void MultMEwgt(const double &scal);
0152 
0153     NLO_subevtlist& operator*=(const double scal);
0154 
0155     inline ATOOLS::nlo_type::code Type() { return m_type; }
0156     inline void SetType(ATOOLS::nlo_type::code type) { m_type=type; }
0157   };// end of class NLO_subevtlist
0158 
0159 }// end of namespace ATOOLS
0160 
0161 #endif