Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // GaussianPtGenerator.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_GaussianPtGenerator_H
0010 #define THEPEG_GaussianPtGenerator_H
0011 // This is the declaration of the GaussianPtGenerator class.
0012 
0013 #include "ThePEG/Handlers/PtGenerator.h"
0014 
0015 namespace ThePEG {
0016 
0017 /**
0018  * GaussianPtGenerator inherits from the abstract PtGenerator
0019  * class. It will generate a transverse momentum distributed according
0020  * to a gaussian.
0021  *
0022  * @see \ref GaussianPtGeneratorInterfaces "The interfaces"
0023  * defined for GaussianPtGenerator.
0024  */
0025 class GaussianPtGenerator: public PtGenerator {
0026 
0027 public:
0028 
0029   /** @name Standard constructors and destructors. */
0030   //@{
0031   /**
0032    * Default constructor.
0033    */
0034   GaussianPtGenerator() : theSigma(1.0*GeV), theUpperCut(5.0*GeV) {}
0035 
0036   /**
0037    * Destructor.
0038    */
0039   virtual ~GaussianPtGenerator();
0040   //@}
0041 
0042 public:
0043 
0044   /** @name Virtual functions required by the PtGenerator class. */
0045   //@{
0046   /**
0047    * Generate (\f$k_x, k_y\f$) components of the transverse
0048    * momentum. They will be distributed as
0049    * \f$\exp(-k_\perp^2/\sigma^2)k_\perp dk_\perp\f$ with
0050    * \f$k_\perp^2=k_x^2+k_y^2\f$ and \f$\sigma=\f$ theSigma. The
0051    * distribution is cutoff at \f$k_\perp=\f$ theUpperCut.
0052    */
0053   virtual TransverseMomentum generate() const;
0054   //@}
0055 
0056 public:
0057 
0058   /** @name Functions used by the persistent I/O system. */
0059   //@{
0060   /**
0061    * Function used to write out object persistently.
0062    * @param os the persistent output stream written to.
0063    */
0064   void persistentOutput(PersistentOStream & os) const;
0065 
0066   /**
0067    * Function used to read in object persistently.
0068    * @param is the persistent input stream read from.
0069    * @param version the version number of the object when written.
0070    */
0071   void persistentInput(PersistentIStream & is, int version);
0072   //@}
0073 
0074   /**
0075    * Standard Init function used to initialize the interfaces.
0076    */
0077   static void Init();
0078 
0079 protected:
0080 
0081   /** @name Clone Methods. */
0082   //@{
0083   /**
0084    * Make a simple clone of this object.
0085    * @return a pointer to the new object.
0086    */
0087   virtual IBPtr clone() const;
0088 
0089   /** Make a clone of this object, possibly modifying the cloned object
0090    * to make it sane.
0091    * @return a pointer to the new object.
0092    */
0093   virtual IBPtr fullclone() const;
0094   //@}
0095 
0096 private:
0097 
0098   /**
0099    * The width of the Gaussian distribution. The average squared
0100    * transverse momentum is theSigma squared.
0101    */
0102   Energy theSigma;
0103 
0104   /**
0105    * Upper cutoff for the transverse momentum distribution.
0106    */
0107   Energy theUpperCut;
0108 
0109 private:
0110 
0111   /**
0112    * Describe a concrete class with persistent data.
0113    */
0114   static ClassDescription<GaussianPtGenerator> initGaussianPtGenerator;
0115 
0116   /**
0117    * Private and non-existent assignment operator.
0118    */
0119   GaussianPtGenerator & operator=(const GaussianPtGenerator &) = delete;
0120 
0121 };
0122 
0123 }
0124 
0125 
0126 #include "ThePEG/Utilities/ClassTraits.h"
0127 
0128 namespace ThePEG {
0129 
0130 /** @cond TRAITSPECIALIZATIONS */
0131 
0132 /**
0133  * This template specialization informs ThePEG about the
0134  * base class of GaussianPtGenerator.
0135  */
0136 template <>
0137 struct BaseClassTrait<GaussianPtGenerator,1>: public ClassTraitsType {
0138   /** Typedef of the base class of GaussianPtGenerator. */
0139   typedef PtGenerator NthBase;
0140 };
0141 
0142 /**
0143  * This template specialization informs ThePEG about the name of the
0144  * GaussianPtGenerator class and the shared object where it is
0145  * defined.
0146  */
0147 template <>
0148 struct ClassTraits<GaussianPtGenerator>
0149   : public ClassTraitsBase<GaussianPtGenerator> {
0150   /** Return the class name. */
0151   static string className() { return "ThePEG::GaussianPtGenerator"; }
0152   /** Return the name of the shared library to be loaded to get access
0153    * to the GaussianPtGenerator class and every other class it uses
0154    * (except the base class). */
0155   static string library() { return "GaussianPtGenerator.so"; }
0156 
0157 };
0158 
0159 /** @endcond */
0160 
0161 }
0162 
0163 #endif /* THEPEG_GaussianPtGenerator_H */