Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // IILightKinematics.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_IILightKinematics_H
0010 #define HERWIG_IILightKinematics_H
0011 //
0012 // This is the declaration of the IILightKinematics 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
0024    *
0025    * \brief IILightKinematics implements massless splittings
0026    * off an initial-initial dipole.
0027    *
0028    * @see \ref IILightKinematicsInterfaces "The interfaces"
0029    * defined for IILightKinematics.
0030    */
0031   class IILightKinematics: public DipoleSplittingKinematics {
0032 
0033   public:
0034 
0035     /**
0036      * The default constructor.
0037      */
0038     IILightKinematics();
0039 
0040   public:
0041 
0042     /**
0043      * Return the maximum pt for the given dipole scale.
0044      */
0045     virtual Energy ptMax(Energy dScale, 
0046                          double emX, double specX,
0047                          const DipoleIndex&,
0048                          const DipoleSplittingKernel&) const;
0049 
0050     /**
0051      * Return the maximum virtuality for the given dipole scale.
0052      */
0053     virtual Energy QMax(Energy dScale, 
0054                         double emX, double specX,
0055                         const DipoleIndex& dIndex,
0056                         const DipoleSplittingKernel&) const;
0057 
0058     /**
0059      * Return the pt given a virtuality.
0060      */
0061     virtual Energy PtFromQ(Energy scale, const DipoleSplittingInfo&) const;
0062 
0063     /**
0064      * Return the virtuality given a pt.
0065      */
0066     virtual Energy QFromPt(Energy scale, const DipoleSplittingInfo&) const;
0067 
0068     /**
0069      * Return the boundaries on the momentum fraction
0070      */
0071     virtual pair<double,double> zBoundaries(Energy pt,
0072                                             const DipoleSplittingInfo& dInfo,
0073                                             const DipoleSplittingKernel& split) const;
0074 
0075     /**
0076      * Generate splitting variables given three random numbers
0077      * and the momentum fractions of the emitter and spectator.
0078      * Return true on success.
0079      */
0080     virtual bool generateSplitting(double kappa, double xi, double phi,
0081                                    DipoleSplittingInfo& dIndex,
0082                                    const DipoleSplittingKernel&);
0083 
0084     /**
0085      * Generate the full kinematics given emitter and
0086      * spectator momentum and a previously completeted
0087      * DipoleSplittingInfo object.
0088      */
0089     virtual void generateKinematics(const Lorentz5Momentum& pEmitter,
0090                                     const Lorentz5Momentum& pSpectator,
0091                                     const DipoleSplittingInfo& dInfo);
0092 
0093     /**
0094      * Return true, if there is a transformation which should
0095      * be applied to all other final state particles except the ones
0096      * involved in the splitting after having performed the splitting
0097      */
0098     virtual bool doesTransform () const { return theCollinearScheme || didCollinear; }
0099 
0100     /**
0101      * Calculate and store a required Lorentz transformation
0102      **/
0103     virtual void setTransformation () ;
0104     
0105     /*
0106      * perform the transformation, if existing
0107      */
0108     virtual void transform (PPtr& part) {
0109       if ( !theCollinearScheme && !didCollinear ) return;
0110 
0111       Lorentz5Momentum mom = part->momentum();
0112 
0113       // If particle has SpinInfo check that we're 
0114       // not dealing with an intermediate spectator.
0115       if ( part->spinInfo() 
0116        && !(part->spinInfo()->timelike() && part->children().size() == 1 ) 
0117        && !(!part->spinInfo()->timelike() && part->parents()[0]->children().size() == 1 ) ) {
0118       
0119         if ( !theTransformationCalculated )
0120           setTransformation();
0121      
0122         part->spinInfo()->transform(mom,theRecoilTransformation);
0123       }
0124 
0125       part->set5Momentum(mom-(2.*(KplusKtilde*mom)/KplusKtilde2)*KplusKtilde+(2.*(Ktilde*mom)/K2)*K);
0126       
0127     }
0128 
0129     /*
0130      * SW 30/01/2019: Test feature only, not for release.
0131      * Return true to only apply the transformation to non-coloured particles.
0132      * Note this requires careful handling in DipoleEventRecord
0133      */
0134     //virtual bool transformHardOnly() const { return theTransformHardOnly; }
0135 
0136 
0137     /**
0138      * SW 30/01/2019: Test feature only, not for release.
0139      * Perform the recoil in the case of a decayed parton
0140      */   
0141     // virtual void transformHard ( PPtr& hard ) {
0142     // if ( !theTransformationCalculated ) {
0143     //   setTransformation();
0144     //   theTransformationCalculated = true;
0145     // }
0146     //   hard->setMomentum(splitRecoilMomentum());
0147     //   hard->rescaleMass();
0148     // }
0149 
0150   
0151   public:
0152 
0153     /** @name Functions used by the persistent I/O system. */
0154     //@{
0155     /**
0156      * Function used to write out object persistently.
0157      * @param os the persistent output stream written to.
0158      */
0159     void persistentOutput(PersistentOStream & os) const;
0160 
0161     /**
0162      * Function used to read in object persistently.
0163      * @param is the persistent input stream read from.
0164      * @param version the version number of the object when written.
0165      */
0166     void persistentInput(PersistentIStream & is, int version);
0167     //@}
0168 
0169     /**
0170      * The standard Init function used to initialize the interfaces.
0171      * Called exactly once for each class by the class description system
0172      * before the main function starts or
0173      * when this class is dynamically loaded.
0174      */
0175     static void Init();
0176 
0177   protected:
0178 
0179     /** @name Clone Methods. */
0180     //@{
0181     /**
0182      * Make a simple clone of this object.
0183      * @return a pointer to the new object.
0184      */
0185     virtual IBPtr clone() const;
0186 
0187     /** Make a clone of this object, possibly modifying the cloned object
0188      * to make it sane.
0189      * @return a pointer to the new object.
0190      */
0191     virtual IBPtr fullclone() const;
0192     //@}
0193 
0194 
0195     // If needed, insert declarations of virtual function defined in the
0196     // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
0197 
0198 
0199   private:
0200 
0201     /**
0202      * The static object used to initialize the description of this class.
0203      * Indicates that this is a concrete class with persistent data.
0204      */
0205     static ClassDescription<IILightKinematics> initIILightKinematics;
0206 
0207     /**
0208      * The assignment operator is private and must never be called.
0209      * In fact, it should not even be implemented.
0210      */
0211     IILightKinematics & operator=(const IILightKinematics &) = delete;
0212 
0213   private:
0214 
0215     /**
0216      * Wether or not to choose the `collinear' scheme
0217      */
0218     bool theCollinearScheme;
0219 
0220     bool didCollinear;
0221 
0222     /**
0223      * SW 30/01/2019: Test feature only, not for release.
0224      * Whether to transform only hard (i.e. non-coloured) particles.
0225      */
0226     //bool theTransformHardOnly;
0227   
0228     Lorentz5Momentum K;
0229     Energy2 K2;
0230     Lorentz5Momentum Ktilde;
0231     Lorentz5Momentum KplusKtilde;
0232     Energy2 KplusKtilde2;
0233 
0234     /**
0235      * Store the LorentzRotation object equivalent to the 
0236      * transformation applied to the outgoing particles.
0237      * Need this to apply to the particle SpinInfo if spin
0238      * correlations are included.
0239      */
0240     LorentzRotation theRecoilTransformation;
0241 
0242     /**
0243      * Bool to avoid unecessary recalculation of the 
0244      * Lorentz transformation.
0245      */
0246     bool theTransformationCalculated;
0247     
0248   };
0249 
0250 }
0251 
0252 #include "ThePEG/Utilities/ClassTraits.h"
0253 
0254 namespace ThePEG {
0255 
0256   /** @cond TRAITSPECIALIZATIONS */
0257 
0258   /** This template specialization informs ThePEG about the
0259    *  base classes of IILightKinematics. */
0260   template <>
0261   struct BaseClassTrait<Herwig::IILightKinematics,1> {
0262     /** Typedef of the first base class of IILightKinematics. */
0263     typedef Herwig::DipoleSplittingKinematics NthBase;
0264   };
0265 
0266   /** This template specialization informs ThePEG about the name of
0267    *  the IILightKinematics class and the shared object where it is defined. */
0268   template <>
0269   struct ClassTraits<Herwig::IILightKinematics>
0270     : public ClassTraitsBase<Herwig::IILightKinematics> {
0271     /** Return a platform-independent class name */
0272     static string className() { return "Herwig::IILightKinematics"; }
0273     /**
0274      * The name of a file containing the dynamic library where the class
0275      * IILightKinematics is implemented. It may also include several, space-separated,
0276      * libraries if the class IILightKinematics depends on other classes (base classes
0277      * excepted). In this case the listed libraries will be dynamically
0278      * linked in the order they are specified.
0279      */
0280     static string library() { return "HwDipoleShower.so"; }
0281   };
0282 
0283   /** @endcond */
0284 
0285 }
0286 
0287 #endif /* HERWIG_IILightKinematics_H */