Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // FFMassiveKinematics.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_FFMassiveKinematics_H
0010 #define HERWIG_FFMassiveKinematics_H
0011 //
0012 // This is the declaration of the FFMassiveKinematics class.
0013 //
0014 
0015 #include "DipoleSplittingKinematics.h"
0016 
0017 namespace Herwig {
0018 
0019 using namespace ThePEG;
0020 
0021 /**
0022  * \ingroup DipoleShower
0023  * \author Simon Platzer, Stephen Webster
0024  *
0025  * \brief FFMassiveKinematics implements massive splittings
0026  * off a final-final dipole.
0027  *
0028  */
0029 class FFMassiveKinematics: public DipoleSplittingKinematics {
0030 
0031 public:
0032 
0033   /**
0034    * The default constructor.
0035    */
0036   FFMassiveKinematics();
0037 
0038 public:
0039 
0040   /**
0041    * Return the boundaries in between the evolution
0042    * variable random number is to be sampled; the lower
0043    * cuoff is assumed to correspond to the infrared cutoff.
0044    */
0045   virtual pair<double,double> kappaSupport(const DipoleSplittingInfo& dIndex) const;
0046 
0047   /**
0048    * Return the boundaries in between the momentum
0049    * fraction random number is to be sampled.
0050    */
0051   virtual pair<double,double> xiSupport(const DipoleSplittingInfo& dIndex) const;
0052 
0053   /**
0054    * Return the boundaries on the momentum fraction
0055    */
0056   virtual pair<double,double> zBoundaries(Energy,
0057                       const DipoleSplittingInfo&,
0058                       const DipoleSplittingKernel&) const {
0059     return {0.0,1.0};
0060   }
0061 
0062   /**
0063    * Return the dipole scale associated to the
0064    * given pair of emitter and spectator. This
0065    * should be the invariant mass or absolute value
0066    * final/final or initial/initial and the absolute
0067    * value of the momentum transfer for intial/final or
0068    * final/initial dipoles.
0069    */
0070   virtual Energy dipoleScale(const Lorentz5Momentum& pEmitter,
0071                  const Lorentz5Momentum& pSpectator) const;
0072 
0073     /**
0074      * Return the maximum pt for the given dipole scale.
0075      */
0076     virtual Energy ptMax(Energy dScale, 
0077              double emX, double specX,
0078              const DipoleSplittingInfo& dInfo,
0079              const DipoleSplittingKernel& split) const;
0080 
0081     /**
0082      * Return the maximum pt for the given dipole scale.
0083      */
0084     virtual Energy ptMax(Energy dScale, 
0085              double, double,
0086              const DipoleIndex& dIndex,
0087              const DipoleSplittingKernel& split,
0088              tPPtr emitter, tPPtr spectator) const;
0089   
0090     /**
0091      * Return the maximum pt for the given dipole scale.
0092      */
0093     virtual Energy ptMax(Energy, 
0094              double, double,
0095              const DipoleIndex&,
0096              const DipoleSplittingKernel&) const {
0097       // Only the DipoleSplittingInfo version should be used for massive
0098       // dipoles, for now anyway.
0099       assert(false);
0100       return ZERO;
0101     }
0102   
0103     /**
0104      * Return the maximum virtuality for the given dipole scale.
0105      */
0106     virtual Energy QMax(Energy dScale, 
0107             double emX, double specX,
0108             const DipoleSplittingInfo& dInfo,
0109             const DipoleSplittingKernel& split) const;
0110   
0111     /**
0112      * Return the maximum virtuality for the given dipole scale.
0113      */
0114     virtual Energy QMax(Energy, 
0115                 double, double,
0116                 const DipoleIndex&,
0117                 const DipoleSplittingKernel&) const { 
0118       // Only the DipoleSplittingInfo version should be used for massive
0119       // dipoles, for now anyway.
0120       assert(false);
0121       return ZERO;
0122     }
0123 
0124   /**
0125    * Return the pt given a virtuality.
0126    */
0127   virtual Energy PtFromQ(Energy scale, const DipoleSplittingInfo&) const;
0128 
0129   /**
0130    * Return the virtuality given a pt.
0131    */
0132   virtual Energy QFromPt(Energy scale, const DipoleSplittingInfo&) const;
0133 
0134   /**
0135    * Return the random number associated to
0136    * the given pt.
0137    */
0138   virtual double ptToRandom(Energy pt, Energy dScale,
0139                 double emX, double specX,
0140                 const DipoleIndex& dIndex,
0141                 const DipoleSplittingKernel& split) const;
0142 
0143   /**
0144    * Generate splitting variables given three random numbers
0145    * and the momentum fractions of the emitter and spectator.
0146    * Return true on success.
0147    */
0148   virtual bool generateSplitting(double kappa, double xi, double phi,
0149                  DipoleSplittingInfo& dIndex,
0150                  const DipoleSplittingKernel& split);
0151 
0152   /**
0153    * Generate the full kinematics given emitter and
0154    * spectator momentum and a previously completeted
0155    * DipoleSplittingInfo object.
0156    */
0157   virtual void generateKinematics(const Lorentz5Momentum& pEmitter,
0158                   const Lorentz5Momentum& pSpectator,
0159                   const DipoleSplittingInfo& dInfo);
0160 
0161 public:
0162   
0163   /**
0164    * Triangular / Kallen function
0165    */
0166   template <class T>
0167   inline T rootOfKallen (T a, T b, T c) const {
0168     if ( a*a + b*b + c*c - 2.*(a*b + a*c + b*c) > ZERO )
0169       return sqrt(a*a + b*b + c*c - 2.*(a*b + a*c + b*c) ) ;
0170     else
0171       return ZERO; }
0172   
0173   /**
0174    * Perform a rotation on both momenta such that the first one will
0175    * point along the (positive) z axis. Rotate back to the original
0176    * reference frame by applying rotateUz(returnedVector) to each momentum.
0177    */
0178   ThreeVector<double> rotateToZ (Lorentz5Momentum& pTarget, Lorentz5Momentum& p1){
0179     ThreeVector<double> oldAxis = pTarget.vect().unit();
0180     double ct = oldAxis.z(); double st = sqrt( 1.-sqr(ct) ); // cos,sin(theta)
0181     double cp = oldAxis.x()/st; double sp = oldAxis.y()/st; // cos,sin(phi)
0182     pTarget.setZ( pTarget.vect().mag() ); pTarget.setX( 0.*GeV ); pTarget.setY( 0.*GeV );
0183     Lorentz5Momentum p1old = p1;
0184     p1.setX(    sp*p1old.x() -    cp*p1old.y()                );
0185     p1.setY( ct*cp*p1old.x() + ct*sp*p1old.y() - st*p1old.z() );
0186     p1.setZ( st*cp*p1old.x() + st*sp*p1old.y() + ct*p1old.z() );
0187     return oldAxis;
0188   }
0189 
0190 public:
0191 
0192   /** @name Functions used by the persistent I/O system. */
0193   //@{
0194   /**
0195    * Function used to write out object persistently.
0196    * @param os the persistent output stream written to.
0197    */
0198   void persistentOutput(PersistentOStream & os) const;
0199 
0200   /**
0201    * Function used to read in object persistently.
0202    * @param is the persistent input stream read from.
0203    * @param version the version number of the object when written.
0204    */
0205   void persistentInput(PersistentIStream & is, int version);
0206   //@}
0207 
0208   /**
0209    * The standard Init function used to initialize the interfaces.
0210    * Called exactly once for each class by the class description system
0211    * before the main function starts or
0212    * when this class is dynamically loaded.
0213    */
0214   static void Init();
0215 
0216 protected:
0217 
0218   /** @name Clone Methods. */
0219   //@{
0220   /**
0221    * Make a simple clone of this object.
0222    * @return a pointer to the new object.
0223    */
0224   virtual IBPtr clone() const;
0225 
0226   /** Make a clone of this object, possibly modifying the cloned object
0227    * to make it sane.
0228    * @return a pointer to the new object.
0229    */
0230   virtual IBPtr fullclone() const;
0231   //@}
0232 
0233 
0234 // If needed, insert declarations of virtual function defined in the
0235 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
0236 
0237 
0238 private:
0239 
0240   /**
0241    * The static object used to initialize the description of this class.
0242    * Indicates that this is a concrete class with persistent data.
0243    */
0244   static ClassDescription<FFMassiveKinematics> initFFMassiveKinematics;
0245 
0246   /**
0247    * The assignment operator is private and must never be called.
0248    * In fact, it should not even be implemented.
0249    */
0250   FFMassiveKinematics & operator=(const FFMassiveKinematics &) = delete;
0251   
0252 };
0253 
0254 }
0255 
0256 #include "ThePEG/Utilities/ClassTraits.h"
0257 
0258 namespace ThePEG {
0259 
0260 /** @cond TRAITSPECIALIZATIONS */
0261 
0262 /** This template specialization informs ThePEG about the
0263  *  base classes of FFMassiveKinematics. */
0264 template <>
0265 struct BaseClassTrait<Herwig::FFMassiveKinematics,1> {
0266   /** Typedef of the first base class of FFMassiveKinematics. */
0267   typedef Herwig::DipoleSplittingKinematics NthBase;
0268 };
0269 
0270 /** This template specialization informs ThePEG about the name of
0271  *  the FFMassiveKinematics class and the shared object where it is defined. */
0272 template <>
0273 struct ClassTraits<Herwig::FFMassiveKinematics>
0274   : public ClassTraitsBase<Herwig::FFMassiveKinematics> {
0275   /** Return a platform-independent class name */
0276   static string className() { return "Herwig::FFMassiveKinematics"; }
0277   /**
0278    * The name of a file containing the dynamic library where the class
0279    * FFMassiveKinematics is implemented. It may also include several, space-separated,
0280    * libraries if the class FFMassiveKinematics depends on other classes (base classes
0281    * excepted). In this case the listed libraries will be dynamically
0282    * linked in the order they are specified.
0283    */
0284   static string library() { return "HwDipoleShower.so"; }
0285 };
0286 
0287 /** @endcond */
0288 
0289 }
0290 
0291 #endif /* HERWIG_FFMassiveKinematics_H */