Back to home page

EIC code displayed by LXR

 
 

    


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

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