Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // UnResolvedRemnant.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_UnResolvedRemnant_H
0010 #define ThePEG_UnResolvedRemnant_H
0011 
0012 #include "ThePEG/PDF/RemnantHandler.h"
0013 
0014 namespace ThePEG {
0015 
0016 /**
0017  * UnResolvedRemnant inherits from the RemnantHandler and implements
0018  * the generation of either the incoming particle as the remnant
0019  * with the emission of a photon, pomeron or reggeon, or
0020  * a photon remnant for the particle entering the hard process.
0021  *
0022  * @see \ref UnResolvedRemnantInterfaces "The interfaces"
0023  * defined for UnResolvedRemnant.
0024  * @see UnResolvedPDF
0025  */
0026 class UnResolvedRemnant: public RemnantHandler {
0027 
0028 public:
0029 
0030   /** @name Standard constructors and destructors. */
0031   //@{
0032   /**
0033    * Default constructor.
0034    */
0035   UnResolvedRemnant();
0036   //@}
0037 
0038 public:
0039 
0040   /** @name Virtual functions mandated by the RemnantHandler base class. */
0041   //@{
0042   /**
0043    * Return true if this remnant handler can handle extracting all
0044    * specified \a partons form the given \a particle.
0045    */
0046   virtual bool canHandle(tcPDPtr particle, const cPDVector & partons) const;
0047 
0048   /**
0049    * If the generation of remnants is expected to influence the actual
0050    * cross section of the hard sub process, the degrees of freedom
0051    * generated by this remnant handler may be included in the general
0052    * phase space sampling for the subprocess. In this case this
0053    * function should be overridden to return the number of degrees of
0054    * freedom used in the generation. If \a doScale is false, it means
0055    * that the actual virtuality of the extracted parton will be
0056    * obtained from another source.
0057    */
0058   virtual int nDim(const PartonBin & pb, bool doScale) const;
0059 
0060   /**
0061    * Redo the remnant generation for the given particle bin, \a pb. If
0062    * \a oldp is non-null it corresponds to the previously extracted
0063    * parton which should be replaced by \a newp. If \a oldp is null it
0064    * means \a newp should be extracted in addition to the previously
0065    * extracted ones available in \a prev. 
0066    * @return false if the generation failed.
0067    */
0068   virtual bool recreateRemnants(PartonBinInstance & pb, tPPtr oldp, tPPtr newp,
0069                 double newl, Energy2 scale,
0070                 const LorentzMomentum & p,
0071                 const PVector & prev = PVector()) const;
0072   /**
0073    * Redo the remnant generation for the given particle bin, \a pb. If
0074    * \a oldp is non-null it corresponds to the previously extracted
0075    * parton which should be replaced by \a newp. If \a oldp is null it
0076    * means \a newp should be extracted in addition to the previously
0077    * extracted ones available in \a prev. In either case \a shat is
0078    * the total invariant mass squared of the hard sub-system produced
0079    * by the extracted parton and the primary parton entering from the other
0080    * side. 
0081    *
0082    * @return false if the generation failed.
0083    */
0084   virtual bool recreateRemnants(PartonBinInstance & pb, tPPtr oldp, tPPtr newp,
0085                 double newl, Energy2 scale,
0086                 Energy2 shat, const LorentzMomentum & p,
0087                 const PVector & prev = PVector()) const;
0088 
0089   /**
0090    * Generate momenta. Generates the momenta of the extracted parton
0091    * in the particle cms (but with the parton \f$x\f$ still the
0092    * positive light-cone fraction) as given by the last argument, \a
0093    * p. If the particle is space-like the positive and negative
0094    * light-cone momenta are \f$\sqrt{-m^2}\f$ and \f$-sqrt{-m^2}\f$
0095    * respectively. If the \a scale is negative, it means that the \a
0096    * doScale in the previous call to nDim() was true, otherwise the
0097    * given scale should be the virtuality of the extracted
0098    * parton. Generated quantities which are not returned in the
0099    * momentum may be saved in the PartonBin, \a pb, for later use. In
0100    * particular, if the nDim() random numbers, \a r, are not enough to
0101    * generate with weight one, the resulting weight should be stored
0102    * with the remnantWeight() method of the parton bin.
0103    */
0104   virtual Lorentz5Momentum generate(PartonBinInstance & pb, const double * r,
0105                     Energy2 scale,
0106                     const LorentzMomentum & p,
0107                     bool fixedPartonMomentum = false) const;
0108 
0109   /**
0110    * Generate the momentum of the extracted parton with the \a parent
0111    * momentum given by the last argument. If the \a scale is negative,
0112    * it means that the doScale in the previous call to nDim() was
0113    * true, otherwise the given \a scale should be the virtuality of
0114    * the extracted parton. \a shat is the total invariant mass squared
0115    * of the hard sub-system produced by the extracted parton and the
0116    * primary parton entering from the other side. Generated quantities
0117    * which are not returned in the momentum may be saved in the
0118    * PartonBinInstance, \a pb, for later use. In particular, if the
0119    * nDim() random numbers, \a r, are not enough to generate with
0120    * weight one, the resulting weight should be stored with the
0121    * remnantWeight() method of the parton bin.
0122    */
0123   virtual Lorentz5Momentum generate(PartonBinInstance & pb, const double * r,
0124                     Energy2 scale, Energy2 shat,
0125                     const LorentzMomentum & parent,
0126                     bool fixedPartonMomentum = false) const;
0127   //@}
0128 
0129 public:
0130 
0131   /** @name Functions used by the persistent I/O system. */
0132   //@{
0133   /**
0134    * Function used to write out object persistently.
0135    * @param os the persistent output stream written to.
0136    */
0137   void persistentOutput(PersistentOStream & os) const;
0138 
0139   /**
0140    * Function used to read in object persistently.
0141    * @param is the persistent input stream read from.
0142    * @param version the version number of the object when written.
0143    */
0144   void persistentInput(PersistentIStream & is, int version);
0145   //@}
0146 
0147   /**
0148    * Standard Init function used to initialize the interface.
0149    */
0150   static void Init();
0151 
0152 protected:
0153 
0154   /** @name Clone Methods. */
0155   //@{
0156   /**
0157    * Make a simple clone of this object.
0158    * @return a pointer to the new object.
0159    */
0160   virtual IBPtr clone() const;
0161 
0162   /** Make a clone of this object, possibly modifying the cloned object
0163    * to make it sane.
0164    * @return a pointer to the new object.
0165    */
0166   virtual IBPtr fullclone() const;
0167   //@}
0168 
0169   /** @name Standard Interfaced functions. */
0170   //@{
0171   /**
0172    * Initialize this object after the setup phase before saving an
0173    * EventGenerator to disk.
0174    * @throws InitException if object could not be initialized properly.
0175    */
0176   virtual void doinit();
0177   //@}
0178 
0179 private:
0180 
0181   /**
0182    * The minimum energy fraction allowed for a photon remnant.
0183    */
0184   double minX;
0185 
0186   /**
0187    * Easy access to a photon data object.
0188    */
0189   tPDPtr thePhoton;
0190 
0191 private:
0192 
0193   /**
0194    * Describe a concrete class with persistent data.
0195    */
0196   static ClassDescription<UnResolvedRemnant> initUnResolvedRemnant;
0197 
0198   /**
0199    *  Private and non-existent assignment operator.
0200    */
0201   UnResolvedRemnant & operator=(const UnResolvedRemnant &) = delete;
0202 
0203 };
0204 
0205 /** @cond TRAITSPECIALIZATIONS */
0206 
0207 /** This template specialization informs ThePEG about the
0208  *  base classes of UnResolvedRemnant. */
0209 template <>
0210 struct BaseClassTrait<UnResolvedRemnant,1>: public ClassTraitsType {
0211   /** Typedef of the first base class of UnResolvedRemnant. */
0212   typedef RemnantHandler NthBase;
0213 };
0214 
0215 /** This template specialization informs ThePEG about the name of the
0216  *  UnResolvedRemnant class and the shared object where it is
0217  *  defined. */
0218 template <>
0219 struct ClassTraits<UnResolvedRemnant>:
0220     public ClassTraitsBase<UnResolvedRemnant> {
0221   /** Return a platform-independent class name */
0222   static string className() { return "ThePEG::UnResolvedRemnant"; }
0223   /** Return the name of the shared library be loaded to get access to
0224    *  the UnResolvedRemnant class and every other class it uses
0225    *  (except the base class). */
0226   static string library() { return "UnResolvedRemnant.so"; }
0227 };
0228 
0229 /** @endcond */
0230 
0231 }
0232 
0233 #endif /* ThePEG_UnResolvedRemnant_H */