Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:24:16

0001 // -*- C++ -*-
0002 //
0003 // MEqq2W2ffPowheg.h is a part of Herwig - A multi-purpose Monte Carlo event generator
0004 // Copyright (C) 2002-2019 The Herwig Collaboration
0005 //
0006 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef HERWIG_MEqq2W2ffPowheg_H
0010 #define HERWIG_MEqq2W2ffPowheg_H
0011 //
0012 // This is the declaration of the MEqq2W2ffPowheg class.
0013 //
0014 
0015 #include "Herwig/MatrixElement/Hadron/MEqq2W2ff.h"
0016 #include "ThePEG/PDF/BeamParticleData.h"
0017 
0018 namespace Herwig {
0019 using namespace ThePEG;
0020 
0021 /**
0022  * The MEqq2W2ffPowheg class implements the matrix element for \f$q\bar{q'}\to W^\pm\f$
0023  * including the decay of the \f$W^\pm\f$ to Standard Model fermions.
0024  *
0025  * @see \ref MEqq2W2ffPowhegInterfaces "The interfaces"
0026  * defined for MEqq2W2ffPowheg.
0027  */
0028 class MEqq2W2ffPowheg: public MEqq2W2ff {
0029 
0030 public:
0031 
0032   /**
0033    * The default constructor.
0034    */
0035   MEqq2W2ffPowheg();
0036 
0037   /** @name Virtual functions required by the MEBase class. */
0038   //@{
0039   /**
0040    * Return the scale associated with the last set phase space point.
0041    */
0042   virtual Energy2 scale() const;
0043 
0044   /**
0045    * The number of internal degreed of freedom used in the matrix
0046    * element.
0047    */
0048   virtual int nDim() const;
0049 
0050   /**
0051    * Generate internal degrees of freedom given 'nDim()' uniform
0052    * random numbers in the interval ]0,1[. To help the phase space
0053    * generator, the 'dSigHatDR()' should be a smooth function of these
0054    * numbers, although this is not strictly necessary. Return
0055    * false if the chosen points failed the kinematical cuts.
0056    */
0057   virtual bool generateKinematics(const double * r);
0058 
0059   /**
0060    * Return the matrix element for the kinematical configuation
0061    * previously provided by the last call to setKinematics(). Uses
0062    * me().
0063    */
0064   virtual CrossSection dSigHatDR() const;
0065   //@}
0066 
0067 public:
0068 
0069   /** @name Functions used by the persistent I/O system. */
0070   //@{
0071   /**
0072    * Function used to write out object persistently.
0073    * @param os the persistent output stream written to.
0074    */
0075   void persistentOutput(PersistentOStream & os) const;
0076 
0077   /**
0078    * Function used to read in object persistently.
0079    * @param is the persistent input stream read from.
0080    * @param version the version number of the object when written.
0081    */
0082   void persistentInput(PersistentIStream & is, int version);
0083   //@}
0084 
0085   /**
0086    * The standard Init function used to initialize the interfaces.
0087    * Called exactly once for each class by the class description system
0088    * before the main function starts or
0089    * when this class is dynamically loaded.
0090    */
0091   static void Init();
0092 
0093 protected:
0094 
0095   /**
0096    * Calculate the correction weight with which leading-order
0097    * configurations are re-weighted.
0098    */
0099   double NLOweight() const;
0100   /**
0101    * Calculate the variable \f$x=M_{B}^2/s\f$ from the integration variables. 
0102    */
0103   double x(double xt, double v) const;
0104   /**
0105    * Calculate the momentum fraction of the first parton. 
0106    */
0107   double x_a(double x, double v) const;
0108   /**
0109    * Calculate the momentum fraction of second parton. 
0110    */
0111   double x_b(double x, double v) const;
0112   /**
0113    * Calculate the minimum of \f$x\f$. 
0114    */
0115   double xbar(double v) const;
0116   /**
0117    * Calculate the ratio of the radiative luminosity funcion to the
0118    * Born luminosity function for the \f$qg\f$ initiated channel. 
0119    */
0120   double Ltilde_qg(double x, double v) const;
0121   /**
0122    * Calculate the ratio of the radiative luminosity funcion to the
0123    * Born luminosity function for the \f$g\bar{q}\f$ initiated channel. 
0124    */
0125   double Ltilde_gq(double x, double v) const;
0126   /**
0127    * Calculate the ratio of the radiative luminosity funcion to the
0128    * Born luminosity function for the \f$q\bar{q}\f$ initiated channel. 
0129    */
0130   double Ltilde_qq(double x, double v) const;
0131   /**
0132    * Calculate the soft-virtual contribution to the NLO weight. 
0133    */
0134   double Vtilde_qq() const;
0135   /**
0136    * Function for calculation of the \f$g\bar{q}\f$ and \f$g\bar{q}\f$ 
0137    * initiated real contribution.
0138    */
0139   double Ccalbar_qg(double x) const;
0140   /**
0141    * Function for calculation of the \f$qg\f$ 
0142    * initiated real contribution.
0143    */
0144   double Fcal_qg(double x, double v) const;
0145   /**
0146    * Function for calculation of the \f$g\bar{q}\f$ initiated real
0147    * contribution.
0148    */
0149   double Fcal_gq(double x, double v) const;
0150   /**
0151    * Function for calculation of the \f$q\bar{q}\f$ initiated real
0152    * contribution.
0153    */
0154   double Fcal_qq(double x, double v) const;
0155   /**
0156    * Function for calculation of the \f$qg\f$ initiated real
0157    * contribution.
0158    */
0159   double Ftilde_qg(double xt, double v) const;
0160   /**
0161    * Function for calculation of the \f$g\bar{q}\f$ initiated real
0162    * contribution.
0163    */
0164   double Ftilde_gq(double xt, double v) const;
0165   /**
0166    * Function for calculation of the \f$q\bar{q}\f$ initiated real
0167    * contribution.
0168    */
0169   double Ftilde_qq(double xt, double v) const;
0170   /**
0171    * Function for calculation of the \f$qg\f$ initiated real
0172    * contribution.
0173    */
0174   double Ctilde_qg(double x, double v) const;
0175   /**
0176    * Function for calculation of the \f$g\bar{q}\f$ initiated real
0177    * contribution.
0178    */
0179   double Ctilde_gq(double x, double v) const;
0180   /**
0181    * Function for calculation of the \f$q\bar{q}\f$ initiated real
0182    * contribution.
0183    */
0184   double Ctilde_qq(double x, double v) const;
0185 
0186 protected:
0187 
0188   /** @name Clone Methods. */
0189   //@{
0190   /**
0191    * Make a simple clone of this object.
0192    * @return a pointer to the new object.
0193    */
0194   virtual IBPtr clone() const { return new_ptr(*this); }
0195 
0196   /** Make a clone of this object, possibly modifying the cloned object
0197    * to make it sane.
0198    * @return a pointer to the new object.
0199    */
0200   virtual IBPtr fullclone() const { return new_ptr(*this); }
0201   //@}
0202 
0203 protected:
0204 
0205   /** @name Standard Interfaced functions. */
0206   //@{
0207   /**
0208    * Initialize this object after the setup phase before saving an
0209    * EventGenerator to disk.
0210    * @throws InitException if object could not be initialized properly.
0211    */
0212   virtual void doinit();
0213   //@}
0214 
0215 private:
0216 
0217   /**
0218    * The assignment operator is private and must never be called.
0219    * In fact, it should not even be implemented.
0220    */
0221   MEqq2W2ffPowheg & operator=(const MEqq2W2ffPowheg &) = delete;
0222 
0223 private:
0224   
0225   /**
0226    *  The momentum fraction of the first parton in the Born process
0227    */
0228   mutable double _xb_a;
0229 
0230   /**
0231    *  The momentum fraction of the second parton in the Born process
0232    */
0233   mutable double _xb_b;
0234 
0235   /**
0236    *  The ParticleData object for the first parton in the Born process
0237    */
0238   mutable tcPDPtr _parton_a;
0239 
0240   /**
0241    *  The ParticleData object for the second parton in the Born process
0242    */
0243   mutable tcPDPtr _parton_b;
0244 
0245   /**
0246    *  The BeamParticleData object for the first  hadron
0247    */
0248   mutable Ptr<BeamParticleData>::transient_const_pointer _hadron_A;
0249 
0250   /**
0251    *  The BeamParticleData object for the second hadron
0252    */
0253   mutable Ptr<BeamParticleData>::transient_const_pointer _hadron_B;
0254 
0255   /**
0256    *  the ParticleData object for the gluon
0257    */
0258   tcPDPtr _gluon;
0259 
0260   /**
0261    * The \f$T_R\f$ colour factor
0262    */
0263   const double TR_;
0264 
0265   /**
0266    *  The \f$C_F\f$ colour factor
0267    */
0268   const double CF_;
0269 
0270   /**
0271    *  The value of \f$\frac{\alpha_S}{2\pi}\f$ used for the calculation
0272    */
0273   mutable double _alphaS2Pi;
0274 
0275   /**
0276    *  The mass squared of the lepton pair
0277    */
0278   mutable Energy2 _mll2;
0279 
0280   /**  
0281    * The renormalization/factorization scale
0282    */
0283   mutable Energy2 _mu2;
0284 
0285   /**
0286    *  Parameters for the NLO weight
0287    */
0288   //@{
0289   /**
0290    *  Whether to generate the positive, negative or leading order contribution
0291    */
0292   unsigned int _contrib;
0293 
0294   /**
0295    *  Whether to use a fixed or a running QCD coupling for the NLO weight
0296    */
0297   unsigned int _nlo_alphaS_opt;
0298 
0299   /**
0300    *  The value of alphaS to use for the nlo weight if _nloalphaSopt=1
0301    */
0302   double _fixed_alphaS;
0303 
0304   /**
0305    *  The magnitude of the correction term to reduce the negative contribution
0306    */
0307   double _a;
0308 
0309   /**
0310    *  The power of the correction term to reduce the negative contribution
0311    */
0312   double _p;
0313 
0314   /**
0315    *  Cut-off for the correction function
0316    */
0317   double _eps;
0318   //@}
0319 
0320   /**
0321    *  Choice of the scale
0322    */
0323   //@{
0324   /**
0325    *  Type of scale
0326    */
0327   unsigned int _scaleopt;
0328 
0329   /**
0330    *  Fixed scale if used
0331    */
0332   Energy _fixedScale;
0333 
0334   /**
0335    *  Prefactor if variable scale used
0336    */
0337   double _scaleFact;
0338   //@}
0339 
0340   /**
0341    *  Radiation variables
0342    */
0343   //@{
0344   /**
0345    *   The \f$\tilde{x}\f$ variable
0346    */
0347   double _xt;
0348 
0349   /**
0350    *  The \f$v\f$ angular variable
0351    */
0352   double _v;
0353   //@}
0354 
0355   /**
0356    *  Values of the PDF's before radiation
0357    */
0358   //@{
0359   /**
0360    *  For the quark
0361    */
0362   mutable double _oldq;
0363 
0364   /**
0365    *  For the antiquark
0366    */
0367   mutable double _oldqbar;
0368   //@}
0369 };
0370 
0371 }
0372 
0373 #endif /* HERWIG_MEqq2W2ffPowheg_H */