Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // MEee2gZ2qq.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_MEee2gZ2qq_H
0010 #define HERWIG_MEee2gZ2qq_H
0011 //
0012 // This is the declaration of the MEee2gZ2qq class.
0013 //
0014 
0015 #include "Herwig/MatrixElement/HwMEBase.h"
0016 #include "Herwig/Models/StandardModel/StandardModel.h"
0017 #include "ThePEG/PDT/EnumParticles.h"
0018 #include "ThePEG/Repository/EventGenerator.h"
0019 #include "ThePEG/Utilities/Rebinder.h"
0020 #include "Herwig/MatrixElement/ProductionMatrixElement.h"
0021 #include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
0022 #include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
0023 #include "Herwig/Shower/ShowerAlpha.h"
0024 
0025 namespace Herwig {
0026 
0027 using namespace ThePEG;
0028 
0029 /**
0030  * The MEee2gZ2qq class implements the matrix element
0031  * for \f$e^+e^-\to Z/\gamma \to q\bar{q}\f$ including spin correlations.
0032  * The class includes greater control over the type of quark produced than is available
0033  * in the corresponding matrix element from ThePEG, in addition to spin correlations.
0034  *
0035  * @see \ref MEee2gZ2qqInterfaces "The interfaces"
0036  * defined for MEee2gZ2qq.
0037  */
0038 class MEee2gZ2qq: public HwMEBase {
0039 
0040 public:
0041 
0042   /**
0043    * The default constructor.
0044    */
0045   MEee2gZ2qq() : minflav_(1), maxflav_(5), massopt_(1),
0046          spinCorrelations_(true),
0047          pTminQED_(GeV), pTminQCD_(GeV),
0048          preFactor_(6.)
0049   {}
0050 
0051   /**
0052    *  Members for hard corrections to the emission of QCD radiation 
0053    */
0054   //@{
0055   /**
0056    *  Has a POWHEG style correction
0057    */
0058   virtual POWHEGType hasPOWHEGCorrection() {return FSR;}
0059 
0060   /**
0061    *  Has an old fashioned ME correction
0062    */
0063   virtual bool hasMECorrection() {return true;}
0064 
0065   /**
0066    *  Initialize the ME correction
0067    */
0068   virtual void initializeMECorrection(RealEmissionProcessPtr, double &,
0069                       double & );
0070 
0071   /**
0072    *  Apply the hard matrix element correction to a given hard process or decay
0073    */
0074   virtual RealEmissionProcessPtr applyHardMatrixElementCorrection(RealEmissionProcessPtr);
0075 
0076   /**
0077    * Apply the soft matrix element correction
0078    * @param parent The initial particle in the current branching
0079    * @param progenitor The progenitor particle of the jet
0080    * @param fs Whether the emission is initial or final-state
0081    * @param highestpT The highest pT so far in the shower
0082    * @param ids ids of the particles produced in the branching
0083    * @param z The momentum fraction of the branching
0084    * @param scale the evolution scale of the branching
0085    * @param pT The transverse momentum of the branching
0086    * @return If true the emission should be vetoed
0087    */
0088   virtual bool softMatrixElementVeto(PPtr parent,
0089                      PPtr progenitor,
0090                      const bool & fs,
0091                      const Energy & highestpT,
0092                      const vector<tcPDPtr> & ids,
0093                      const double & z,
0094                      const Energy & scale,
0095                      const Energy & pT);
0096 
0097   /**
0098    *  Apply the POWHEG style correction
0099    */
0100   virtual RealEmissionProcessPtr generateHardest(RealEmissionProcessPtr,ShowerInteraction);
0101   //@}
0102 
0103   /** @name Virtual functions required by the MEBase class. */
0104   //@{
0105   /**
0106    * Return the order in \f$\alpha_S\f$ in which this matrix
0107    * element is given.
0108    */
0109   virtual unsigned int orderInAlphaS() const;
0110 
0111   /**
0112    * Return the order in \f$\alpha_{EW}\f$ in which this matrix
0113    * element is given.
0114    */
0115   virtual unsigned int orderInAlphaEW() const;
0116 
0117   /**
0118    * The matrix element for the kinematical configuration
0119    * previously provided by the last call to setKinematics(), suitably
0120    * scaled by sHat() to give a dimension-less number.
0121    * @return the matrix element scaled with sHat() to give a
0122    * dimensionless number.
0123    */
0124   virtual double me2() const;
0125 
0126   /**
0127    * Return the scale associated with the last set phase space point.
0128    */
0129   virtual Energy2 scale() const;
0130 
0131   /**
0132    * Add all possible diagrams with the add() function.
0133    */
0134   virtual void getDiagrams() const;
0135 
0136   /**
0137    * Get diagram selector. With the information previously supplied with the
0138    * setKinematics method, a derived class may optionally
0139    * override this method to weight the given diagrams with their
0140    * (although certainly not physical) relative probabilities.
0141    * @param dv the diagrams to be weighted.
0142    * @return a Selector relating the given diagrams to their weights.
0143    */
0144   virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
0145 
0146   /**
0147    * Return a Selector with possible colour geometries for the selected
0148    * diagram weighted by their relative probabilities.
0149    * @param diag the diagram chosen.
0150    * @return the possible colour geometries weighted by their
0151    * relative probabilities.
0152    */
0153   virtual Selector<const ColourLines *>
0154   colourGeometries(tcDiagPtr diag) const;
0155 
0156   /**
0157    *  Construct the vertex of spin correlations.
0158    */
0159   virtual void constructVertex(tSubProPtr);
0160   //@}
0161 
0162 
0163 public:
0164 
0165   /** @name Functions used by the persistent I/O system. */
0166   //@{
0167   /**
0168    * Function used to write out object persistently.
0169    * @param os the persistent output stream written to.
0170    */
0171   void persistentOutput(PersistentOStream & os) const;
0172 
0173   /**
0174    * Function used to read in object persistently.
0175    * @param is the persistent input stream read from.
0176    * @param version the version number of the object when written.
0177    */
0178   void persistentInput(PersistentIStream & is, int version);
0179   //@}
0180 
0181   /**
0182    * The standard Init function used to initialize the interfaces.
0183    * Called exactly once for each class by the class description system
0184    * before the main function starts or
0185    * when this class is dynamically loaded.
0186    */
0187   static void Init();
0188 
0189 protected:
0190 
0191   /** @name Clone Methods. */
0192   //@{
0193   /**
0194    * Make a simple clone of this object.
0195    * @return a pointer to the new object.
0196    */
0197   virtual IBPtr clone() const {return new_ptr(*this);}
0198 
0199   /** Make a clone of this object, possibly modifying the cloned object
0200    * to make it sane.
0201    * @return a pointer to the new object.
0202    */
0203   virtual IBPtr fullclone() const {return new_ptr(*this);}
0204   //@}
0205 
0206 protected:
0207 
0208   /** @name Standard Interfaced functions. */
0209   //@{
0210   /**
0211    * Initialize this object after the setup phase before saving an
0212    * EventGenerator to disk.
0213    * @throws InitException if object could not be initialized properly.
0214    */
0215   virtual void doinit();
0216 
0217   /**
0218    * Rebind pointer to other Interfaced objects. Called in the setup phase
0219    * after all objects used in an EventGenerator has been cloned so that
0220    * the pointers will refer to the cloned objects afterwards.
0221    * @param trans a TranslationMap relating the original objects to
0222    * their respective clones.
0223    * @throws RebindException if no cloned object was found for a given
0224    * pointer.
0225    */
0226   virtual void rebind(const TranslationMap & trans)
0227    ;
0228 
0229   /**
0230    * Return a vector of all pointers to Interfaced objects used in this
0231    * object.
0232    * @return a vector of pointers.
0233    */
0234   virtual IVector getReferences();
0235   //@}
0236 
0237 protected:
0238 
0239   /**
0240    *  Calculate the matrix element for \f$e^+e^-\to q \bar{q}\f$.
0241    * @param partons The incoming and outgoing particles
0242    * @param momenta The momenta of the incoming and outgoing particles
0243    * @param first Whether or not to calculate the spin correlations
0244    */  
0245   double loME(const vector<cPDPtr> & partons, 
0246           const vector<Lorentz5Momentum> & momenta,
0247           bool first) const;
0248 
0249   /**
0250    * Member to calculate the matrix element
0251    * @param fin  Spinors for incoming fermion
0252    * @param ain  Spinors for incoming antifermion
0253    * @param fout Spinors for outgoing fermion
0254    * @param aout Spinors for outgong antifermion
0255    * @param me   Spin summed Matrix element
0256    * @param cont The continuum piece of the matrix element
0257    * @param BW   The Z piece of the matrix element
0258    */
0259   ProductionMatrixElement HelicityME(vector<SpinorWaveFunction>    & fin,
0260                      vector<SpinorBarWaveFunction> & ain,
0261                      vector<SpinorBarWaveFunction> & fout,
0262                      vector<SpinorWaveFunction>    & aout,
0263                      double & me,
0264                      double & cont,
0265                      double & BW ) const;
0266 
0267   /**
0268    *  The ratio of the matrix element for one additional jet over the
0269    * leading order result. In practice
0270    * \f[\frac{\hat{s}|\overline{\mathcal{M}}|^2_2|D_{\rm emit}|}{4\pi C_F\alpha_S|\overline{\mathcal{M}}|^2_3\left(|D_{\rm emit}|+|D_{\rm spect}|\right)}\f]
0271    * is returned where \f$\|\overline{\mathcal{M}}|^2\f$ is 
0272    * the spin and colour summed/averaged matrix element.
0273    * @param partons The incoming and outgoing particles
0274    * @param momenta The momenta of the incoming and outgoing particles
0275    * @param iemitter Whether the quark or antiquark is regardede as the emitter
0276    * @param inter The type of interaction
0277    * @param subtract Whether or not to subtract the relevant dipole term
0278    */
0279   double meRatio(vector<cPDPtr> partons, 
0280          vector<Lorentz5Momentum> momenta,
0281          unsigned int iemitter,
0282          ShowerInteraction inter,
0283          bool subtract =false) const;
0284 
0285   /**
0286    *  Calculate the matrix element for \f$e^-e^-\to q \bar q g\f$.
0287    * @param partons The incoming and outgoing particles
0288    * @param momenta The momenta of the incoming and outgoing particles
0289    * @param inter The type of interaction
0290    */ 
0291   InvEnergy2 realME(const vector<cPDPtr> & partons, 
0292             const vector<Lorentz5Momentum> & momenta,
0293             ShowerInteraction inter) const;
0294 
0295 private:
0296 
0297   /**
0298    *  Generate the momenta for a hard configuration
0299    */
0300   pair<Energy,ShowerInteraction> 
0301   generateHard(RealEmissionProcessPtr, 
0302            vector<Lorentz5Momentum> & emission,
0303            unsigned int & iemit, unsigned int & ispect,
0304            bool applyVeto,ShowerInteraction);
0305 
0306   /**
0307    *  Calculate the reall emission
0308    */
0309   RealEmissionProcessPtr calculateRealEmission(RealEmissionProcessPtr born, bool veto,
0310                            ShowerInteraction inter);
0311 
0312   /**
0313    *  Calculate \f$\tilde{\kappa}\f$.
0314    */
0315   double getKfromX(double, double);
0316 
0317   /**
0318    *  Vector and axial vector parts of the matrix element
0319    */
0320   //@{
0321   /**
0322    *  Vector part of the matrix element
0323    */
0324   double MEV(double, double);
0325 
0326   /**
0327    * The matrix element, given \f$x_1\f$, \f$x_2\f$.
0328    * @param x1 \f$x_1\f$
0329    * @param x2 \f$x_2\f$
0330    */
0331   double PS(double x1, double x2);
0332   //@}
0333 
0334 protected:
0335   
0336   /**
0337    *  Pointer to the fermion-antifermion Z vertex
0338    */
0339   AbstractFFVVertexPtr FFZVertex() const {return FFZVertex_;}
0340   
0341   /**
0342    *  Pointer to the fermion-antifermion photon vertex
0343    */
0344   AbstractFFVVertexPtr FFPVertex() const {return FFPVertex_;}
0345   
0346   /**
0347    *  Pointer to the particle data object for the Z
0348    */
0349   PDPtr Z0() const {return Z0_;}
0350 
0351   /**
0352    *  Pointer to the particle data object for the photon
0353    */
0354   PDPtr gamma() const {return gamma_;}
0355 
0356   /**
0357    *  Pointer to the particle data object for the gluon
0358    */
0359   PDPtr gluon() const {return gluon_;}
0360 
0361 private:
0362 
0363   /**
0364    * The assignment operator is private and must never be called.
0365    * In fact, it should not even be implemented.
0366    */
0367   MEee2gZ2qq & operator=(const MEee2gZ2qq &) = delete;
0368 
0369 private:
0370 
0371   /**
0372    *  Parameters controlling the leading-order process
0373    */
0374   //@{
0375   /**
0376    *  The minimum PDG of the quarks to be produced
0377    */
0378    int minflav_;
0379 
0380   /**
0381    *  The maximum PDG of the quarks to be produced
0382    */
0383    int maxflav_;
0384 
0385   /**
0386    *  Option for the treatment of the top quark mass
0387    */
0388   unsigned int massopt_;
0389   //@}
0390 
0391   /**
0392    *  Pointers to the vertices
0393    */
0394   //@{
0395   /**
0396    *  Pointer to the fermion-antifermion Z vertex
0397    */
0398   AbstractFFVVertexPtr FFZVertex_;
0399   
0400   /**
0401    *  Pointer to the fermion-antifermion photon vertex
0402    */
0403   AbstractFFVVertexPtr FFPVertex_;
0404   
0405   /**
0406    *  Pointer to the fermion-antifermion photon vertex
0407    */
0408   AbstractFFVVertexPtr FFGVertex_;
0409   //@}
0410 
0411   /**
0412    *  Switch on/off the helivity vertex construction
0413    */
0414   bool spinCorrelations_;
0415 
0416   /**
0417    *  Pointer to the ParticleData objects
0418    */
0419   //@{
0420   /**
0421    *  Pointer to the particle data object for the Z
0422    */
0423   PDPtr Z0_;
0424 
0425   /**
0426    *  Pointer to the particle data object for the photon
0427    */
0428   PDPtr gamma_;
0429 
0430   /**
0431    *  Pointer to the particle data object for the gluon
0432    */
0433   PDPtr gluon_;
0434   //@}
0435 
0436   /**
0437    * CM energy 
0438    */
0439   Energy d_Q_;
0440 
0441   /**
0442    *  Quark mass
0443    */
0444   Energy d_m_;
0445 
0446   /**
0447    * The rho parameter 
0448    */
0449   double d_rho_;
0450 
0451   /**
0452    * The v parameter
0453    */
0454   double d_v_;
0455 
0456   /**
0457    * The initial kappa-tilde values for radiation from the quark
0458    */
0459   double d_kt1_;
0460 
0461   /**
0462    * The initial kappa-tilde values for radiation from the antiquark
0463    */
0464   double d_kt2_;
0465 
0466   /**
0467    *  Cut-off parameter
0468    */
0469   static const double EPS_;
0470 
0471   /**
0472    *  Pointer to the strong coupling
0473    */
0474   ShowerAlphaPtr alphaQCD_;
0475 
0476   /**
0477    *  Pointer to the EM coupling
0478    */
0479   ShowerAlphaPtr alphaQED_;
0480 
0481 private:
0482 
0483   /**
0484    *  Variables for the POWHEG style corrections
0485    */
0486   //@{
0487   /**
0488    *  The cut off on pt for QED, assuming massless quarks.
0489    */
0490   Energy pTminQED_;
0491   /**
0492    *  The cut off on pt for QCD, assuming massless quarks.
0493    */
0494   Energy pTminQCD_;
0495 
0496   /**
0497    *  Overestimate for the prefactor
0498    */
0499   double preFactor_;
0500 
0501   /**
0502    *  ParticleData objects for the partons
0503    */
0504   vector<cPDPtr> partons_;
0505 
0506   /**
0507    *  Momenta of the leading-order partons
0508    */
0509   vector<Lorentz5Momentum> loMomenta_;
0510   //@}
0511 
0512 };
0513 
0514 }
0515 
0516 #endif /* HERWIG_MEee2gZ2qq_H */