Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:38:29

0001 // -*- C++ -*-
0002 //
0003 // QuarksToHadronsDecayer.h is a part of ThePEG - Toolkit for HEP Event Generation
0004 // Copyright (C) 1999-2019 Leif Lonnblad
0005 //
0006 // ThePEG 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 THEPEG_QuarksToHadronsDecayer_H
0010 #define THEPEG_QuarksToHadronsDecayer_H
0011 // This is the declaration of the QuarksToHadronsDecayer class.
0012 
0013 #include "ThePEG/PDT/Decayer.h"
0014 #include "ThePEG/Handlers/FlavourGenerator.h"
0015 
0016 namespace ThePEG {
0017 
0018 ThePEG_DECLARE_CLASS_POINTERS(FlavourGenerator, FlavGenPtr);
0019 
0020 /**
0021  * The QuarksToHadronsDecayer class inherits from Decayer and is able
0022  * to decay particles to \f$n_q\f$ (2 or 4) quarks which then are
0023  * decayed to hadrons according to phase space. The number of final
0024  * hadrons can either be given by a fixed number or as a Gaussian
0025  * multiplicity distribution centered around \f$c+n_q/4+c_3\f$ and a
0026  * width \f$\sqrt{c}\f$, where \f$c = c_1 \log((m - \sum m)/c_2)\f$,
0027  * \f$m\f$ is the mass of the decaying particle, \f$\sum m\f$ the sum
0028  * of the quark masses and \f$c_i\f$ real parameters.
0029  *
0030  * @see \ref QuarksToHadronsDecayerInterfaces "The interfaces"
0031  * defined for QuarksToHadronsDecayer.
0032  * @see ParticleData
0033  * 
0034  */
0035 class QuarksToHadronsDecayer: public Decayer {
0036 
0037 public:
0038 
0039   /**
0040    * Default constructor.
0041    */
0042   QuarksToHadronsDecayer()
0043     : theFixedN(0), theMinN(2), theC1(4.5), theC2(0.7*GeV), theC3(0.0) {}
0044 
0045 public:
0046 
0047   /** @name Virtual functions required by the Decayer class.
0048    */
0049   //@{
0050   /**
0051    * Check if this decayer can perfom the decay specified by the
0052    * given decay mode.
0053    * @param dm the DecayMode describing the decay.
0054    * @return true if this decayer can handle the given mode, otherwise false.
0055    */
0056   virtual bool accept(const DecayMode & dm) const;
0057 
0058   /**
0059    * Perform a decay for a given DecayMode and a given Particle instance.
0060    * @param dm the DecayMode describing the decay.
0061    * @param p the Particle instance to be decayed.
0062    * @return a ParticleVector containing the decay products.
0063    */
0064   virtual ParticleVector decay(const DecayMode & dm, const Particle & p) const;
0065   //@}
0066 
0067   /**
0068    * Get the number of hadrons to be produced, given the mass of the
0069    * decaying particle, \a m0, and the number, \a Nq and summed masses
0070    * of the quarks, \a summq.
0071    */
0072   virtual int getN(Energy m0, Energy summq, int Nq) const;
0073 
0074   /**
0075    * Produce \a Nh hadrons from the specified \a quarks. The last
0076    * quark is considered to be a spectator quark.
0077    */
0078   virtual PVector getHadrons(int Nh, tcPDVector quarks) const;
0079 
0080   /**
0081    * Distribute the produced children in phase space. This default
0082    * version uses a flat phase space which can be reweighted by
0083    * overriding the reweight() function.
0084    */
0085   virtual void distribute(const Particle & parent, PVector & children) const;
0086 
0087   /**
0088    * Called by distribute() to reweight the default flat phase
0089    * spece. Can be overridden by sub-classes and should return a
0090    * number between 0 and 1. This version returns 1.
0091    */
0092   virtual double reweight(const Particle & parent,
0093               const PVector & children) const;
0094 
0095 public:
0096 
0097   /**
0098    * Return the fixed number of hadrons to be produced. If less than
0099    * 2, the number is instead given by a gaussian multiplicity
0100    * distribution.
0101    */
0102   int fixedN() const { return theFixedN; }
0103 
0104   /**
0105    * Return the minimum number of hadrons to be produced.
0106    */
0107   int minN() const { return theMinN; }
0108 
0109   /**
0110    * Return the parameter \f$c_1\f$ used for the multiplicity
0111    * distriution.
0112    */
0113   double c1() const { return theC1; }
0114 
0115   /**
0116    * Return the parameter \f$c_2\f$ used for the multiplicity
0117    * distriution.
0118    */
0119   Energy c2() const { return theC2; }
0120 
0121   /**
0122    * Return the parameter \f$c_3\f$ used for the multiplicity
0123    * distriution.
0124    */
0125   double c3() const { return theC3; }
0126 
0127   /**
0128    * Return a pointer to the flavour generator to be used.
0129    */
0130   tcFlavGenPtr flavourGenerator() const { return theFlavourGenerator; }
0131 
0132 public:
0133 
0134 
0135   /** @name Functions used by the persistent I/O system. */
0136   //@{
0137   /**
0138    * Function used to write out object persistently.
0139    * @param os the persistent output stream written to.
0140    */
0141   void persistentOutput(PersistentOStream & os) const;
0142 
0143   /**
0144    * Function used to read in object persistently.
0145    * @param is the persistent input stream read from.
0146    * @param version the version number of the object when written.
0147    */
0148   void persistentInput(PersistentIStream & is, int version);
0149   //@}
0150 
0151   /**
0152    * Standard Init function used to initialize the interfaces.
0153    */
0154   static void Init();
0155 
0156 protected:
0157 
0158 
0159 protected:
0160 
0161   /** @name Clone Methods. */
0162   //@{
0163   /**
0164    * Make a simple clone of this object.
0165    * @return a pointer to the new object.
0166    */
0167   virtual IBPtr clone() const;
0168 
0169   /** Make a clone of this object, possibly modifying the cloned object
0170    * to make it sane.
0171    * @return a pointer to the new object.
0172    */
0173   virtual IBPtr fullclone() const;
0174   //@}
0175 
0176 private:
0177 
0178   /**
0179    * The fixed number of hadrons to be produced. If less than 2, the
0180    * number is instead given by a gaussian multiplicity distribution.
0181    */
0182   int theFixedN;
0183 
0184   /**
0185    * The minimum hadrons to be produced.
0186    */
0187   int theMinN;
0188 
0189   /**
0190    * The parameter \f$c_1\f$ of the multiplicity distribution.
0191    */
0192   double theC1;
0193   /**
0194    * The parameter \f$c_2\f$ of the multiplicity distribution.
0195    */
0196   Energy theC2;
0197 
0198   /**
0199    * The parameter \f$c_3\f$ of the multiplicity distribution.
0200    */
0201   double theC3;
0202 
0203   /**
0204    * The object in charge of generating hadrons spieces from given
0205    * quark flavours.
0206    */
0207   FlavGenPtr theFlavourGenerator;
0208 
0209 private:
0210 
0211   /**
0212    * Describe a concrete class with persistent data.
0213    */
0214   static ClassDescription<QuarksToHadronsDecayer> initQuarksToHadronsDecayer;
0215 
0216   /**
0217    * Private and non-existent assignment operator.
0218    */
0219   QuarksToHadronsDecayer & operator=(const QuarksToHadronsDecayer &) = delete;
0220 
0221 };
0222 
0223 }
0224 
0225 
0226 namespace ThePEG {
0227 
0228 /** @cond TRAITSPECIALIZATIONS */
0229 
0230 /** This template specialization informs ThePEG about the base classes
0231  *  of QuarksToHadronsDecayer. */
0232 template <>
0233 struct BaseClassTrait<QuarksToHadronsDecayer,1>: public ClassTraitsType {
0234   /** Typedef of the first base class of QuarksToHadronsDecayer. */
0235   typedef Decayer NthBase;
0236 };
0237 
0238 /** This template specialization informs ThePEG about the name of the
0239  *  QuarksToHadronsDecayer class and the shared object where it is
0240  *  defined. */
0241 template <>
0242 struct ClassTraits<QuarksToHadronsDecayer>
0243   : public ClassTraitsBase<QuarksToHadronsDecayer> {
0244   /** Return a platform-independent class name */
0245   static string className() { return "ThePEG::QuarksToHadronsDecayer"; }
0246   /** Return the name of the shared library be loaded to get access to
0247    *  the QuarksToHadronsDecayer class and every other class it uses
0248    *  (except the base class). */
0249   static string library() { return "QuarksToHadronsDecayer.so"; }
0250 };
0251 
0252 /** @endcond */
0253 
0254 }
0255 
0256 #endif /* THEPEG_QuarksToHadronsDecayer_H */