Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // PartonSplitter.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_PartonSplitter_H
0010 #define HERWIG_PartonSplitter_H
0011 
0012 #include "CluHadConfig.h"
0013 #include <ThePEG/Interface/Interfaced.h>
0014 #include <ThePEG/Utilities/Selector.h>
0015 #include "PartonSplitter.fh"
0016 
0017 namespace Herwig {
0018 
0019 
0020 using namespace ThePEG;
0021 
0022 
0023 /** \ingroup Hadronization
0024  *  \class PartonSplitter
0025  *  \brief This class splits the gluons from the end of the shower.
0026  *  \author Philip Stephens
0027  *  \author Alberto Ribon
0028  *
0029  *  This class does all of the nonperturbative parton splittings needed
0030  *  immediately after the end of the showering (both initial and final),
0031  *  as very first step of the cluster hadronization.
0032  *
0033  *  the quarks are attributed with different weights for the splitting
0034  *  by default only the splitting in u and d quarks is allowed
0035  *  the option "set /Herwig/Hadronization/PartonSplitter:Split 1"
0036  *  allows for additional splitting into s quarks based on some weight
0037  *  in order for that to work the mass of the strange quark has to be changed
0038  *  from the default value s.t. m_g > 2m_s
0039  *
0040  *
0041  * * @see \ref PartonSplitterInterfaces "The interfaces"
0042  * defined for PartonSplitter.
0043  */
0044 class PartonSplitter: public Interfaced {
0045 
0046 public:
0047 
0048   /**
0049    *  Default constructor
0050    */
0051   PartonSplitter() :
0052      _splitPwtUquark(1),
0053      _splitPwtDquark(1),
0054      _splitPwtSquark(0.5),
0055      _gluonDistance(ZERO),
0056      _splitGluon(0),
0057    _enhanceSProb(0),
0058    _m0(10.*GeV),
0059    _massMeasure(0)
0060   {}
0061 
0062   /**
0063    * This method does the nonperturbative splitting of:
0064    * time-like gluons. At the end of the shower the gluons should be
0065    * on a "physical" mass shell and should therefore be time-like.
0066    * @param tagged The tagged particles to be split
0067    * @return The particles which were not split and the products of splitting.
0068    */
0069   void split(PVector & tagged);
0070 
0071 public:
0072 
0073   /** @name Functions used by the persistent I/O system. */
0074   //@{
0075   /**
0076    * Function used to write out object persistently.
0077    * @param os the persistent output stream written to.
0078    */
0079   void persistentOutput(PersistentOStream & os) const;
0080 
0081   /**
0082    * Function used to read in object persistently.
0083    * @param is the persistent input stream read from.
0084    * @param version the version number of the object when written.
0085    */
0086   void persistentInput(PersistentIStream & is, int version);
0087   //@}
0088 
0089   /**
0090    * The standard Init function used to initialize the interfaces.
0091    * Called exactly once for each class by the class description system
0092    * before the main function starts or
0093    * when this class is dynamically loaded.
0094    */
0095   static void Init();
0096 
0097 protected:
0098 
0099   /** @name Clone Methods. */
0100   //@{
0101   /**
0102    * Make a simple clone of this object.
0103    * @return a pointer to the new object.
0104    */
0105    virtual IBPtr clone() const;
0106 
0107   /** Make a clone of this object, possibly modifying the cloned object
0108    * to make it sane.
0109    * @return a pointer to the new object.
0110    */
0111    virtual IBPtr fullclone() const;
0112   //@}
0113 
0114 protected:
0115 
0116   /** @name Standard Interfaced functions. */
0117   //@{
0118   /**
0119    * Initialize this object after the setup phase before saving an
0120    * EventGenerator to disk.
0121    * @throws InitException if object could not be initialized properly.
0122    */
0123   virtual void doinit();
0124 
0125 //@}
0126 
0127 private:
0128 
0129   /**
0130    * Private and non-existent assignment operator.
0131    */
0132   PartonSplitter & operator=(const PartonSplitter &) = delete;
0133 
0134   /**
0135    * Non-perturbatively split a time-like gluon,
0136    * if something goes wrong null pointers are returned.
0137    * @param gluon The gluon to be split
0138    * @param quark The quark produced in the splitting
0139    * @param anti  The antiquark produced in the splitting
0140    */
0141   void splitTimeLikeGluon(tcPPtr gluon, PPtr & quark, PPtr & anti);
0142 
0143 
0144   /**
0145    * Non-perturbatively split a time-like gluon using a mass-based
0146    * strangeness enhancement,
0147    * if something goes wrong null pointers are returned.
0148    * @param gluon The gluon to be split
0149    * @param quark The quark produced in the splitting
0150    * @param anti  The antiquark produced in the splitting
0151    * @param gluon's index in the colour-sorted Particle vector
0152    */
0153   void massSplitTimeLikeGluon(tcPPtr gluon, PPtr & quark, PPtr & anti,
0154     size_t i);
0155 
0156   /**
0157    * Colour-sort the event into grouped colour-singlets.
0158    * Convention: triplet - gluons - antitriplet, repeat for
0159    * all other colour-singlets or colourless particles.
0160    */
0161   void colourSorted(PVector& tagged);
0162 
0163   /**
0164    *   Method to calculate the probability for producing strange quarks
0165    */
0166   double enhanceStrange(size_t i);
0167 
0168 private:
0169 
0170   /**
0171   *  Different variables for the weight for splitting into various
0172   *  light quark species.
0173   */
0174   double _splitPwtUquark;
0175   double _splitPwtDquark;
0176   double _splitPwtSquark;
0177 
0178   /**
0179    *  The selector to pick the type of quark
0180    */
0181   Selector<PDPtr,double> _quarkSelector;
0182 
0183   /**
0184    *   c tau for gluon decays
0185    */
0186   Length _gluonDistance;
0187 
0188   /**
0189    * Flag used to determine between normal gluon splitting and alternative gluon splitting
0190    */
0191   int _splitGluon;
0192 
0193   /**
0194    *   Vector that stores the index in the event record of the anti-triplet
0195    *   of the colour-singlets, or of a colourless particle
0196    */
0197   vector<int> _colSingletSize;
0198 
0199   /**
0200    *   Vector that stores the masses of the colour-singlets or of a colourless
0201    *   particle
0202    */
0203   vector<Energy2> _colSingletm2;
0204 
0205   /**
0206    *   Option to choose which functional form to use for strangeness
0207    *   production
0208    */
0209   int _enhanceSProb;
0210 
0211   /**
0212    *   Characteristic mass scale for strangeness enhancement
0213    */
0214   Energy _m0;
0215 
0216   /**
0217   *  Flag that switches between mass measures used in strangeness enhancement:
0218   *  cluster mass, or the lambda measure -  ( m_{clu}^2 - (m_q + m_{qbar})^2 )
0219   */
0220   int _massMeasure;
0221 
0222   /**
0223   *  Constant variable that stops the scale in strangeness enhancement from
0224   *  becoming too large
0225   */
0226   const double _maxScale = 20.;
0227 
0228 };
0229 
0230 }
0231 
0232 #endif /* HERWIG_PartonSplitter_H */