Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Hw7Selector.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_Hw7Selector_H
0010 #define HERWIG_Hw7Selector_H
0011 //
0012 // This is the declaration of the Hw7Selector class.
0013 //
0014 
0015 #include "HadronSelector.h"
0016 
0017 namespace Herwig {
0018 
0019 using namespace ThePEG;
0020 
0021 /** \ingroup hadronization
0022  * The Hw7Selector class selects the hadrons produced in cluster decay using
0023  * the Herwig variant of the cluster model.
0024  *
0025  * @see \ref Hw7SelectorInterfaces "The interfaces"
0026  * defined for Hw7Selector.
0027  */
0028 class Hw7Selector: public HadronSelector {
0029 
0030 public:
0031 
0032   /**
0033    * The default constructor.
0034    */
0035   Hw7Selector() : HadronSelector(1),
0036            _pwtDquark( 1.0 ),_pwtUquark( 1.0 ),_pwtSquark( 1.0 ),_pwtCquark( 0.0 ),
0037            _pwtBquark( 0.0 ),_pwtDIquarkS0( 1.0 ),_pwtDIquarkS1( 1.0 ),
0038            _sngWt( 1.0 ), _decWt( 1.0 ),
0039            _mode(1), _enhanceSProb(0), _m0Decay(1.*GeV),
0040            _scHadronWtFactor(1.), _sbHadronWtFactor(1.)
0041   {}
0042 
0043   /**
0044    * Return the particle data of the diquark (anti-diquark) made by the two
0045    * quarks (antiquarks) par1, par2.
0046    * @param par1 (anti-)quark data pointer
0047    * @param par2 (anti-)quark data pointer
0048    */
0049   virtual PDPtr makeDiquark(tcPDPtr par1, tcPDPtr par2);
0050 
0051 public:
0052 
0053   /** @name Functions used by the persistent I/O system. */
0054   //@{
0055   /**
0056    * Function used to write out object persistently.
0057    * @param os the persistent output stream written to.
0058    */
0059   void persistentOutput(PersistentOStream & os) const;
0060 
0061   /**
0062    * Function used to read in object persistently.
0063    * @param is the persistent input stream read from.
0064    * @param version the version number of the object when written.
0065    */
0066   void persistentInput(PersistentIStream & is, int version);
0067   //@}
0068 
0069   /**
0070    * The standard Init function used to initialize the interfaces.
0071    * Called exactly once for each class by the class description system
0072    * before the main function starts or
0073    * when this class is dynamically loaded.
0074    */
0075   static void Init();
0076 
0077 protected:
0078   
0079   /**
0080    *  Weights for baryons
0081    */
0082   virtual double baryonWeight(long id) const;
0083 
0084   /**
0085    *  Whether to select a meson or a baryon
0086    */
0087   std::tuple<bool,bool,bool> selectBaryon(const Energy cluMass, tcPDPtr par1, tcPDPtr par2) const;
0088 
0089   /**
0090    *  Strange quark weight
0091    */
0092   virtual double strangeWeight(const Energy cluMass, tcPDPtr par1, tcPDPtr par2) const;
0093 
0094   /**
0095    *   Insert a spin\f$\frac12\f$ baryon in the table
0096    */
0097   virtual void insertOneHalf(HadronInfo a, int flav1, int flav2);
0098 
0099   /**
0100    *   Insert a spin\f$\frac32\f$ baryon in the table
0101    */
0102   virtual void insertThreeHalf(HadronInfo a, int flav1, int flav2);
0103   
0104   /**
0105    *  Returns the mass of the lightest pair of baryons.
0106    * @param ptr1 is the first  constituent
0107    * @param ptr2 is the second constituent
0108    * @param pspin Spin in (2S+1) of the diquark
0109    */
0110   tcPDPair lightestBaryonPair(tcPDPtr ptr1, tcPDPtr ptr2, int pspin) const;
0111 
0112 protected:
0113 
0114   /** @name Clone Methods. */
0115   //@{
0116   /**
0117    * Make a simple clone of this object.
0118    * @return a pointer to the new object.
0119    */
0120    virtual IBPtr clone() const;
0121 
0122   /** Make a clone of this object, possibly modifying the cloned object
0123    * to make it sane.
0124    * @return a pointer to the new object.
0125    */
0126    virtual IBPtr fullclone() const;
0127   //@}
0128 
0129 protected:
0130 
0131   /** @name Standard Interfaced functions. */
0132   //@{
0133   /**
0134    * Initialize this object after the setup phase before saving an
0135    * EventGenerator to disk.
0136    * @throws InitException if object could not be initialized properly.
0137    */
0138   virtual void doinit();
0139   //@}
0140 
0141 private:
0142 
0143   /**
0144    * The assignment operator is private and must never be called.
0145    * In fact, it should not even be implemented.
0146    */
0147   Hw7Selector & operator=(const Hw7Selector &) = delete;
0148 
0149 private:
0150 
0151   /**
0152    *  The weights for the different quarks and diquarks
0153    */
0154   //@{
0155   /**
0156    * The probability of producting a down quark.
0157    */
0158   double _pwtDquark;
0159 
0160   /**
0161    * The probability of producting an up quark.
0162    */
0163   double _pwtUquark;
0164 
0165   /**
0166    * The probability of producting a strange quark.
0167    */
0168   double _pwtSquark;
0169 
0170   /**
0171    * The probability of producting a charm quark.
0172    */
0173   double _pwtCquark;
0174 
0175   /**
0176    * The probability of producting a bottom quark.
0177    */
0178   double _pwtBquark;
0179 
0180   /**
0181    * The probability of producting a spin-0 diquark.
0182    */
0183   double _pwtDIquarkS0;
0184 
0185   /**
0186    * The probability of producting a spin-1 diquark.
0187    */
0188   double _pwtDIquarkS1;
0189   //@}
0190 
0191   /**
0192    * Singlet and Decuplet weights
0193    */
0194   //@{
0195   /**
0196    *  The singlet weight
0197    */
0198   double _sngWt;
0199 
0200   /**
0201    *  The decuplet weight
0202    */
0203   double _decWt;
0204   //@}
0205   
0206 private:
0207 
0208   /**
0209    *  Which algorithm to use
0210    */
0211   unsigned int _mode;
0212 
0213   /**
0214   *  Flag that switches between no strangeness enhancement, scaling enhancement,
0215   *  and exponential enhancement (in numerical order)
0216   */
0217   int _enhanceSProb;
0218 
0219   /**
0220   *  Parameter that governs the strangeness enhancement scaling
0221   */
0222   Energy _m0Decay;
0223 
0224   /**
0225   *  Flag that switches between mass measures used in strangeness enhancement:
0226   *  cluster mass, or the lambda measure -  ( m_{clu}^2 - (m_q + m_{qbar})^2 )
0227   */
0228   int _massMeasure;
0229 
0230   /**
0231   *  Constant variable that stops the scale in strangeness enhancement from
0232   *  becoming too large
0233   */
0234   const double _maxScale = 20.;
0235 
0236   /**
0237   *  Heavy strange-charm hadron wight coefficient
0238   */
0239   double _scHadronWtFactor;
0240 
0241   /**
0242   *  Heavy strange-bottom hadron wight coefficient
0243   */
0244   double _sbHadronWtFactor;
0245 
0246   /**
0247    *  Caches of lightest pairs for speed
0248    */
0249   //@{
0250   /**
0251    * Masses of lightest baryon pair
0252    */
0253   map<pair<long,long>,tcPDPair> lightestBaryonsS0_,lightestBaryonsS1_;
0254   //@}
0255 };
0256 
0257 }
0258 
0259 #endif /* HERWIG_Hw7Selector_H */