Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // SplittingGenerator.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_SplittingGenerator_H
0010 #define HERWIG_SplittingGenerator_H
0011 //
0012 // This is the declaration of the SplittingGenerator class.
0013 //
0014 
0015 #include "ThePEG/Interface/Interfaced.h"
0016 #include "Herwig/Shower/QTilde/Base/Branching.h"
0017 #include "Herwig/Shower/QTilde/SplittingFunctions/SudakovFormFactor.h"
0018 #include "SplittingGenerator.fh"
0019 #include "Herwig/Shower/QTilde/Base/ShowerParticle.h"
0020 #include "Herwig/Shower/QTilde/Kinematics/ShowerKinematics.h"
0021 
0022 namespace Herwig {
0023 
0024 using namespace ThePEG;
0025 
0026 /** \ingroup Shower
0027  * 
0028  *  This class is responsible for creating, at the beginning of the Run,
0029  *  all the SplittingFunction objects and the corresponding
0030  *  SudakovFormFactor objects, and then of the generation of splittings 
0031  *  (radiation emissions) during the event.
0032  *  Many switches are defined in this class which allowed the user to turn on/off:
0033  *  -  each type of interaction (QCD, QED, EWK,...);
0034  *  - initial- and final-state radiation for all type of interactions;
0035  *  - initial- and final-state radiation for each type of interaction;
0036  *  - each type of splitting (\f$u\to ug\f$, \f$d\to dg\f$, \f$\ldots\f$, 
0037  *                            \f$g\to gg\f$, \f$g\to u\bar{u}\f$, \f$\ldots\f$).
0038  *
0039  *  These switches are useful mainly for debugging, but eventually can
0040  *  also be used for a "quick and dirty" estimation of systematic errors.
0041  *
0042  *  In the future it should be possible to implement in this class
0043  *
0044  *  -  the \f$1\to2\f$ azimuthal correlations for soft emission due to QCD coherence  
0045  *     using the ShowerParticle object provided in the input.
0046  *  -  Similarly having the \f$\rho-D\f$ matrix and the SplittingFunction pointer
0047  *     it should be possible to implement the spin correlations.
0048  *     
0049  *  @see SudakovFormFactor
0050  *  @see SplitFun
0051  *
0052  * @see \ref SplittingGeneratorInterfaces "The interfaces"
0053  * defined for SplittingGenerator.
0054  */
0055 class SplittingGenerator: public Interfaced {
0056 
0057 public:
0058 
0059   /** @name Standard constructors and destructors. */
0060   //@{
0061   /**
0062    * The default constructor.
0063    */
0064   SplittingGenerator() : _deTuning(1.) {}
0065   //@}
0066 
0067 public:
0068 
0069   /**
0070    *  Methods to select the next branching and reconstruct the kinematics
0071    */
0072   //@{
0073   /**
0074    * Choose a new forward branching for a time-like particle
0075    * The method returns:
0076    * - a pointer to a ShowerKinematics object, which 
0077    *     contains the information about the new scale and all other
0078    *     kinematics variables that need to be generated simultaneously;
0079    * - a pointer to the SudakovFormFactor object associated 
0080    *     with the chosen emission.
0081    * - The PDG codes of the particles in the branching,
0082    * as a Branching struct.
0083    *
0084    * In the case no branching has been generated, both the returned 
0085    * pointers are null ( ShoKinPtr() , tSudakovFFPtr() ).
0086    *
0087    * @param particle The particle to be evolved
0088    * @param enhance The factor by which to ehnace the emission of radiation
0089    * @param type The type of interaction to generate
0090    * @return The Branching struct for the branching
0091    */
0092   Branching chooseForwardBranching(ShowerParticle & particle,
0093                    double enhance,
0094                    ShowerInteraction type) const; 
0095 
0096   /**
0097    * Select the next branching of a particles for the initial-state shower
0098    * in the particle's decay.
0099    * @param particle The particle being showerwed
0100    * @param maxscale The maximum scale
0101    * @param minmass Minimum mass of the particle after the branching
0102    * @param enhance The factor by which to ehnace the emission of radiation
0103    * @param type The type of interaction to generate
0104    * @return The Branching struct for the branching
0105    */
0106   Branching chooseDecayBranching(ShowerParticle & particle, 
0107                  const ShowerParticle::EvolutionScales & maxScales,
0108                  Energy minmass,double enhance,
0109                  ShowerInteraction type) const; 
0110 
0111   /**
0112    * Choose a new backward branching for a space-like particle.
0113    * The method returns:
0114    * - a pointer to a ShowerKinematics object, which 
0115    *     contains the information about the new scale and all other
0116    *     kinematics variables that need to be generated simultaneously;
0117    * - a pointer to the SudakovFormFactor object associated 
0118    *     with the chosen emission.
0119    * - The PDG codes of the particles in the branching,
0120    * as a Branching struct.
0121    *
0122    * In the case no branching has been generated, both the returned 
0123    * pointers are null ( ShoKinPtr() , tSudakovFFPtr() ).
0124    *
0125    * @param particle The particle to be evolved
0126    * @param enhance The factor by which to ehnace the emission of radiation
0127    * @param beamparticle The beam particle
0128    * @param beam The BeamParticleData object
0129    * @param type The type of interaction to generate
0130    * @return The Branching struct for the branching
0131    */
0132   Branching 
0133   chooseBackwardBranching(ShowerParticle & particle,
0134               PPtr beamparticle,
0135               double enhance,
0136               Ptr<BeamParticleData>::transient_const_pointer beam,
0137               ShowerInteraction type,
0138               tcPDFPtr , Energy ) const;
0139   //@}
0140 
0141 public:
0142 
0143   /**
0144    *  Methods to parse the information from the input files to create the 
0145    *  branchings
0146    */
0147   //@{
0148   /**
0149    *  Add a final-state splitting
0150    */
0151   string addFinalSplitting(string arg) { return addSplitting(arg,true); }
0152 
0153   /**
0154    *  Add an initial-state splitting
0155    */
0156   string addInitialSplitting(string arg) { return addSplitting(arg,false); }
0157 
0158   /**
0159    *  Add a final-state splitting
0160    */
0161   string deleteFinalSplitting(string arg) { return deleteSplitting(arg,true); }
0162 
0163   /**
0164    *  Add an initial-state splitting
0165    */
0166   string deleteInitialSplitting(string arg) { return deleteSplitting(arg,false); }
0167   //@}
0168 
0169   /**
0170    *  Access to the splittings
0171    */
0172   //@{
0173   /**
0174    *  Access the final-state branchings
0175    */
0176   const BranchingList & finalStateBranchings() const { return _fbranchings; }
0177 
0178   /**
0179    *  Access the initial-state branchings
0180    */
0181   const BranchingList & initialStateBranchings() const { return _bbranchings; }
0182   //@}
0183 
0184 
0185 public:
0186 
0187   /** @name Functions used by the persistent I/O system. */
0188   //@{
0189   /**
0190    * Function used to write out object persistently.
0191    * @param os the persistent output stream written to.
0192    */
0193   void persistentOutput(PersistentOStream & os) const;
0194 
0195   /**
0196    * Function used to read in object persistently.
0197    * @param is the persistent input stream read from.
0198    * @param version the version number of the object when written.
0199    */
0200   void persistentInput(PersistentIStream & is, int version);
0201   //@}
0202 
0203   /**
0204    * The standard Init function used to initialize the interfaces.
0205    * Called exactly once for each class by the class description system
0206    * before the main function starts or
0207    * when this class is dynamically loaded.
0208    */
0209   static void Init();
0210 
0211 protected:
0212 
0213   /** @name Clone Methods. */
0214   //@{
0215   /**
0216    * Make a simple clone of this object.
0217    * @return a pointer to the new object.
0218    */
0219   virtual IBPtr clone() const;
0220 
0221   /** Make a clone of this object, possibly modifying the cloned object
0222    * to make it sane.
0223    * @return a pointer to the new object.
0224    */
0225   virtual IBPtr fullclone() const;
0226   //@}
0227 
0228 protected:
0229 
0230   /** @name Standard Interfaced functions. */
0231   //@{
0232   /**
0233    * Rebind pointer to other Interfaced objects. Called in the setup phase
0234    * after all objects used in an EventGenerator has been cloned so that
0235    * the pointers will refer to the cloned objects afterwards.
0236    * @param trans a TranslationMap relating the original objects to
0237    * their respective clones.
0238    * @throws RebindException if no cloned object was found for a given
0239    * pointer.
0240    */
0241   virtual void rebind(const TranslationMap & trans)
0242    ;
0243 
0244   /**
0245    * Return a vector of all pointers to Interfaced objects used in this
0246    * object.
0247    * @return a vector of pointers.
0248    */
0249   virtual IVector getReferences();
0250   //@}
0251 
0252 private:
0253 
0254   /**
0255    *  Add a branching to the map
0256    * @param ids PDG coeds of the particles in the branching
0257    * @param sudakov The SudakovFormFactor for the branching
0258    * @param final Whether this is an initial- or final-state branching 
0259    */
0260   void addToMap(const IdList & ids, const SudakovPtr & sudakov, bool final);
0261 
0262   /**
0263    * Remove a branching to the map
0264    * @param ids PDG coeds of the particles in the branching
0265    * @param sudakov The SudakovFormFactor for the branching
0266    * @param final Whether this is an initial- or final-state branching 
0267    */
0268   void deleteFromMap(const IdList & ids, const SudakovPtr & sudakov, bool final);
0269 
0270   /**
0271    * Obtain the reference vectors for a final-state particle
0272    * @param particle The particle
0273    * @param p The p reference vector
0274    * @param n The n reference vector
0275    */
0276   void finalStateBasisVectors(ShowerParticle particle, Lorentz5Momentum & p,
0277                   Lorentz5Momentum & n) const;
0278 
0279   /**
0280    * Add a splitting
0281    * @param in string to be parsed
0282    * @param final Whether this is an initial- or final-state branching 
0283    */
0284   string addSplitting(string in ,bool final);
0285 
0286   /**
0287    * Delete a splitting
0288    * @param in string to be parsed
0289    * @param final Whether this is an initial- or final-state branching 
0290    */
0291   string deleteSplitting(string in ,bool final);
0292 
0293 private:
0294 
0295   /**
0296    * The assignment operator is private and must never be called.
0297    * In fact, it should not even be implemented.
0298    */
0299   SplittingGenerator & operator=(const SplittingGenerator &) = delete;
0300 
0301 private:
0302 
0303   /**
0304    *  List of the branchings and the appropriate Sudakovs for forward branchings
0305    */
0306   BranchingList _fbranchings;
0307 
0308   /**  
0309    * Lists of the branchings and the appropriate Sudakovs for backward branchings.
0310    */
0311   BranchingList _bbranchings;
0312 
0313   /**
0314    *   The detuning parameter
0315    */
0316   double _deTuning;
0317 };
0318 
0319 }
0320 
0321 #endif /* HERWIG_SplittingGenerator_H */