Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:38:27

0001 // -*- C++ -*-
0002 //
0003 // MadGraphOneCut.h is a part of ThePEG - Toolkit for HEP Event Generation
0004 // Copyright (C) 1999-2019 Leif Lonnblad
0005 //
0006 // ThePEG 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 THEPEG_MadGraphOneCut_H
0010 #define THEPEG_MadGraphOneCut_H
0011 //
0012 // This is the declaration of the MadGraphOneCut class.
0013 //
0014 
0015 #include "ThePEG/Cuts/OneCutBase.h"
0016 
0017 namespace ThePEG {
0018 
0019 /**
0020  * Objects of the MadGraphOneCut class can be created automatically by
0021  * the MadGraphReader class when scanning event files for information
0022  * about cuts. It is also possible to create objects by hand and use
0023  * it as any other OneCutBase object.
0024  *
0025  * @see \ref MadGraphOneCutInterfaces "The interfaces"
0026  * defined for MadGraphOneCut.
0027  */
0028 class MadGraphOneCut: public OneCutBase {
0029 
0030 public:
0031 
0032   /**
0033    * Enumerate the different kinds of cuts made by MadGraph.
0034    */
0035   enum class Cut {
0036     PT,  /**< The minimum transverse momentum of a particle. */
0037     ETA, /**< The maximum (absolute value of) pseudo-rapidity of a particle. */
0038     XPT  /**< The minimum transverse momentum of the particle with
0039           largest transverse momentum. */
0040   };
0041 
0042   /**
0043    * Enumerate the types of particles the cut is made on.
0044    */
0045   enum class P {
0046     JET, /**< The cut applies only to coloured particles. */
0047     LEP, /**< The cut applies only to leptons. */
0048     PHO, /**< The cut applies only to photons. */
0049     BOT  /**< The cut applies only to bottom quarks. */
0050   };
0051 
0052 public:
0053 
0054   /** @name Standard constructors and destructors. */
0055   //@{
0056   /**
0057    * The default constructor.
0058    */
0059   MadGraphOneCut() : cutType(Cut::PT), particleType(P::JET), theCut(0.0) {}
0060 
0061   /**
0062    * The constructor used by the MadGraphReader.
0063    * @param t is the type of the cut.
0064    * @param p is the type of particles the cut is applied to.
0065    * @param c is the value of the cut (in units of GeV where applicable).
0066    */
0067   MadGraphOneCut(Cut t, P p, double c)
0068     : cutType(t), particleType(p), theCut(c) {}
0069   //@}
0070 
0071 public:
0072 
0073   /** @name Virtual functions mandated by the base class. */
0074   //@{
0075   /**
0076    * Return the minimum allowed value of the transverse momentum of an
0077    * outgoing parton.
0078    */
0079   virtual Energy minKT(tcPDPtr p) const;
0080 
0081   /**
0082    * Return the minimum allowed pseudo-rapidity of an outgoing parton
0083    * of the given type. The pseudo-rapidity is measured in the lab
0084    * system.
0085    */
0086   virtual double minEta(tcPDPtr p) const;
0087 
0088   /**
0089    * Return the maximum allowed pseudo-rapidity of an outgoing parton
0090    * of the given type. The pseudo-rapidity is measured in the lab
0091    * system.
0092    */
0093   virtual double maxEta(tcPDPtr p) const;
0094 
0095   /**
0096    * Return the minimum allowed value of the transverse momentum of
0097    * the outgoing parton with the lagrest transverse momentum. This
0098    * version simply returns minKt().
0099    */
0100   virtual Energy minMaxKT(tcPDPtr p) const;
0101 
0102   /**
0103    * Return true if a particle with type \a ptype and momentum \a p
0104    * passes the cuts. The \a parent contains information about the
0105    * kinematics of the hard sub-process.
0106    */
0107   virtual bool passCuts(tcCutsPtr parent,
0108             tcPDPtr ptype, LorentzMomentum p) const;
0109   //@}
0110 
0111 protected:
0112 
0113   /**
0114    * Returns true if cut should be applied to a particle of type \a p.
0115    */
0116   bool checkType(tcPDPtr p) const;
0117 
0118 public:
0119 
0120   /** @name Functions used by the persistent I/O system. */
0121   //@{
0122   /**
0123    * Function used to write out object persistently.
0124    * @param os the persistent output stream written to.
0125    */
0126   void persistentOutput(PersistentOStream & os) const;
0127 
0128   /**
0129    * Function used to read in object persistently.
0130    * @param is the persistent input stream read from.
0131    * @param version the version number of the object when written.
0132    */
0133   void persistentInput(PersistentIStream & is, int version);
0134   //@}
0135 
0136   /**
0137    * The standard Init function used to initialize the interfaces.
0138    * Called exactly once for each class by the class description system
0139    * before the main function starts or
0140    * when this class is dynamically loaded.
0141    */
0142   static void Init();
0143 
0144 protected:
0145 
0146   /** @name Clone Methods. */
0147   //@{
0148   /**
0149    * Make a simple clone of this object.
0150    * @return a pointer to the new object.
0151    */
0152   virtual IBPtr clone() const;
0153 
0154   /** Make a clone of this object, possibly modifying the cloned object
0155    * to make it sane.
0156    * @return a pointer to the new object.
0157    */
0158   virtual IBPtr fullclone() const;
0159   //@}
0160 
0161 private:
0162 
0163   /**
0164    * The type of this cut.
0165    */
0166   Cut cutType;
0167 
0168   /**
0169    * The type of particles this cut applies to.
0170    */
0171   P particleType;
0172 
0173   /**
0174    * The value of the cut to be applied.
0175    */
0176   double theCut;
0177 
0178 private:
0179 
0180   /**
0181    * The static object used to initialize the description of this class.
0182    * Indicates that this is a concrete class with persistent data.
0183    */
0184   static ClassDescription<MadGraphOneCut> initMadGraphOneCut;
0185 
0186   /**
0187    * The assignment operator is private and must never be called.
0188    * In fact, it should not even be implemented.
0189    */
0190   MadGraphOneCut & operator=(const MadGraphOneCut &) = delete;
0191 
0192 };
0193 
0194 }
0195 
0196 #include "ThePEG/Utilities/ClassTraits.h"
0197 
0198 namespace ThePEG {
0199 
0200 /** @cond TRAITSPECIALIZATIONS */
0201 
0202 /** This template specialization informs ThePEG about the
0203  *  base classes of MadGraphOneCut. */
0204 template <>
0205 struct BaseClassTrait<MadGraphOneCut,1> {
0206   /** Typedef of the first base class of MadGraphOneCut. */
0207   typedef OneCutBase NthBase;
0208 };
0209 
0210 /** This template specialization informs ThePEG about the name of
0211  *  the MadGraphOneCut class and the shared object where it is defined. */
0212 template <>
0213 struct ClassTraits<MadGraphOneCut>
0214   : public ClassTraitsBase<MadGraphOneCut> {
0215   /** Return a platform-independent class name */
0216   static string className() { return "ThePEG::MadGraphOneCut"; }
0217   /** Return the name(s) of the shared library (or libraries) be loaded to get
0218    *  access to the MadGraphOneCut class and any other class on which it depends
0219    *  (except the base class). */
0220   static string library() { return "MadGraphReader.so"; }
0221 };
0222 
0223 /** @endcond */
0224 
0225 }
0226 
0227 #endif /* THEPEG_MadGraphOneCut_H */