Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // SimpleFlavour.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_SimpleFlavour_H
0010 #define THEPEG_SimpleFlavour_H
0011 // This is the declaration of the SimpleFlavour class.
0012 
0013 #include "ThePEG/Handlers/FlavourGenerator.h"
0014 #include "ThePEG/Utilities/VSelector.h"
0015 // #include "SimpleFlavour.fh"
0016 // #include "SimpleFlavour.xh"
0017 
0018 namespace ThePEG {
0019 
0020 /**
0021  * SimpleFlavour is a simple class to generate hadrons given the quark
0022  * flavours. It implements a simplified version of the model of the
0023  * old fortran version of Pythia.
0024  *
0025  * @see \ref SimpleFlavourInterfaces "The interfaces"
0026  * defined for SimpleFlavour.
0027  */
0028 class SimpleFlavour: public FlavourGenerator {
0029 
0030 public:
0031 
0032   /** A map of <code>Selector</code>s. */
0033   typedef map<long, VSelector< pair<long,long> > > ProbabilityMap;
0034 
0035 public:
0036 
0037   /** @name Standard constructors and destructors. */
0038   //@{
0039   /**
0040    * Default constructor.
0041    */
0042   SimpleFlavour();
0043 
0044   /**
0045    * Destructor.
0046    */
0047   virtual ~SimpleFlavour();
0048   //@}
0049 
0050 public:
0051 
0052   /** @name Virtual functions mandated by the FlavourGenerator base class. */
0053   //@{
0054   /**
0055    * Generate a hadron from a quark. Given a quark(antiquark, diquark
0056    * or antidiquark), choose a quark-antiquark (or
0057    * antidiquark-diquark) pair. Return (first) a hadron formed by the
0058    * original quark and the antiquark together with (second) the
0059    * generated quark. Returns null pointers if the generation failed.
0060    * @param quark a quark, antiquark, diquark or antidiquark.
0061    * @return a pair of ParticleData pointers. The \a first is the
0062    * hadron produced and the \a second is the anti-partner of the
0063    * (anti-)(di-)quark generated to form the hadron.
0064    */
0065   virtual tcPDPair generateHadron(tcPDPtr quark) const;
0066 
0067   /**
0068    * Get hadron from flavours. Return a hadron with the flavour
0069    * content given by the (anti-)(di-)quarks in the argument. The
0070    * arguments are given as PDG codes.
0071    * @param iq1 the PDG code of the first flavour.
0072    * @param iq2 the PDG code of the second flavour.
0073    * @return the corresponding hadron type or null if none could be
0074    * generated.
0075    */
0076   virtual tcPDPtr getHadron(long iq1, long iq2) const;
0077   using FlavourGenerator::getHadron;
0078 
0079   /**
0080    * Return a baryon with the flavour content given by the
0081    * (anti)quarks in the argument.  The arguments are given as
0082    * particle data pointers.
0083    * @param q1 the PDG code of the first flavour.
0084    * @param q2 the PDG code of the second flavour.
0085    * @param q3 the PDG code of the third flavour.
0086    * @return the corresponding baryon type or null if none could be
0087    * generated.
0088    */
0089   virtual tcPDPtr getBaryon(long q1, long q2, long q3) const;
0090   using FlavourGenerator::getBaryon;
0091 
0092   /**
0093    * Generate a random quark flavour.
0094    */
0095   virtual long selectQuark() const;
0096 
0097   /**
0098    * Generate a random (di)quark flavour.
0099    */
0100   virtual long selectFlavour() const;
0101   //@}
0102 
0103 public:
0104 
0105   /** @name Access the parameters controlling the generation. */
0106   //@{
0107   /**
0108    * Return the suppression factor of strange quarks w.r.t. u and d.
0109    */
0110   double sSup() const { return theSSup; }
0111 
0112   /**
0113    * Return the suppression factor for di-quarks w.r.t. quarks
0114    */
0115   double diSup() const { return theDiSup; }
0116 
0117   /**
0118    * Return the suppression of spin-1 di-quarks w.r.t. spin-0 ones;
0119    */
0120   double di1Sup() const { return theDi1Sup; }
0121 
0122   /**
0123    * Return the suppression of strange di-quarks w.r.t. u and d ones
0124    * in addition to the standard strangness suppression of quarks.
0125    */
0126   double diSSup() const  { return theDiSSup; }
0127 
0128   /**
0129    * Return the extra suppression of eta's
0130    */
0131   double etaSup() const  { return theEtaSup; }
0132 
0133   /**
0134    * Return the extra suppression of ets-prime's
0135    */
0136   double etaPSup() const  { return theEtaPSup; }
0137 
0138   /**
0139    * Return the extra suppression for baryons of the spin 3/2
0140    * decuplet.
0141    */
0142   double baryon10Sup() const { return theBaryon10Sup; }
0143 
0144   /**
0145    * Return the probability that light (u/d) mesons has spin 1;
0146    */
0147   double pSpin1() const { return thePSpin1; }
0148 
0149   /**
0150    * Return the probability that strange mesons has spin 1;
0151    */
0152   double pSpinS1() const { return thePSpinS1; }
0153 
0154   /**
0155    * Return the probability that charmed and heavier mesons has spin
0156    * 1;
0157    */
0158   double pSpinC1() const { return thePSpinC1; }
0159   //@}
0160 
0161 protected:
0162 
0163   /**
0164    * Calculate the probabilities for generateHadron for the given
0165    * flavour.
0166    */
0167   virtual void setProbabilities(long iq) const;
0168 
0169   /**
0170    * Return the probability that the given quark flavours end up in a
0171    * vector meson rather than in a pseudo scalar meson.
0172    */
0173   virtual double vectorMesonProbability(long iq1, long iq2) const;
0174 
0175   /**
0176    * Return the probability that the given quark and diquark flavours
0177    * end up in a spin 3/2 decuplet baryon rather than in a spin 1/2
0178    * octet baryon.
0179    */
0180   virtual double baryonDecupletProbability(long iq1, long iq2) const;
0181 
0182   /**
0183    * Return a pseudo scalar meson formed by the two quark flavours.
0184    */
0185   virtual tcPDPtr pseudoScalarMeson(long iq, long iqbar) const;
0186 
0187   /**
0188    * Return a vector meson formed by the two quark flavours.
0189    */
0190   virtual tcPDPtr vectorMeson(long iq, long iqbar) const;
0191 
0192   /**
0193    * Return a spin 1/2 octet baryon formed by the given quark and
0194    * diquark flavours.
0195    */
0196   virtual tcPDPtr baryonOctet(long iq, long idq) const;
0197 
0198   /**
0199    * Return a spin 3/2 decuplet baryon formed by the given quark and
0200    * diquark flavours.
0201    */
0202   virtual tcPDPtr baryonDecuplet(long iq, long idq) const;
0203 
0204   /**
0205    * Return the PDG code of a pseudo scalar meson formed by the two
0206    * quark flavours for \a iqh >= \a iql > 0.
0207    */
0208   virtual long pseudoScalarId(long iqh, long iql) const;
0209 
0210   /**
0211    * Return the PDG code of a vector meson formed by the two quark
0212    * flavours for \a iqh >= \a iql > 0.
0213    */
0214   virtual long vectorId(long iqh, long iql) const;
0215 
0216   /**
0217    * Return the PDG code for a spin 1/2 octet baryon formed by the
0218    * given quark flavours (\a iqa >= \a iqb >= \a iqc > 0). iq is one
0219    * of the flavours and the other two are assumed to be in a diquark
0220    * (in a spin-1 state if \a dqs1).
0221    */
0222   virtual long baryonOctetId(long iqa, long iqb, long iqc,
0223                  long iq, bool dqs1) const;
0224 
0225   /**
0226    * Return the PDG code for a spin 3/2 decuplet baryon formed by the
0227    * given quark flavours (\a iqa >= \a iqb >= \a iqc > 0).
0228    */
0229   virtual long baryonDecupletId(long iqa, long iqb, long iqc) const;
0230 
0231   /**
0232    * Return the PDG code of pseudo scalar mesons formed by the two
0233    * quark flavours (for \a iqh >= \a iql > 0), together with suitable
0234    * weights.
0235    */
0236   virtual vector< pair<long,double> >
0237   pseudoScalarIds(long iqh, long iql) const;
0238 
0239   /**
0240    * Return the PDG codes of vector mesons formed by the two quark
0241    * flavours (for \a iqh >= \a iql > 0), together with
0242    * suitable weights.
0243    */
0244   virtual vector< pair<long,double> > vectorIds(long iqh, long iql) const;
0245 
0246   /**
0247    * Return the PDG codes for spin 1/2 octet baryons formed by the
0248    * given quark flavours (\a iqa >= \a iqb >= \a iqc > 0) together
0249    * with suitable weights. iq is one of the flavours and the other
0250    * two are assumed to be in a diquark (in a spin-1 state if \a dqs1).
0251    */
0252   virtual vector< pair<long,double> >
0253   baryonOctetIds(long iqa, long iqb, long iqc,
0254          long iq, bool dqs1) const;
0255 
0256   /**
0257    * Return the PDG codes for spin 3/2 decuplet baryons formed by
0258    * the given quark flavours (\a iqa >= \a iqb >= \a iqc > 0) together with
0259    * suitable weights.
0260    */
0261   virtual vector< pair<long,double> >
0262   baryonDecupletIds(long iqa, long iqb, long iqc) const;
0263 
0264   /**
0265    * Clear all cashed weights.
0266    */
0267   void clear();
0268 
0269   /**
0270    * Return the SU(6) weight for the given quark and di-quark flavours
0271    * to end up with in a baryon with the given spin (2S+1).
0272    */
0273   static double weightSU6QDiQSpin(long iq, long idq, int spin);
0274 
0275 public:
0276 
0277   /** @name Functions used by the persistent I/O system. */
0278   //@{
0279   /**
0280    * Function used to write out object persistently.
0281    * @param os the persistent output stream written to.
0282    */
0283   void persistentOutput(PersistentOStream & os) const;
0284 
0285   /**
0286    * Function used to read in object persistently.
0287    * @param is the persistent input stream read from.
0288    * @param version the version number of the object when written.
0289    */
0290   void persistentInput(PersistentIStream & is, int version);
0291   //@}
0292 
0293   /**
0294    * Standard Init function used to initialize the interfaces.
0295    */
0296   static void Init();
0297 
0298 protected:
0299 
0300   /** @name Clone Methods. */
0301   //@{
0302   /**
0303    * Make a simple clone of this object.
0304    * @return a pointer to the new object.
0305    */
0306   virtual IBPtr clone() const;
0307 
0308   /** Make a clone of this object, possibly modifying the cloned object
0309    * to make it sane.
0310    * @return a pointer to the new object.
0311    */
0312   virtual IBPtr fullclone() const;
0313   //@}
0314 
0315 protected:
0316 
0317   /** @name Standard Interfaced functions. */
0318   //@{
0319   /**
0320    * Initialize this object after the setup phase before saving an
0321    * EventGenerator to disk.
0322    * @throws InitException if object could not be initialized properly.
0323    */
0324   virtual void doinit();
0325 
0326   /**
0327    * Initialize this object. Called in the run phase just before
0328    * a run begins.
0329    */
0330   virtual void doinitrun();
0331   //@}
0332 
0333 private:
0334 
0335   /**
0336    * Suppression factor of strange quarks w.r.t. u and d.
0337    */
0338   double theSSup;
0339 
0340   /**
0341    * Suppression factor for di-quarks w.r.t. quarks.
0342    */
0343   double theDiSup;
0344 
0345   /**
0346    * Suppression of spin-1 di-quarks w.r.t. spin-0 ones.
0347    */
0348   double theDi1Sup;
0349 
0350   /**
0351    * Suppression of strange di-quarks w.r.t. u and d ones in addition
0352    * to the standard strangness suppression of quarks.
0353    */
0354   double theDiSSup;
0355 
0356   /**
0357    * Extra suppression of eta's.
0358    */
0359   double theEtaSup;
0360 
0361   /**
0362    * Extra suppression of ets-prime's.
0363    */
0364   double theEtaPSup;
0365 
0366   /**
0367    * Extra suppression for baryons of the spin 3/2 decuplet.
0368    */
0369   double theBaryon10Sup;
0370 
0371   /**
0372    * Probability that light (u/d) mesons has spin 1.
0373    */
0374   double thePSpin1;
0375 
0376   /**
0377    * Probability that strange mesons has spin 1.
0378    */
0379   double thePSpinS1;
0380 
0381   /**
0382    * Probability that charmed and heavier mesons has spin 1.
0383    */
0384   double thePSpinC1;
0385 
0386   /**
0387    * A selector used to weight the creation of (di)quark-anti(di)quark
0388    * pairs.
0389    */
0390   mutable VSelector<long> theFlavourSelector;
0391 
0392   /**
0393    * A map of selectors to cash probabilities for generateHadron.
0394    */
0395   mutable ProbabilityMap theProbabilities;
0396 
0397 
0398 private:
0399 
0400   /**
0401    * Describe a concrete class with persistent data.
0402    */
0403   static ClassDescription<SimpleFlavour> initSimpleFlavour;
0404 
0405   /**
0406    * Private and non-existent assignment operator.
0407    */
0408   SimpleFlavour & operator=(const SimpleFlavour &) = delete;
0409 
0410 };
0411 
0412 }
0413 
0414 
0415 namespace ThePEG {
0416 
0417 /** @cond TRAITSPECIALIZATIONS */
0418 
0419 /**
0420  * This template specialization informs ThePEG about the base class of
0421  * SimpleFlavour.
0422  */
0423 template <>
0424 struct BaseClassTrait<SimpleFlavour,1>: public ClassTraitsType {
0425   /** Typedef of the base class of SimpleFlavour. */
0426   typedef FlavourGenerator NthBase;
0427 };
0428 
0429 template <>
0430 /**
0431  * This template specialization informs ThePEG about the name of the
0432  * SimpleFlavour class and the shared object where it is defined.
0433  */
0434 struct ClassTraits<SimpleFlavour>
0435   : public ClassTraitsBase<SimpleFlavour> {
0436   /** Return the class name.  */
0437   static string className() { return "ThePEG::SimpleFlavour"; }
0438   /**
0439    * Return the name of the shared library to be loaded to get access
0440    * to the SimpleFlavour class and every other class it uses (except
0441    * the base class).
0442    */
0443   static string library() { return "SimpleFlavour.so"; }
0444 
0445 };
0446 
0447 /** @endcond */
0448 
0449 }
0450 
0451 #endif /* THEPEG_SimpleFlavour_H */