Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef PHASIC_Process_YFS_Process_H
0002 #define PHASIC_Process_YFS_Process_H
0003 
0004 
0005 
0006 #include "PHASIC++/Process/Process_Base.H"
0007 #include "SHERPA/PerturbativePhysics/Matrix_Element_Handler.H"
0008 #include "ATOOLS/Phys/Variations.H"
0009 namespace ATOOLS {
0010   class Hard_Process_Variation_Generator_Base;
0011 }
0012 
0013 
0014 namespace MODEL {
0015   class Single_Vertex;
0016   typedef std::vector<Single_Vertex *> Vertex_List;
0017 }
0018 
0019 
0020 namespace PHASIC {
0021 
0022   class ME_Generators;
0023 
0024   class YFS_Process : public Process_Base {
0025   private:
0026 
0027     //! Reference to the matrix element generators
0028     ME_Generators &m_gens;
0029 
0030 
0031     //! Book-keeping variables for last RS, B, VI contributions
0032     double m_lastrs, m_lastb, m_lastvi;
0033     //! Switches for the behaviour of this class
0034     int    m_fomode, m_hpsmode, m_kfacmode;
0035     //! Book-keeping to track whether event was S or H
0036     bool   m_wassevent;
0037     //! Separate scale for RS events
0038     std::string m_rsscale;
0039     ME_Generator_Base *p_gen;
0040     
0041     //! Map of integrated dipoles
0042     ATOOLS::StringIDipSet_Map m_iinfo;
0043     //! Map of differential dipoles
0044     ATOOLS::StringDDipSet_Map m_dinfo;
0045 
0046     //! Cluster amplitude for interface with YFS
0047     ATOOLS::Cluster_Amplitude *p_ampl, *p_rampl;
0048       //! Generate cluster sequence info (containing the ISR+beam weight)
0049     ATOOLS::Cluster_Sequence_Info ClusterSequenceInfo(
0050         const ATOOLS::ClusterAmplitude_Vector &,
0051         const double &Q2,
0052         const double &muf2fac=1.0,
0053         const double &mur2fac=1.0,
0054         const double &showermuf2fac=1.0,
0055         MODEL::Running_AlphaS * as=NULL,
0056         const ATOOLS::Cluster_Sequence_Info * const nominalcsi=NULL);
0057  
0058     public:
0059     YFS::YFS_Handler  *p_yfs;
0060     YFS_Process(ME_Generators &gens,NLOTypeStringProcessMap_Map *pmap);
0061     void Init(const Process_Info &pi,
0062               BEAM::Beam_Spectra_Handler *const beam,
0063               PDF::ISR_Handler *const isr,
0064               YFS::YFS_Handler *const yfs, const int mode=0) override;
0065 
0066     ~YFS_Process();
0067     void RegisterDefaults();
0068     Process_Base     *p_bornproc, *p_realproc, *p_virtproc;
0069     Process_Base* Selected();
0070     /*!
0071      * @return Returns true
0072      *
0073      * This method initialises m_iinfo and m_dinfo
0074      */
0075     bool InitSubtermInfo();
0076     void FindResonances();
0077     void FindProcessPossibleResonances(const Flavour_Vector& fv, MODEL::Vertex_List& vlist);
0078     void InitPSHandler(const double &maxerror,
0079                const std::string eobs,
0080                const std::string efunc) override;
0081     void OneRealEvent();
0082     inline Process_Base* GetBornProcess() {return p_bornproc;}
0083     inline Process_Base* GetRealProcess() {return p_realproc;}
0084     inline Process_Base* GetVirtProcess() {return p_virtproc;}
0085     /*!
0086      * @return Returns true
0087      *
0088      * Inherited from Process_Base, returns whether this process has subprocesses
0089      */
0090     bool IsGroup() const override;
0091     /*!
0092      * @return Returns 2
0093      *
0094      * Inherited from Process_Base, returns the number of subprocesses
0095      */
0096     size_t Size() const override;
0097     /*!
0098      * @param i size_t Index
0099      * @return Returns true
0100      *
0101      * Inherited from Process_Base, returns p_bviproc (i=0) or p_rsproc (i=1)
0102      */
0103     Process_Base *operator[](const size_t &i) override;
0104 
0105     /*!
0106      * @param wmode int Passed on to methods called
0107      * @param mode int Passed on to methods called
0108      * @return Returns weight information object
0109      *
0110      * Inherited from Process_Base, generates one event
0111      */
0112     ATOOLS::Weight_Info *OneEvent(const int wmode, ATOOLS::Variations_Mode varmode, const int mode=0) override;
0113 
0114     /*!
0115      * @param p Vec4D_Vector Four momenta
0116      * @return Returns weight of given momentum configuration
0117      *
0118      * Inherited from Process_Base, calculates the weight of given configuration
0119      // */
0120     ATOOLS::Weights_Map Differential(const ATOOLS::Vec4D_Vector&,
0121                                      ATOOLS::Variations_Mode) override;
0122     
0123     double m_lastxs, m_lastbxs, m_dsweight, m_lastflux, m_lastyfs;
0124 
0125     /*!
0126      * @param resultpath string Path where to store the results
0127      * @param create bool Whether to create the results file or not
0128      * @return Returns weight information object
0129      *
0130      * Inherited from Process_Base, asks subprocesses to integrate themselves
0131      */
0132     bool CalculateTotalXSec(const std::string &resultpath,
0133                             const bool create=false) override;
0134     /*!
0135      * @param lookup bool Whether results can be looked up
0136      *
0137      * Inherited from Process_Base, set whether mapped processes lookup their
0138      * result or calculate anew, sets it for all subprocesses
0139      */
0140     void SetLookUp(const bool lookup) override;
0141     /*!
0142      * Inherited from Process_Base, calls InitScale for all subprocesses
0143      */
0144     bool InitScale() override;
0145     /*!
0146      * @param scale Scale_Setter_Arguments Scale setter arguments
0147      *
0148      * Inherited from Process_Base, calls SetScale for all subprocesses
0149      */
0150     void SetScale(const Scale_Setter_Arguments &scale) override;
0151     /*!
0152      * @param args KFactor_Setter_Arguments KFactor setter arguments
0153      *
0154      * Inherited from Process_Base, calls SetKFactor for all subprocesses
0155      */
0156     void SetKFactor(const KFactor_Setter_Arguments &args) override;
0157     /*!
0158      * @param s vector<double> Fixed scales
0159      *
0160      * Inherited from Process_Base, calls SetFixedScale for all subprocesses
0161      */
0162     void SetFixedScale(const std::vector<double> &s) override;
0163     /*!
0164      * @param key Selector_Key Selector key
0165      *
0166      * Inherited from Process_Base, calls SetSelector for all subprocesses
0167      */
0168     void SetSelector(const Selector_Key &key) override;
0169     /*!
0170      * @param ps Shower_Base Parton shower
0171      *
0172      * Inherited from Process_Base, calls SetShower for all subprocesses
0173      */
0174     void SetShower(PDF::Shower_Base *const ps) override;
0175     void SetNLOMC(PDF::NLOMC_Base *const mc) override;
0176     void SetGenerator(ME_Generator_Base *const gen) override;
0177     inline ME_Generator_Base * Generator() { PRINT_INFO("HERE"); return p_gen;}
0178     void InitializeTheReweighting(ATOOLS::Variations_Mode mode) override;
0179     std::vector<ATOOLS::Hard_Process_Variation_Generator_Base*>
0180       m_hard_process_variation_generators;
0181     // double Partonic(const ATOOLS::Vec4D_Vector &p, int);
0182     /*!
0183      * @param ampl Cluster_Amplitude Cluster amplitude
0184      * @return Local KFactor
0185      *
0186      * This method calculates the local Kfactor for MENLOPS for given config
0187      */
0188     double LocalKFactor(const ATOOLS::Cluster_Amplitude &ampl);
0189     Process_Base* InitProcess(const Process_Info &pi,ATOOLS::nlo_type::code nlotype,const bool real);
0190     /*!
0191 
0192      * @param sub NLO_subevt NLO subevent for which the cluster amplitude
0193      *                       should be constructed
0194      * @return Pointer to cluster amplitude constructed
0195      *
0196      * This method constructs a cluster amplitude for the given NLO subevent
0197      */
0198     ATOOLS::Cluster_Amplitude *CreateAmplitude
0199     (const ATOOLS::NLO_subevt *sub) const;
0200     /*!
0201      * @return Cluster amplitude p_ampl
0202      *
0203      * This method return p_ampl
0204      */
0205     ATOOLS::Cluster_Amplitude *GetAmplitude();
0206     };
0207 }
0208 
0209 #endif