Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef COMIX_Phasespace_PS_Channel_H
0002 #define COMIX_Phasespace_PS_Channel_H
0003 
0004 #include "PHASIC++/Channels/Single_Channel.H"
0005 #include "COMIX/Phasespace/PS_Generator.H"
0006 #include "PHASIC++/Channels/Vegas.H"
0007 #include "ATOOLS/Org/CXXFLAGS.H"
0008 
0009 namespace PHASIC { class Color_Integrator; }
0010 
0011 namespace COMIX {
0012 
0013   class Process_Base;
0014   class PS_Current;
0015   class PS_Vertex;
0016 
0017   typedef std::vector<Double_Vector> Double_Matrix;
0018 
0019   typedef std::vector<PHASIC::Vegas*>          Vegas_Vector;
0020   typedef std::map<std::string,PHASIC::Vegas*> Vegas_Map;
0021 
0022   typedef std::map<const Current*,PHASIC::Vegas*> CVegas_Map;
0023   typedef std::map<const Vertex*,PHASIC::Vegas*>  VVegas_Map;
0024   typedef std::map<size_t,PHASIC::Vegas*>         IVegas_Map;
0025   typedef std::map<size_t,CVegas_Map>             ICVegas_Map;
0026   typedef std::map<size_t,VVegas_Map>             IVVegas_Map;
0027 
0028   typedef std::map<ATOOLS::NLO_subevt*,CVegas_Map>  SCVegas_Map;
0029   typedef std::map<ATOOLS::NLO_subevt*,ICVegas_Map> SICVegas_Map;
0030 
0031   typedef std::map<size_t,std::vector<int> > CId_Map;
0032 
0033   typedef std::map<size_t,const METOOLS::Current*> STCC_Map;
0034 
0035   class PS_Channel: public PHASIC::Single_Channel {
0036   private:
0037 
0038     void RegisterDefaults() const;
0039 
0040   protected:
0041 
0042     Process_Base   *p_xs;
0043     Current_Matrix *p_cur;
0044 
0045     Vertex_Vector  m_vtc;
0046     Vegas_Map      m_vmap;
0047 
0048     SCVegas_Map  m_pcmap;
0049     IVegas_Map   m_pimap;
0050     IVVegas_Map  m_sicmap;
0051     SICVegas_Map m_ticmap;
0052 
0053     PHASIC::Cut_Data *p_cuts;
0054 
0055     ATOOLS::Vec4D_Vector m_p;
0056     std::vector<double> m_s;
0057 
0058     Double_Matrix m_rns;
0059     Vegas_Vector  m_vgs;
0060 
0061     size_t m_n, m_nr, m_num, m_lid, m_rid;
0062     double m_texp, m_stexp, m_sexp, m_thexp, m_mfac;
0063     double m_aexp, m_srbase, m_speak;
0064 
0065     int m_bmode, m_omode, m_tmode, m_vmode, m_zmode, m_czmode;
0066     int m_nvints, m_vsopt, m_nopt;
0067 
0068     std::shared_ptr<PS_Generator> p_gen;
0069 
0070     CId_Map  *p_cid;
0071     
0072     const std::vector<int> &GetCId(const size_t &id);
0073 
0074     inline size_t CIdCount(const size_t &id) { return GetCId(id).size(); }
0075 
0076     size_t SId(const size_t &id) const;
0077     double SCut(const size_t &id);
0078 
0079     void FillMoms(const size_t &aid,Int_Vector &cur,size_t n);
0080 
0081     double PropMomenta(const PS_Current *cur,const size_t &id,
0082                const double &smin,const double &smax,const double *rn);
0083     double PropWeight(const PS_Current *cur,const size_t &id,
0084               const double &smin,const double &smax,const double &s);
0085 
0086     void TChannelBounds(const size_t &aid,const size_t &lid,
0087             double &ctmin,double &ctmax,
0088             const ATOOLS::Vec4D &pa,const ATOOLS::Vec4D &pb,
0089             const double &s1,const double &s2);
0090     void SingleTChannelBounds(const size_t &aid,const size_t &lid,
0091                   double &ctmin,double &ctmax,
0092                   const ATOOLS::Vec4D &pa,const ATOOLS::Vec4D &pb,
0093                   const double &s1,const double &s2,const int mode);
0094     void TChannelMomenta(PS_Current *cur,ATOOLS::NLO_subevt *const dip,
0095              const size_t &id,const size_t &aid,
0096              const ATOOLS::Vec4D &pa,const ATOOLS::Vec4D &pb,
0097              ATOOLS::Vec4D &p1,ATOOLS::Vec4D &p2,
0098              const double &s1,const double &s2,
0099              const double *rns);
0100     double TChannelWeight(PS_Current *cur,ATOOLS::NLO_subevt *const dip,
0101               const size_t &id,const size_t &aid,
0102               const ATOOLS::Vec4D &pa,const ATOOLS::Vec4D &pb,
0103               ATOOLS::Vec4D &p1,ATOOLS::Vec4D &p2,
0104               const double &s1,const double &s2);
0105 
0106     void SChannelBounds(const size_t &id,const size_t &lid,
0107             double &ctmin,double &ctmax);
0108     void SChannelMomenta(PS_Current *cur,PS_Vertex *v,
0109              const ATOOLS::Vec4D &pa,ATOOLS::Vec4D &p1,
0110              ATOOLS::Vec4D &p2,const double &s1,
0111              const double &s2,const double *rns);
0112     double SChannelWeight(PS_Current *cur,PS_Vertex *v,
0113               const ATOOLS::Vec4D &p1,const ATOOLS::Vec4D &p2);
0114 
0115     bool GeneratePoint(PS_Current *const ja,PS_Current *const jb,
0116                PS_Current *const jc,PS_Vertex *const v,size_t &nr);
0117     double GenerateWeight(PS_Current *const ja,PS_Current *const jb,
0118               PS_Current *const jc,PS_Vertex *const v,size_t &nr);
0119     
0120     bool GenerateWeight(PS_Current *const cur);
0121     bool GenerateWeight();
0122 
0123     bool GeneratePoint(const size_t &id,size_t &nr,Vertex_Vector &v);
0124     bool GeneratePoint(Vertex_Vector v);
0125 
0126     bool GenerateChannel(Current *const cur,Vertex_Vector &v);
0127     bool GenerateChannel(Vertex_Vector &v);
0128     bool GenerateChannels();
0129 
0130     bool Zero(METOOLS::Vertex *const vtx) const;
0131 
0132     PHASIC::Vegas *GetVegas(const std::string &tag,int nd=1);
0133 
0134     PHASIC::Vegas *GetPVegas(const PS_Current *cur,const size_t &id);
0135     PHASIC::Vegas *GetSVegas(const PS_Vertex *v);
0136     PHASIC::Vegas *GetTVegas(const size_t &id,const PS_Current *cur,
0137                  ATOOLS::NLO_subevt *const dip);
0138 
0139   public :
0140 
0141     // constructor
0142     PS_Channel(const size_t &nin,const size_t &nout,
0143            ATOOLS::Flavour *fl,Process_Base *const ps); 
0144 
0145     // destructor
0146     ~PS_Channel();
0147 
0148     // member functions
0149     void GeneratePoint(ATOOLS::Vec4D *p,PHASIC::Cut_Data *cuts,double *rn);
0150     void GenerateWeight(ATOOLS::Vec4D *p,PHASIC::Cut_Data *cuts);
0151 
0152     void ISRInfo(int &type,double &m,double &w);
0153     void ISRInfo(std::vector<int> &ts,
0154          std::vector<double> &ms,std::vector<double> &ws) const;
0155 
0156     int  ChNumber();
0157     void SetChNumber(int n);
0158 
0159     std::string ChID();
0160 
0161     const size_t NChannels() const;
0162 
0163     void AddPoint(double value);
0164 
0165     void MPISync();
0166     void Optimize();
0167     void EndOptimize();
0168     bool OptimizationFinished();
0169 
0170     void WriteOut(std::string pid);
0171     void ReadIn(std::string pid);
0172 
0173   };// end of class PS_Channel
0174 
0175 }// end of namespace COMIX
0176 
0177 #endif