Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef CSSHOWER_Showers_SF_Coupling_H
0002 #define CSSHOWER_Showers_SF_Coupling_H
0003 
0004 #include "CSSHOWER++/Showers/SF_Key.H"
0005 #include "ATOOLS/Org/Getter_Function.H"
0006 #include "ATOOLS/Phys/Flavour.H"
0007 
0008 namespace CSSHOWER {
0009 
0010   class SF_Lorentz;
0011 
0012   class SF_Coupling {
0013   protected:
0014 
0015     SF_Lorentz *p_lf;
0016 
0017     cstp::code m_type;
0018     double     m_cplfac, m_last;
0019 
0020     int        m_kfmode;
0021     /**
0022       * m_cplmax[i] = max_{scale} Coupling(scale, i)
0023       */
0024     std::vector<double> m_cplmax;
0025 
0026   public:
0027 
0028     SF_Coupling(const SF_Key &key);
0029 
0030     virtual ~SF_Coupling();
0031 
0032     virtual bool SetCoupling(MODEL::Model_Base *md,
0033                  const double &k0sqi,const double &k0sqf,
0034                  const double &isfac,const double &fsfac) = 0;
0035 
0036     //! Subclasses can return true if they support alternative couplings to be used (e.g. for reweighting)
0037     virtual bool AllowsAlternativeCouplingUsage() const { return false; }
0038     /*!
0039      * Use an alternative coupling
0040      *
0041      * @param cpl See subclass implementation(s) for the accepted pointer type.
0042      * @param sf An optional scale factor, see subclass implementations for the
0043      * concrete meaning of this argument.
0044      * Passing NULL ends the use of the alternative coupling.
0045      */
0046     virtual void SetAlternativeUnderlyingCoupling(void * cpl, double sf=1.0) {}
0047 
0048     virtual double Coupling(const double &scale,const int pol) = 0;
0049     virtual bool AllowSpec(const ATOOLS::Flavour &fl,const int mode=0) = 0;
0050 
0051     //! Last unpolarized coupling value
0052     double Last() const { return m_last; }
0053 
0054     //! Set last unpolarized coupling value
0055     void SetLast(double last) { m_last = last; }
0056 
0057     virtual double CplFac(const double &scale) const;
0058 
0059     inline double MaxCoupling(const int mode) const { return m_cplmax[mode]; }
0060 
0061     inline void SetLF(SF_Lorentz *const lf) { p_lf=lf; }
0062 
0063     inline double CplFac() const { return m_cplfac; }
0064 
0065     inline double Last() { return m_last; }
0066 
0067   };
0068 
0069   typedef ATOOLS::Getter_Function<SF_Coupling,SF_Key,
0070                   std::less<std::string> > SFC_Getter;
0071 
0072   // NOTE: SFC_Filler_Key/Getter allow for specifying SF_Coupling Getters
0073   // (SFC_Getter) during run-time; this is triggered via calling
0074   // SVC_Filler_Getter's GetObject in Sudakov::InitSplittingFunctions.
0075   // This usage is highly unintuitive (and should probably be refactored),
0076   // therefore we document it here.
0077 
0078   struct SFC_Filler_Key {
0079     const MODEL::Model_Base *p_md;
0080     std::vector<SFC_Getter*> *p_gets;
0081     inline SFC_Filler_Key(const MODEL::Model_Base *const md,
0082               std::vector<SFC_Getter*> *const gets):
0083       p_md(md), p_gets(gets) {}
0084   };
0085 
0086   typedef ATOOLS::Getter_Function
0087   <void,SFC_Filler_Key,std::less<std::string> > SFC_Filler_Getter;
0088 
0089 }
0090 
0091 #define DECLARE_CPL_GETTER(NAME)                    \
0092                                     \
0093   class NAME: public ATOOLS::Getter_Function                \
0094   <SF_Coupling,SF_Key,std::less<std::string> > {            \
0095   protected:                                \
0096     void PrintInfo(std::ostream &str,const size_t width) const;     \
0097     Object_Type *                           \
0098       operator()(const Parameter_Type &parameters) const;       \
0099   public:                               \
0100     NAME(const std::string &name):                  \
0101       ATOOLS::Getter_Function<SF_Coupling,SF_Key,           \
0102       std::less<std::string> >(name) {}                 \
0103   }
0104 
0105 #endif