Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // ClusterFissioner.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_ClusterFissioner_H
0010 #define HERWIG_ClusterFissioner_H
0011 
0012 #include <ThePEG/Interface/Interfaced.h>
0013 #include "CluHadConfig.h"
0014 #include "HadronSelector.h"
0015 #include "ClusterFissioner.fh"
0016 #include "CheckId.h"
0017 
0018 namespace Herwig {
0019 using namespace ThePEG;
0020 
0021   //class Cluster;          // forward declaration
0022 
0023 /** \ingroup Hadronization
0024  *  \class ClusterFissioner
0025  *  \brief This class handles clusters which are too heavy.
0026  *  \author Philip Stephens
0027  *  \author Alberto Ribon
0028  *  \author Stefan Gieseke
0029  *
0030  *  This class does the job of chopping up either heavy clusters or beam
0031  *  clusters in two lighter ones. The procedure is repeated recursively until
0032  *  all of the cluster children have masses below some threshold values.
0033  *
0034  *  For the beam remnant clusters, at the moment what is done is the following.
0035  *  In the case that the soft underlying event is switched on, the
0036  *  beam remnant clusters are tagged as not available,
0037  *  therefore they will not be treated at all during the hadronization.
0038  *  In the case instead that the soft underlying event is switched off,
0039  *  then the beam remnant clusters are treated exactly as "normal" clusters,
0040  *  with the only exception of the mass spectrum used to generate the
0041  *  cluster children masses. For non-beam clusters, the masses of the cluster
0042  *  children are draw from a power-like mass distribution; for beam clusters,
0043  *  according to the value of the flag _IOpRem, either both
0044  *  children masses are draw from a fast-decreasing exponential mass
0045  *  distribution (case _IOpRem == 0, or, indendently by
0046  *  _IOpRem, in the special case that the beam cluster contains two
0047  *  beam remnants), or one mass from the exponential distribution (corresponding
0048  *  of the cluster child with the beam remnant) and the other with the usual
0049  *  power-like distribution (case _IOpRem == 1, which is the
0050  *  default one, as in Herwig 6.3).
0051  *
0052  *  The reason behind the use of a fast-decreasing exponential distribution
0053  *  is that to avoid a large transverse energy from the many sequential
0054  *  fissions that would otherwise occur due to the typical large cluster
0055  *  mass of beam clusters. Using instead an exponential distribution
0056  *  the masses of the two cluster children will be very small (order of
0057  *  GeV).
0058  *
0059  *  The rationale behind the implementation of the splitting of clusters
0060  *  has been to preserve *all* of the information about such splitting
0061  *  process. More explicitly a ThePEG::Step class is passed in and the
0062  *  new clusters are added to the step as the decay products of the
0063  *  heavy cluster. This approach has the twofold
0064  *  advantage to provide all of the information that could be needed
0065  *  (expecially in future developments), without any information loss,
0066  *  and furthermore it allows a better debugging.
0067  *
0068  *  @see HadronSelector
0069  * @see \ref ClusterFissionerInterfaces "The interfaces"
0070  * defined for ClusterFissioner.
0071  */
0072 class ClusterFissioner: public Interfaced {
0073 
0074 public:
0075 
0076   /** @name Standard constructors and destructors. */
0077   //@{
0078   /**
0079    * Default constructor.
0080    */
0081    ClusterFissioner();
0082 
0083   //@}
0084 
0085   /** Splits the clusters which are too heavy.
0086    *
0087    * Split either heavy clusters or beam clusters recursively until all
0088    * children have mass below some threshold. Heavy clusters are those that
0089    * satisfy the condition
0090    * \f[ M^P > C^P + S^P \f]
0091    * where \f$ M \f$ is the clusters mass, \f$ P \f$ is the parameter
0092    * ClPow, \f$ C \f$ is the parameter ClMax and \f$ S \f$ is the
0093    * sum of the clusters constituent partons.
0094    * For beam clusters, they are split only if the soft underlying event
0095    * is switched off, otherwise these clusters will be tagged as unavailable
0096    * and they will not be treated by the hadronization altogether.
0097    * In the case beam clusters will be split, the procedure is exactly
0098    * the same as for normal non-beam clusters, with the only exception
0099    * of the mass spectrum from which to draw the masses of the two
0100    * cluster children (see method drawChildrenMasses for details).
0101    */
0102   tPVector fission(ClusterVector & clusters, bool softUEisOn);
0103 
0104 public:
0105 
0106   /** @name Functions used by the persistent I/O system. */
0107   //@{
0108   /**
0109    * Function used to write out object persistently.
0110    * @param os the persistent output stream written to.
0111    */
0112   void persistentOutput(PersistentOStream & os) const;
0113 
0114   /**
0115    * Function used to read in object persistently.
0116    * @param is the persistent input stream read from.
0117    * @param version the version number of the object when written.
0118    */
0119   void persistentInput(PersistentIStream & is, int version);
0120   //@}
0121 
0122   /**
0123    * Standard Init function used to initialize the interfaces.
0124    */
0125   static void Init();
0126 
0127 protected:
0128 
0129   /** @name Clone Methods. */
0130   //@{
0131   /**
0132    * Make a simple clone of this object.
0133    * @return a pointer to the new object.
0134    */
0135   virtual IBPtr clone() const;
0136 
0137   /** Make a clone of this object, possibly modifying the cloned object
0138    * to make it sane.
0139    * @return a pointer to the new object.
0140    */
0141   virtual IBPtr fullclone() const;
0142   //@}
0143 
0144 private:
0145 
0146   /**
0147    * Private and non-existent assignment operator.
0148    */
0149   ClusterFissioner & operator=(const ClusterFissioner &) = delete;
0150 
0151   /**
0152    * This method directs the splitting of the heavy clusters
0153    *
0154    * This method does the splitting of the clusters and all of its cluster
0155    * children, if heavy. All of these new children clusters are added to the
0156    * collection of clusters. The method works as follows.
0157    * Initially the vector contains just the stack of input pointers to the
0158    * clusters to be split. Then it will be filled recursively by all
0159    * of the cluster's children that are heavy enough to require
0160    * to be split. In each loop, the last element of the vector is
0161    * considered (only once because it is then removed from the vector).
0162    *
0163    * \todo is the following still true?
0164    * For normal, non-beam clusters, a power-like mass distribution
0165    * is used, whereas for beam clusters a fast-decreasing exponential mass
0166    * distribution is used instead. This avoids many iterative splitting which
0167    * could produce an unphysical large transverse energy from a supposed
0168    * soft beam remnant process.
0169    */
0170   void cut(stack<ClusterPtr> &,
0171        ClusterVector&, tPVector & finalhadrons, bool softUEisOn);
0172 
0173 public:
0174 
0175   /**
0176    * Definition for easy passing of two particles.
0177    */
0178   typedef pair<PPtr,PPtr> PPair;
0179 
0180   /**
0181    * Definition for use in the cut function.
0182    */
0183   typedef pair<PPair,PPair> cutType;
0184 
0185   /**
0186    * Splits the input cluster.
0187    *
0188    * Split the input cluster (which can be either an heavy non-beam
0189    * cluster or a beam cluster). The result is two pairs of particles. The
0190    * first element of each pair is new cluster/hadron, while the second
0191    * element of each pair is the particle drawn from the vacuum to create
0192    * the new cluster/hadron.
0193    * Notice that this method treats also beam clusters by using a different
0194    * mass spectrum used to generate the cluster child masses (see method
0195    * drawChildMass).
0196    */
0197   //@{
0198   /**
0199    *  Split two-component cluster
0200    */
0201   virtual cutType cutTwo(ClusterPtr &, tPVector & finalhadrons, bool softUEisOn);
0202 
0203   /**
0204    *  Split three-component cluster
0205    */
0206   virtual cutType cutThree(ClusterPtr &, tPVector & finalhadrons, bool softUEisOn);
0207   //@}
0208 public:
0209 
0210   /**
0211    * Produces a hadron and returns the flavour drawn from the vacuum.
0212    *
0213    * This routine produces a new hadron. It
0214    * also sets the momentum and vertex to the values given.
0215    */
0216   PPair produceHadron(tcPDPtr hadron, tPPtr newPtr, const Lorentz5Momentum &a,
0217               const LorentzPoint &b) const;
0218 
0219 protected:
0220 
0221   /**
0222   *  Function that returns either the cluster mass or the lambda measure
0223   */
0224   Energy2 clustermass(const ClusterPtr & cluster) const;
0225 
0226   /**
0227    * Draw a new flavour for the given cluster; currently defaults to
0228    * the default model
0229    */
0230   virtual void drawNewFlavour(PPtr& newPtr1, PPtr& newPtr2, const ClusterPtr & cluster) const {
0231     if (_enhanceSProb == 0){
0232       drawNewFlavour(newPtr1,newPtr2);
0233     }
0234     else {
0235       drawNewFlavourEnhanced(newPtr1,newPtr2,clustermass(cluster));
0236     }
0237   }
0238 
0239   /**
0240    * Calculate the masses and possibly kinematics of the cluster
0241    * fission at hand; if claculateKineamtics is perfomring non-trivial
0242    * steps kinematics claulcated here will be overriden. Currentl;y resorts to the default
0243    */
0244   virtual pair<Energy,Energy> drawNewMasses(Energy Mc, bool soft1, bool soft2,
0245                         Lorentz5Momentum& pClu1, Lorentz5Momentum& pClu2,
0246                         tPPtr ptrQ1, Lorentz5Momentum& pQ1,
0247                         tPPtr, Lorentz5Momentum& pQone,
0248                         tPPtr, Lorentz5Momentum& pQtwo,
0249                         tPPtr ptrQ2,  Lorentz5Momentum& pQ2) const {
0250 
0251     pair<Energy,Energy> result;
0252 
0253     double exp1=_pSplitLight;
0254     double exp2=_pSplitLight;
0255 
0256     if     (CheckId::isExotic(ptrQ1->dataPtr())) exp1 = _pSplitExotic;
0257     else if(CheckId::hasBottom(ptrQ1->dataPtr()))exp1 = _pSplitBottom;
0258     else if(CheckId::hasCharm(ptrQ1->dataPtr())) exp1 = _pSplitCharm;
0259 
0260     if     (CheckId::isExotic(ptrQ2->dataPtr()))  exp2 = _pSplitExotic;
0261     else if(CheckId::hasBottom(ptrQ2->dataPtr())) exp2 = _pSplitBottom;
0262     else if(CheckId::hasCharm(ptrQ2->dataPtr()))  exp2 = _pSplitCharm;
0263 
0264     result.first = drawChildMass(Mc,pQ1.mass(),pQ2.mass(),pQone.mass(),exp1,soft1);
0265     result.second = drawChildMass(Mc,pQ2.mass(),pQ1.mass(),pQtwo.mass(),exp2,soft2);
0266 
0267     pClu1.setMass(result.first);
0268     pClu2.setMass(result.second);
0269 
0270     return result;
0271 
0272   }
0273 
0274   /**
0275    * Calculate the final kinematics of a heavy cluster decay C->C1 +
0276    * C2, if not already performed by drawNewMasses
0277    */
0278   virtual void calculateKinematics(const Lorentz5Momentum &pClu,
0279                    const Lorentz5Momentum &p0Q1,
0280                    const bool toHadron1, const bool toHadron2,
0281                    Lorentz5Momentum &pClu1, Lorentz5Momentum &pClu2,
0282                    Lorentz5Momentum &pQ1, Lorentz5Momentum &pQb,
0283                    Lorentz5Momentum &pQ2, Lorentz5Momentum &pQ2b) const;
0284 
0285 protected:
0286 
0287   /**
0288    * Produces a cluster from the flavours passed in.
0289    *
0290    * This routine produces a new cluster with the flavours given by ptrQ and newPtr.
0291    * The new 5 momentum is a and the parent momentum are c and d. C is for the
0292    * ptrQ and d is for the new particle newPtr. rem specifies whether the existing
0293    * particle is a beam remnant or not.
0294    */
0295   PPair produceCluster(tPPtr ptrQ, tPPtr newPtr, const Lorentz5Momentum &a,
0296                const LorentzPoint &b, const Lorentz5Momentum &c,
0297                const Lorentz5Momentum &d, const bool rem,
0298                tPPtr spect=tPPtr(), bool remSpect=false) const;
0299 
0300   /**
0301    * Returns the new quark-antiquark pair
0302    * needed for fission of a heavy cluster. Equal probabilities
0303    * are assumed for producing  u, d, or s pairs.
0304    */
0305   void drawNewFlavour(PPtr& newPtrPos, PPtr& newPtrNeg) const;
0306 
0307   /**
0308    * Returns the new quark-antiquark pair
0309    * needed for fission of a heavy cluster. Equal probabilities
0310    * are assumed for producing  u, d, or s pairs.
0311    * Extra argument is used when performing strangeness enhancement
0312    */
0313   void drawNewFlavourEnhanced(PPtr& newPtrPos,PPtr& newPtrNeg, Energy2 mass2) const;
0314 
0315 
0316   /**
0317    * Produces the mass of a child cluster.
0318    *
0319    * Draw the masses \f$M'\f$ of the the cluster child produced
0320    * by the fission of an heavy cluster (of mass M). m1, m2 are the masses
0321    * of the constituents of the cluster; m is the mass of the quark extract
0322    * from the vacuum (together with its antiparticle). The algorithm produces
0323    * the mass of the cluster formed with consituent m1.
0324    * Two mass distributions can be used for the child cluster mass:
0325    * -# power-like mass distribution ("normal" mass) with power exp
0326    *    \f[ M' = {\rm rnd}((M-m_1-m_2-m)^P, m^p)^{1/P} + m_1 \f]
0327    *    where \f$ P \f$ is a parameter of the model and \f$ \rm{rnd} \f$ is
0328    *    the function:
0329    *    \f[ \rm{rnd}(a,b) = (1-r)a + r b \f]
0330    *    and here \f$ r \f$ is a random number [0,1].
0331    * -# fast-decreasing exponential mass distribution ("soft" mass) with
0332    *    rmin. rmin is given by
0333    *    \f[ r_{\rm min} = \exp(-b (M - m_1 - m_2 - 2 m))  \f]
0334    *    where \f$ b \f$ is a parameter of the model. The generated mass is
0335    *    given by
0336    *    \f[ M' = m_1 + m - \frac{\log\left(
0337    *             {\rm rnd}(r_{\rm min}, 1-r_{\rm min})\right)}{b} \f].
0338    *
0339    * The choice of which mass distribution should be used for each of the two
0340    * cluster children is dictated by the parameter soft.
0341    */
0342   Energy drawChildMass(const Energy M, const Energy m1, const Energy m2,
0343                const Energy m, const double exp, const bool soft) const;
0344 
0345   /**
0346    * Determine the positions of the two children clusters.
0347    *
0348    * This routine generates the momentum of the decay products. It also
0349    * generates the momentum in the lab frame of the partons drawn out of
0350    * the vacuum.
0351    */
0352   void calculatePositions(const Lorentz5Momentum &pClu,
0353                   const LorentzPoint & positionClu,
0354               const Lorentz5Momentum & pClu1,
0355               const Lorentz5Momentum & pClu2,
0356               LorentzPoint & positionClu1,
0357               LorentzPoint & positionClu2 ) const;
0358 
0359 protected:
0360 
0361   /** @name Access members for child classes. */
0362   //@{
0363   /**
0364    *  Access to the hadron selector
0365    */
0366   HadronSelectorPtr hadronSelector() const {return _hadronSelector;}
0367 
0368   /**
0369    *  Access to soft-cluster parameter
0370    */
0371   Energy btClM() const {return _btClM;}
0372 
0373   /**
0374    *  Cluster splitting paramater for light quarks
0375    */
0376   double pSplitLight() const {return _pSplitLight;}
0377 
0378   /**
0379    *  Cluster splitting paramater for bottom quarks
0380    */
0381   double pSplitBottom() const {return _pSplitBottom;}
0382 
0383   /**
0384    *  Cluster splitting paramater for charm quarks
0385    */
0386   double pSplitCharm() const {return _pSplitCharm;}
0387 
0388   /**
0389    *  Cluster splitting paramater for exotic particles
0390    */
0391   double pSplitExotic() const {return _pSplitExotic;}
0392   //@}
0393 
0394 private:
0395 
0396   /**
0397   * Smooth probability for dynamic threshold cuts:
0398   * @scale the current scale, e.g. the mass of the cluster,
0399   * @threshold the physical threshold,
0400    */
0401   bool ProbablityFunction(double scale, double threshold);
0402 
0403   /**
0404    * Check if a cluster is heavy enough to split again
0405    */
0406   bool isHeavy(tcClusterPtr );
0407 
0408   /**
0409    * A pointer to a Herwig::HadronSelector object for generating hadrons.
0410    */
0411   HadronSelectorPtr _hadronSelector;
0412 
0413   /**
0414    * @name The Cluster max mass,dependant on which quarks are involved, used to determine when
0415    * fission will occur.
0416    */
0417   //@{
0418   Energy _clMaxLight;
0419   Energy _clMaxBottom;
0420   Energy _clMaxCharm;
0421   Energy _clMaxExotic;
0422   //@}
0423   /**
0424    * @name The power used to determine when cluster fission will occur.
0425    */
0426   //@{
0427   double _clPowLight;
0428   double _clPowBottom;
0429   double _clPowCharm;
0430   double _clPowExotic;
0431   //@}
0432   /**
0433    * @name The power, dependant on whic quarks are involved, used in the cluster mass generation.
0434    */
0435   //@{
0436   double _pSplitLight;
0437   double _pSplitBottom;
0438   double _pSplitCharm;
0439   double _pSplitExotic;
0440 
0441 
0442   // weights for alternaive cluster fission
0443   double _fissionPwtUquark;
0444   double _fissionPwtDquark;
0445   double _fissionPwtSquark;
0446 
0447   /**
0448   * Flag used to determine between normal cluster fission and alternative cluster fission
0449   */
0450   int _fissionCluster;
0451 
0452   /**
0453   * Flag to choose static or dynamic kinematic thresholds in cluster splittings
0454   */
0455   int _kinematicThresholdChoice;
0456 
0457   //@}
0458    /**
0459    * Parameter used (2/b) for the beam cluster mass generation.
0460    * Currently hard coded value.
0461    */
0462   Energy _btClM;
0463 
0464   /**
0465    * Flag used to determine what distributions to use for the cluster masses.
0466    */
0467   int _iopRem;
0468 
0469   /**
0470    * The string constant
0471    */
0472   Tension _kappa;
0473 
0474   /**
0475   *  Flag that switches between no strangeness enhancement, scaling enhancement,
0476   *  and exponential enhancement (in numerical order)
0477   */
0478   int _enhanceSProb;
0479 
0480   /**
0481   *  Parameter that governs the strangeness enhancement scaling
0482   */
0483   Energy _m0Fission;
0484 
0485   /**
0486   *  Flag that switches between mass measures used in strangeness enhancement:
0487   *  cluster mass, or the lambda measure -  ( m_{clu}^2 - (m_q + m_{qbar})^2 )
0488   */
0489   int _massMeasure;
0490 
0491   /**
0492   *  Constant variable which stops the scale from being to large, and not worth
0493   *  calculating
0494   */
0495   const double _maxScale = 20.;
0496 
0497   /**
0498   * Power factor in ClausterFissioner bell probablity function
0499   */
0500   double _probPowFactor;
0501 
0502   /**
0503   * Shifts from the center in ClausterFissioner bell probablity function
0504   */
0505   double _probShift;
0506 
0507   /**
0508   * Shifts from the kinetic threshold in ClausterFissioner
0509   */
0510   Energy2 _kinThresholdShift;
0511 
0512 };
0513 
0514 }
0515 
0516 #endif /* HERWIG_ClusterFissioner_H */