Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 #ifndef HERWIG_DrellYanBase_H
0003 #define HERWIG_DrellYanBase_H
0004 //
0005 // This is the declaration of the DrellYanBase class.
0006 //
0007 
0008 #include "HwMEBase.h"
0009 #include "Herwig/Shower/ShowerAlpha.h"
0010 
0011 namespace Herwig {
0012 
0013 using namespace ThePEG;
0014 
0015 /**
0016  * The DrellYanBase class class provides a base class for the implemented
0017  * of Drell-Yan type processes and provides the matrix element and POWHEG
0018  * style hard corrections
0019  *
0020  * @see \ref DrellYanBaseInterfaces "The interfaces"
0021  * defined for DrellYanBase.
0022  */
0023 class DrellYanBase: public HwMEBase {
0024 
0025 public:
0026 
0027   /**
0028    * The default constructor.
0029    */
0030   DrellYanBase();
0031 
0032   /**
0033    *  Has a POWHEG style correction
0034    */
0035   //virtual bool hasPOWHEGCorrection() {return _alpha;}
0036 
0037   virtual POWHEGType hasPOWHEGCorrection() {return ISR;}
0038 
0039 
0040   /**
0041    *  Has an old fashioned ME correction
0042    */
0043   virtual bool hasMECorrection() {return _alpha;}
0044 
0045   /**
0046    *  Initialize the ME correction
0047    */
0048   virtual void initializeMECorrection(RealEmissionProcessPtr, double & initial,
0049                       double & final) {
0050     final   = 1.;
0051     initial = 1.;
0052   }
0053 
0054   /**
0055    *  Apply the hard matrix element correction to a given hard process or decay
0056    */
0057   virtual RealEmissionProcessPtr applyHardMatrixElementCorrection(RealEmissionProcessPtr);
0058 
0059   /**
0060    * Apply the soft matrix element correction
0061    * @param parent The initial particle in the current branching
0062    * @param progenitor The progenitor particle of the jet
0063    * @param fs Whether the emission is initial or final-state
0064    * @param highestpT The highest pT so far in the shower
0065    * @param ids ids of the particles produced in the branching
0066    * @param z The momentum fraction of the branching
0067    * @param scale the evolution scale of the branching
0068    * @param pT The transverse momentum of the branching
0069    * @return If true the emission should be vetoed
0070    */
0071   virtual bool softMatrixElementVeto(PPtr parent,
0072                      PPtr progenitor,
0073                      const bool & fs,
0074                      const Energy & highestpT,
0075                      const vector<tcPDPtr> & ids,
0076                      const double & z,
0077                      const Energy & scale,
0078                      const Energy & pT);
0079 
0080   /**
0081    *  Apply the POWHEG style correction
0082    */
0083   virtual RealEmissionProcessPtr generateHardest(RealEmissionProcessPtr,
0084                          ShowerInteraction);
0085 
0086   /**
0087    * Set the typed and momenta of the incoming and outgoing partons to
0088    * be used in subsequent calls to me() and colourGeometries()
0089    * according to the associated XComb object.
0090    */
0091   virtual void setKinematics() {
0092     HwMEBase::setKinematics();
0093     mb2_ = sHat();
0094   }
0095 
0096 protected:
0097 
0098   /**
0099    *  Return the momenta and type of hard matrix element correction
0100    * @param quarks The original incoming particles.
0101    * @param beams The BeamParticleData objects
0102    * @param boson The momentum of the original outgoing gauge boson
0103    * @param iemit Whether the first (0) or second (1) particle emitted
0104    * the radiation
0105    * @param itype The type of radiated particle (0 is gluon, 1 is quark 
0106    *              and 2 is antiquark)
0107    * @param pnew The momenta of the new particles
0108    * @param trans The LorentzRotation from the boson rest frame to the new lab
0109    * @param xnew The new values of the momentuym fractions
0110    * @return Whether or not the matrix element correction needs to be applied
0111    */
0112   bool applyHard(ParticleVector & quarks,
0113          vector<tcBeamPtr> beams,
0114          Lorentz5Momentum boson,unsigned int & iemit,
0115          unsigned int & itype,vector<Lorentz5Momentum> & pnew,
0116          LorentzRotation & trans, pair<double,double> & xnew,
0117          Energy2 shad);
0118 
0119   /**
0120    * Returns the matrix element for a given type of process,
0121    * rapidity of the jet \f$y_j\f$ and transverse momentum \f$p_T\f$
0122    * @param emis_type the type of emission,
0123    * (0 is \f$q\bar{q}\to Vg\f$, 1 is \f$qg\to Vq\f$ and 2 is \f$g\bar{q}\to V\bar{q}\f$)
0124    * @param pt The transverse momentum of the jet
0125    * @param yj The rapidity of the jet
0126    */
0127   double getResult(int emis_type, Energy pt, double yj);
0128  
0129   /**
0130    *  generates the hardest emission (yj,p)
0131    * @param pnew The momenta of the new particles
0132    * @param emissiontype The type of emission, as for getResult
0133    * @return Whether not an emission was generated
0134    */
0135   bool getEvent(vector<Lorentz5Momentum> & pnew,int & emissiontype);
0136   
0137 public:
0138 
0139   /** @name Functions used by the persistent I/O system. */
0140   //@{
0141   /**
0142    * Function used to write out object persistently.
0143    * @param os the persistent output stream written to.
0144    */
0145   void persistentOutput(PersistentOStream & os) const;
0146 
0147   /**
0148    * Function used to read in object persistently.
0149    * @param is the persistent input stream read from.
0150    * @param version the version number of the object when written.
0151    */
0152   void persistentInput(PersistentIStream & is, int version);
0153   //@}
0154 
0155   /**
0156    * The standard Init function used to initialize the interfaces.
0157    * Called exactly once for each class by the class description system
0158    * before the main function starts or
0159    * when this class is dynamically loaded.
0160    */
0161   static void Init();
0162 
0163 protected:
0164 
0165   /** @name Standard Interfaced functions. */
0166   //@{
0167   /**
0168    * Initialize this object after the setup phase before saving an
0169    * EventGenerator to disk.
0170    * @throws InitException if object could not be initialized properly.
0171    */
0172   virtual void doinit();
0173 
0174   /**
0175    * Finalize this object. Called in the run phase just after a
0176    * run has ended. Used eg. to write out statistics.
0177    */
0178   virtual void dofinish();
0179   //@}
0180 
0181 private:
0182 
0183   /**
0184    * The assignment operator is private and must never be called.
0185    * In fact, it should not even be implemented.
0186    */
0187   DrellYanBase & operator=(const DrellYanBase &) = delete;
0188 
0189 private:
0190 
0191   /**
0192    *  Mass squared of the vector boson
0193    */
0194   Energy2 mb2_;
0195 
0196   /**
0197    *  Parameters for the old-style ME correction
0198    */
0199   //@{
0200   /**
0201    *  Relative weight for the \f$q\bar{q}\f$ and \f$q/\bar{q}g\f$ channels
0202    */
0203   double _channelwgtA;
0204 
0205   /**
0206    *  Relative weight for the \f$qg\f$ and \f$\bar{q}g\f$ channels 
0207    */
0208   double _channelwgtB;
0209 
0210   /**
0211    *  Weights for the channels as a vector
0212    */
0213   vector<double> _channelweights;
0214   
0215   /**
0216    *  Number of weights greater than 1
0217    */
0218   unsigned int _nover;
0219 
0220   /**
0221    *  Maximum weight
0222    */
0223   double _maxwgt;
0224   //@}
0225 
0226   /**
0227    *  Constants for the sampling. The distribution is assumed to have the
0228    *  form \f$\frac{c}{{\rm GeV}}\times\left(\frac{{\rm GeV}}{p_T}\right)^n\f$ 
0229    */
0230   //@{
0231   /**
0232    * The power, \f$n\f$, for the sampling
0233    */
0234   double _power;
0235 
0236   /**
0237    *  The prefactor, \f$c\f$ for the \f$q\bar{q}\f$ channel
0238    */
0239   double _preqqbar;
0240 
0241   /**
0242    *  The prefactor, \f$c\f$ for the \f$qg\f$ channel
0243    */
0244   double _preqg;
0245 
0246   /**
0247    *  The prefactor, \f$c\f$ for the \f$g\bar{q}\f$ channel
0248    */
0249   double _pregqbar;
0250 
0251   /**
0252    *  The prefactors as a vector for easy use
0253    */
0254   vector<double> _prefactor;
0255   //@}
0256 
0257   /**
0258    *  Properties of the incoming particles
0259    */
0260   //@{
0261   /**
0262    *  Pointers to the BeamParticleData objects
0263    */
0264   vector<tcBeamPtr> _beams;
0265   
0266   /**
0267    *  Pointers to the ParticleDataObjects for the partons
0268    */
0269   vector<tcPDPtr> _partons;
0270   //@}
0271 
0272   /**
0273    *  Properties of the boson and jets
0274    */
0275   //@{
0276   /**
0277    *  The rapidity of the gauge boson
0278    */
0279   double _yb;
0280 
0281   /**
0282    *  The mass of the gauge boson
0283    */
0284   Energy _mass;
0285 
0286   /**
0287    *  Whether the quark is in the + or - z direction
0288    */
0289   bool _quarkplus;
0290 
0291   /**
0292    *  the rapidity of the jet
0293    */
0294   double _yj;
0295 
0296   /**
0297    *  The transverse momentum of the jet
0298    */
0299   Energy _pt;
0300   //@}
0301 
0302   /**
0303    *  The transverse momentum of the jet
0304    */
0305   Energy _min_pt;
0306 
0307   /**
0308    *  Pointer to the object calculating the strong coupling
0309    */
0310   ShowerAlphaPtr _alpha;
0311 };
0312 
0313 }
0314 
0315 #endif /* HERWIG_DrellYanBase_H */