Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // WidthGenerator.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_WidthGenerator_H
0010 #define ThePEG_WidthGenerator_H
0011 // This is the declaration of the WidthGenerator class.
0012 
0013 #include "ThePEG/Config/ThePEG.h"
0014 #include "WidthGenerator.fh"
0015 #include "ThePEG/Interface/Interfaced.h"
0016 #include "ThePEG/Utilities/Selector.h"
0017 #include "ThePEG/PDT/DecayMode.fh"
0018 
0019 namespace ThePEG {
0020 
0021 /**
0022  * WidthGenerator is an abstract base class to be used to encapsulate
0023  * models for giving the partial decay width of a ParticleData given
0024  * the specified DecayModes.
0025  *
0026  * @see \ref WidthGeneratorInterfaces "The interfaces"
0027  * defined for WidthGenerator.
0028  * @see ParticleData
0029  * @see DecayMode
0030  */
0031 class WidthGenerator: public Interfaced {
0032 
0033 public:
0034 
0035   /** A selector of <code>DecayModes</code>s weighted by their
0036    *  branching ratios. */
0037   typedef Selector<tDMPtr> DecayMap;
0038 
0039 public:
0040 
0041   /** @name Virtual functions to be overridden by sub-classes. */
0042   //@{
0043   /**
0044    * Return true if this object can be used for the given particle
0045    * type with the given decay map.
0046    */
0047   virtual bool accept(const ParticleData &) const = 0;
0048 
0049   /**
0050    * Given a Particle, calculate a width.
0051    */
0052   Energy width(const Particle &) const;
0053 
0054   /**
0055    * Given a particle type and a mass of an instance of that particle
0056    * type, calculate a width.
0057    */
0058   virtual Energy width(const ParticleData &, Energy m) const = 0;
0059 
0060   /**
0061    * Given a particle type and a mass and a width of an instance of
0062    * that particle type, generate a life time.
0063    */
0064   virtual Length lifeTime(const ParticleData &, Energy m, Energy w) const;
0065 
0066   /**
0067    * Return decay map for the given particle type.
0068    */
0069   virtual DecayMap rate(const ParticleData &) const = 0;
0070 
0071   /**
0072    * Return a decay map for a given Particle instance.
0073    */
0074   virtual DecayMap rate(const Particle &);
0075   //@}
0076 
0077 public:
0078 
0079   /**
0080    * Standard Init function used to initialize the interface.
0081    */
0082   static void Init();
0083 
0084 private:
0085 
0086   /**
0087    * The static object used to initialize the description of this class.
0088    * Indicates that this is an abstract class without persistent data.
0089    */
0090   static AbstractNoPIOClassDescription<WidthGenerator> initWidthGenerator;
0091 
0092   /**
0093    *  Private and non-existent assignment operator.
0094    */
0095   WidthGenerator & operator=(const WidthGenerator &) = delete;
0096 
0097 };
0098 
0099 /** @cond TRAITSPECIALIZATIONS */
0100 
0101 /** This template specialization informs ThePEG about the base classes
0102  *  of WidthGenerator. */
0103 template <>
0104 struct BaseClassTrait<WidthGenerator,1>: public ClassTraitsType {
0105   /** Typedef of the first base class of WidthGenerator. */
0106   typedef Interfaced NthBase;
0107 };
0108 
0109 /** This template specialization informs ThePEG about the name of the
0110  *  WidthGenerator class. */
0111 template <>
0112 struct ClassTraits<WidthGenerator>: public ClassTraitsBase<WidthGenerator> {
0113   /** Return a platform-independent class name */
0114   static string className() { return "ThePEG::WidthGenerator"; }
0115 };
0116 
0117 /** @endcond */
0118 
0119 }
0120 
0121 #endif /* ThePEG_WidthGenerator_H */