Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 #ifndef HERWIG_MEPP2WJet_H
0003 #define HERWIG_MEPP2WJet_H
0004 //
0005 // This is the declaration of the MEPP2WJet class.
0006 //
0007 
0008 #include "Herwig/MatrixElement/HwMEBase.h"
0009 #include "ThePEG/Helicity/WaveFunction/SpinorWaveFunction.h"
0010 #include "ThePEG/Helicity/WaveFunction/VectorWaveFunction.h"
0011 #include "ThePEG/Helicity/WaveFunction/SpinorBarWaveFunction.h"
0012 #include "Herwig/MatrixElement/ProductionMatrixElement.h"
0013 #include "ThePEG/Helicity/Vertex/AbstractFFVVertex.fh"
0014 
0015 namespace Herwig {
0016 
0017 using namespace ThePEG;
0018 using namespace ThePEG::Helicity;
0019 
0020 /**
0021  * The MEPP2WJet class implements the matrix element for the production of
0022  * a W boson and a jet including the decay of the W.
0023  *
0024  * @see \ref MEPP2WJetInterfaces "The interfaces"
0025  * defined for MEPP2WJet.
0026  */
0027 class MEPP2WJet: public HwMEBase {
0028 
0029 public:
0030 
0031   /**
0032    * The default constructor.
0033    */
0034   MEPP2WJet();
0035 
0036   /** @name Virtual functions required by the MEBase class. */
0037   //@{
0038   /**
0039    * Return the order in \f$\alpha_S\f$ in which this matrix
0040    * element is given.
0041    */
0042   virtual unsigned int orderInAlphaS() const;
0043 
0044   /**
0045    * Return the order in \f$\alpha_{EW}\f$ in which this matrix
0046    * element is given.
0047    */
0048   virtual unsigned int orderInAlphaEW() const;
0049 
0050   /**
0051    * The matrix element for the kinematical configuration
0052    * previously provided by the last call to setKinematics(), suitably
0053    * scaled by sHat() to give a dimension-less number.
0054    * @return the matrix element scaled with sHat() to give a
0055    * dimensionless number.
0056    */
0057   virtual double me2() const;
0058 
0059   /**
0060    * Return the scale associated with the last set phase space point.
0061    */
0062   virtual Energy2 scale() const;
0063 
0064   /**
0065    * The number of internal degrees of freedom used in the matrix
0066    * element.
0067    */
0068   virtual int nDim() const;
0069 
0070   /**
0071    * Generate internal degrees of freedom given nDim() uniform
0072    * random numbers in the interval \f$ ]0,1[ \f$. To help the phase space
0073    * generator, the dSigHatDR should be a smooth function of these
0074    * numbers, although this is not strictly necessary.
0075    * @param r a pointer to the first of nDim() consecutive random numbers.
0076    * @return true if the generation succeeded, otherwise false.
0077    */
0078   virtual bool generateKinematics(const double * r);
0079 
0080   /**
0081    * Return the matrix element squared differential in the variables
0082    * given by the last call to generateKinematics().
0083    */
0084   virtual CrossSection dSigHatDR() const;
0085 
0086   /**
0087    * Add all possible diagrams with the add() function.
0088    */
0089   virtual void getDiagrams() const;
0090 
0091   /**
0092    * Get diagram selector. With the information previously supplied with the
0093    * setKinematics method, a derived class may optionally
0094    * override this method to weight the given diagrams with their
0095    * (although certainly not physical) relative probabilities.
0096    * @param dv the diagrams to be weighted.
0097    * @return a Selector relating the given diagrams to their weights.
0098    */
0099   virtual Selector<DiagramIndex> diagrams(const DiagramVector & dv) const;
0100 
0101   /**
0102    * Return a Selector with possible colour geometries for the selected
0103    * diagram weighted by their relative probabilities.
0104    * @param diag the diagram chosen.
0105    * @return the possible colour geometries weighted by their
0106    * relative probabilities.
0107    */
0108   virtual Selector<const ColourLines *>
0109   colourGeometries(tcDiagPtr diag) const;
0110 
0111   /**
0112    *  Construct the vertex of spin correlations.
0113    */
0114   virtual void constructVertex(tSubProPtr);
0115   //@}
0116 
0117 public:
0118 
0119   /** @name Functions used by the persistent I/O system. */
0120   //@{
0121   /**
0122    * Function used to write out object persistently.
0123    * @param os the persistent output stream written to.
0124    */
0125   void persistentOutput(PersistentOStream & os) const;
0126 
0127   /**
0128    * Function used to read in object persistently.
0129    * @param is the persistent input stream read from.
0130    * @param version the version number of the object when written.
0131    */
0132   void persistentInput(PersistentIStream & is, int version);
0133   //@}
0134 
0135   /**
0136    * The standard Init function used to initialize the interfaces.
0137    * Called exactly once for each class by the class description system
0138    * before the main function starts or
0139    * when this class is dynamically loaded.
0140    */
0141   static void Init();
0142 
0143 protected:
0144 
0145   /**
0146    *  Matrix elements for the different subprocesses
0147    */
0148   //@{
0149   /**
0150    * Matrix element for \f$q\bar{q}\to W^\pm g\f$.
0151    * @param fin   Spinors for incoming quark
0152    * @param ain   Spinors for incoming antiquark
0153    * @param gout  Polarization vectors for the outgoing gluon
0154    * @param lm    Spinors for outgoing lepton
0155    * @param lp    Spinors for outgoing antilepton
0156    * @param me    Whether or not to calculate the matrix element for spin correlations
0157    **/
0158   InvEnergy2 qqbarME(vector<SpinorWaveFunction> & fin,
0159              vector<SpinorBarWaveFunction> & ain,
0160              vector<VectorWaveFunction> & gout,
0161              vector<SpinorBarWaveFunction> & lm,
0162              vector<SpinorWaveFunction> & lp,
0163              bool me=false) const;
0164 
0165   /**
0166    * Matrix element for \f$qg\to W^\pm q\f$.
0167    * @param fin  Spinors for incoming quark
0168    * @param gin  Polarization vectors for the incoming gluon
0169    * @param fout Spinors for outgoing quark
0170    * @param lm    Spinors for outgoing lepton
0171    * @param lp    Spinors for outgoing antilepton
0172    * @param me   Whether or not to calculate the matrix element for spin correlations
0173    **/
0174   InvEnergy2 qgME(vector<SpinorWaveFunction> & fin,
0175           vector<VectorWaveFunction> & gin,
0176           vector<SpinorBarWaveFunction> & fout,
0177           vector<SpinorBarWaveFunction> & lm,
0178           vector<SpinorWaveFunction> & lp,
0179           bool me=false) const;
0180 
0181   /**
0182    * Matrix element for \f$\bar{q}g\to W^\pm\bar{q}\f$.
0183    * @param fin  Spinors for incoming antiquark
0184    * @param gin  Polarization vectors for the incoming gluon
0185    * @param fout Spinors for outgoing antiquark
0186    * @param lm    Spinors for outgoing lepton
0187    * @param lp    Spinors for outgoing antilepton
0188    * @param me   Whether or not to calculate the matrix element for spin correlations
0189    **/
0190   InvEnergy2 qbargME(vector<SpinorBarWaveFunction> & fin,
0191              vector<VectorWaveFunction> & gin,
0192              vector<SpinorWaveFunction> & fout,
0193              vector<SpinorBarWaveFunction> & lm,
0194              vector<SpinorWaveFunction> & lp,
0195              bool me=false) const;
0196   //@}
0197 
0198 protected:
0199 
0200   /** @name Clone Methods. */
0201   //@{
0202   /**
0203    * Make a simple clone of this object.
0204    * @return a pointer to the new object.
0205    */
0206   virtual IBPtr clone() const { return new_ptr(*this); }
0207 
0208   /** Make a clone of this object, possibly modifying the cloned object
0209    * to make it sane.
0210    * @return a pointer to the new object.
0211    */
0212   virtual IBPtr fullclone() const { return new_ptr(*this); }
0213   //@}
0214 
0215 protected:
0216 
0217   /** @name Standard Interfaced functions. */
0218   //@{
0219   /**
0220    * Initialize this object after the setup phase before saving an
0221    * EventGenerator to disk.
0222    * @throws InitException if object could not be initialized properly.
0223    */
0224   virtual void doinit();
0225   //@}
0226 
0227 private:
0228 
0229   /**
0230    * The assignment operator is private and must never be called.
0231    * In fact, it should not even be implemented.
0232    */
0233   MEPP2WJet & operator=(const MEPP2WJet &) = delete;
0234 
0235 private:
0236 
0237   /**
0238    *  Vertices for the helicity amplitude calculation
0239    */
0240   //@{
0241   /**
0242    *  Pointer to the W vertex
0243    */
0244   AbstractFFVVertexPtr _theFFWVertex;
0245 
0246   /**
0247    *  Pointer to the \f$qqg\f$ vertex
0248    */
0249   AbstractFFVVertexPtr _theQQGVertex;
0250   //@}
0251 
0252   /**
0253    *  @name Pointers to the W ParticleData objects
0254    */
0255   //@{
0256   /**
0257    *  The \f$W^+\f$ data pointer
0258    */ 
0259   tcPDPtr _wplus;
0260 
0261   /**
0262    *  The \f$W^-\f$ data pointer
0263    */
0264   tcPDPtr _wminus;
0265   //@}
0266 
0267   /**
0268    * @name Switches to control the particles in the hard process
0269    */
0270   //@{
0271   /**
0272    *  Subprocesses to include
0273    */
0274   unsigned int _process;
0275 
0276   /**
0277    *  Allowed flavours for the incoming quarks
0278    */
0279   unsigned int _maxflavour;
0280 
0281   /**
0282    *  Which charge states to include
0283    */
0284   unsigned int _plusminus;
0285 
0286   /**
0287    *  W decay modes
0288    */
0289   unsigned int _wdec;
0290 
0291   /**
0292    *  Option for the treatment of the W off-shell effects
0293    */
0294   unsigned int _widthopt;
0295   //@}
0296 
0297   /**
0298    * Matrix element for spin correlations
0299    */
0300   mutable ProductionMatrixElement _me;
0301 
0302   /**
0303    *  Storage of the scale to avoid the need to recalculate
0304    */
0305   Energy2 _scale;
0306   
0307   /**
0308    *  Storage of the off-shell W mass to avoid the need to recalculate
0309    */
0310   Energy2 _mw2;
0311 
0312 };
0313 
0314 }
0315 
0316 #endif /* HERWIG_MEPP2WJet_H */