File indexing completed on 2025-04-19 09:09:57
0001 #ifndef ATOOLS_Phys_Weight_Info_H
0002 #define ATOOLS_Phys_Weight_Info_H
0003
0004 #include "ATOOLS/Math/MathTools.H"
0005 #include "ATOOLS/Phys/Weights.H"
0006 #include <ostream>
0007 #include <vector>
0008
0009 namespace ATOOLS {
0010
0011 struct PDF_Info {
0012 int m_fl1, m_fl2;
0013 double m_x1, m_x2, m_muf12, m_muf22, m_xf1, m_xf2;
0014 PDF_Info(const int &fl1=0, const int &fl2=0,
0015 const double &x1=0.,const double &x2=0.,
0016 const double &muf12=0.,const double &muf22=0.,
0017 const double &xf1=0.,const double &xf2=0.) :
0018 m_fl1(fl1), m_fl2(fl2), m_x1(x1), m_x2(x2),
0019 m_muf12(muf12), m_muf22(muf22), m_xf1(xf1), m_xf2(xf2) {}
0020 bool operator==(const PDF_Info& rhs) const;
0021 bool operator!=(const PDF_Info& rhs) const;
0022 };
0023
0024 std::ostream& operator<<(std::ostream&, const ATOOLS::PDF_Info&);
0025
0026 struct Weight_Info {
0027 Weights_Map m_weightsmap;
0028 double m_dxs, m_ntrial;
0029 PDF_Info m_pdf;
0030 Weight_Info(const Weights_Map &weightsmap={0.0},
0031 const double &dxs=0.0, const double &ntrial=0.0,
0032 const int &fl1=0, const int &fl2=0,
0033 const double &x1=0.,const double &x2=0.,
0034 const double &xf1=0.0,const double &xf2=0.0,
0035 const double &muf12=0.0,const double &muf22=0.0):
0036 m_weightsmap(weightsmap),
0037 m_dxs(dxs), m_ntrial(ntrial),
0038 m_pdf(PDF_Info(fl1,fl2,x1,x2,muf12,muf22,xf1,xf2)) {}
0039 bool operator==(const Weight_Info& rhs) const;
0040 bool operator!=(const Weight_Info& rhs) const;
0041 };
0042
0043 std::ostream& operator<<(std::ostream&, const ATOOLS::Weight_Info&);
0044
0045 struct mewgttype {
0046 enum code {
0047 none = 0,
0048 B = 1,
0049 VI = 2,
0050 KP = 4,
0051 DADS = 8,
0052 METS = 16,
0053 H = 32,
0054 RS = 64
0055 };
0056 };
0057
0058 inline mewgttype::code operator|(const mewgttype::code c1,
0059 const mewgttype::code c2)
0060 { return (mewgttype::code)((int)c1|(int)c2); }
0061 inline const mewgttype::code &operator|=(mewgttype::code &c1,
0062 const mewgttype::code c2)
0063 { return c1=(mewgttype::code)((int)c1|(int)c2); }
0064 inline mewgttype::code operator&(const mewgttype::code c1,
0065 const mewgttype::code c2)
0066 { return (mewgttype::code)((int)c1&(int)c2); }
0067 inline const mewgttype::code &operator&=(mewgttype::code &c1,
0068 const mewgttype::code c2)
0069 { return c1=(mewgttype::code)((int)c1&(int)c2); }
0070 inline mewgttype::code operator^(const mewgttype::code c1,
0071 const mewgttype::code c2)
0072 { return (mewgttype::code)((int)c1^(int)c2); }
0073 inline const mewgttype::code &operator^=(mewgttype::code &c1,
0074 const mewgttype::code c2)
0075 { return c1=(mewgttype::code)((int)c1^(int)c2); }
0076
0077 std::ostream & operator<<(std::ostream & s,const mewgttype::code & type);
0078
0079 struct Cluster_Step {
0080 public:
0081 double m_t,m_xa,m_xb,m_xap,m_xbp;
0082 int m_fla,m_flb;
0083 double m_pdfrationumerator, m_pdfratiodenominator;
0084 Cluster_Step(const double& t, const double& xa, const double& xb,
0085 const int& fla, const int& flb) :
0086 m_t(t), m_xa(xa), m_xb(xb), m_xap(-1.0), m_xbp(-1.0), m_fla(fla), m_flb(flb),
0087 m_pdfrationumerator(1.), m_pdfratiodenominator(1.) {}
0088 };
0089
0090 inline std::ostream & operator<<(std::ostream & s,
0091 const ATOOLS::Cluster_Step & cs)
0092 {
0093 return s<<"("<<cs.m_t<<";"<<cs.m_fla<<","<<cs.m_xa<<"|"
0094 <<cs.m_flb<<","<<cs.m_xb<<")";
0095 }
0096
0097 struct Cluster_Sequence_Info {
0098 public:
0099 double m_pdfwgt, m_flux, m_ct;
0100 std::vector<Cluster_Step> m_txfl;
0101
0102 Cluster_Sequence_Info(const double &w=1.0, const double &f=1.0,
0103 const double &c=0.0) :
0104 m_pdfwgt(w), m_flux(f), m_ct(c) {}
0105 inline void AddSplitting(const double& t,
0106 const double& xa, const double& xb,
0107 const int& fla, const int& flb)
0108 { m_txfl.push_back(Cluster_Step(t,xa,xb,fla,flb)); }
0109 inline void AddFlux(const double& f) { m_flux*=f; }
0110 inline void AddWeight(const double& w) { m_pdfwgt*=w; }
0111 inline void AddCounterTerm(const double& c,
0112 const double& xp, size_t i)
0113 { m_ct+=c;
0114 if (i==0) m_txfl.back().m_xap=xp;
0115 if (i==1) m_txfl.back().m_xbp=xp; }
0116 inline void AddPDFRatio(const double& n,const double& d)
0117 { m_txfl.back().m_pdfrationumerator=n;
0118 m_txfl.back().m_pdfratiodenominator=d; }
0119 };
0120
0121 std::ostream & operator<<(std::ostream & s,
0122 const ATOOLS::Cluster_Sequence_Info & csi);
0123
0124 struct DADS_Info {
0125 public:
0126 double m_wgt, m_x1, m_x2;
0127 long unsigned int m_fl1, m_fl2;
0128 DADS_Info(const double &wgt,
0129 const double &x1,const double &x2,
0130 const long unsigned int &fl1, const long unsigned int &fl2):
0131 m_wgt(wgt), m_x1(x1), m_x2(x2), m_fl1(fl1), m_fl2(fl2) {}
0132 };
0133
0134 inline std::ostream & operator<<(std::ostream & s,
0135 const ATOOLS::DADS_Info & dadsi)
0136 {
0137 s<<"DADS: wgt="<<dadsi.m_wgt<<", x1="<<dadsi.m_x1<<", x2="<<dadsi.m_x2
0138 <<", fl1="<<dadsi.m_fl1<<", fl2="<<dadsi.m_fl2;
0139 return s;
0140 }
0141
0142 struct RDA_Info {
0143 public:
0144 double m_wgt, m_mur2, m_muf12, m_muf22;
0145 Cluster_Sequence_Info m_csi;
0146 size_t m_i,m_j,m_k;
0147 RDA_Info(const double &wgt,const double &mur2,
0148 const double &muf12,const double &muf22,
0149 const size_t &i,const size_t &j, const size_t &k):
0150 m_wgt(wgt), m_mur2(mur2), m_muf12(muf12), m_muf22(muf22),
0151 m_csi(), m_i(i) ,m_j(j) ,m_k(k) {}
0152 };
0153
0154 inline std::ostream & operator<<(std::ostream & s,
0155 const ATOOLS::RDA_Info & rdai)
0156 {
0157 s<<"RDA("<<rdai.m_i<<","<<rdai.m_j<<","<<rdai.m_k<<"): "
0158 <<"wgt="<<rdai.m_wgt<<", muR2="<<rdai.m_mur2
0159 <<", muF12="<<rdai.m_muf12<<", muF22="<<rdai.m_muf22
0160 <<"\n "<<rdai.m_csi;
0161 return s;
0162 }
0163
0164 struct ME_Weight_Info {
0165 public:
0166 mewgttype::code m_type;
0167 int m_relqcdcpl;
0168 double m_B, m_VI, m_KP, m_K;
0169 std::vector<double> m_wren,m_wfac,m_wass,m_bkw;
0170 double m_x1, m_x2, m_y1, m_y2, m_mur2, m_muf2;
0171 int m_fl1, m_fl2, m_swap;
0172 size_t m_oqcd, m_oew;
0173 Cluster_Sequence_Info m_clusseqinfo;
0174 std::vector<DADS_Info> m_dadsinfos;
0175 std::vector<RDA_Info> m_rdainfos;
0176 ME_Weight_Info():
0177 m_type(mewgttype::none), m_relqcdcpl(0),
0178 m_B(0.0), m_VI(0.0), m_KP(0.0), m_K(0.0),
0179 m_wren(2,0.0), m_wfac(32,0.0), m_wass(4,0.0),
0180 m_x1(1.0), m_x2(1.0), m_y1(1.0), m_y2(1.0),
0181 m_mur2(0.0), m_muf2(0.0), m_fl1(0), m_fl2(0),
0182 m_swap(0), m_oqcd(0), m_oew(0), m_clusseqinfo() {}
0183 ME_Weight_Info& operator*=(const double &scal);
0184 void Reset();
0185 };
0186
0187 std::ostream & operator<<(std::ostream & s,
0188 const ATOOLS::ME_Weight_Info & mwi);
0189 }
0190
0191 #endif
0192