Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // FlatDecayer.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_FlatDecayer_H
0010 #define ThePEG_FlatDecayer_H
0011 // This is the declaration of the FlatDecayer class.
0012 
0013 #include "ThePEG/PDT/Decayer.h"
0014 
0015 namespace ThePEG {
0016 
0017 /**
0018  * The FlatDecayer class inrerits from the abstract Decayer class and
0019  * implements the decay of a given Particle to a given set of children
0020  * according to a flat phase space distribution.
0021  *
0022  * It is possible to implement a more complicated decay distribution
0023  * by inheriting from the FlatDecayer class and only override the
0024  * virtual function reweight() to return a weight (between zero and
0025  * one) of a given phase space point relative to the flat
0026  * distribution.
0027  *
0028  * @see \ref FlatDecayerInterfaces "The interfaces"
0029  * defined for FlatDecayer.
0030  * @see Decayer
0031  * @see Particle
0032  */
0033 class FlatDecayer: public Decayer {
0034 
0035 public:
0036 
0037   /** @name Virtual functions required by the Decayer class.
0038    */
0039   //@{
0040   /**
0041    * Check if this decayer can perfom the decay specified by the
0042    * given decay mode.
0043    * @param dm the DecayMode describing the decay.
0044    * @return true if this decayer can handle the given mode, otherwise false.
0045    */
0046   virtual bool accept(const DecayMode & dm) const;
0047 
0048   /**
0049    * Perform a decay for a given DecayMode and a given Particle instance.
0050    * @param dm the DecayMode describing the decay.
0051    * @param p the Particle instance to be decayed.
0052    * @return a ParticleVector containing the decay products.
0053    */
0054   virtual ParticleVector decay(const DecayMode & dm, const Particle & p) const;
0055 
0056   /**
0057    * Give a weight to a phase space point. To be overridden by
0058    * subclasses. For a given decay mode, \a dm, decaying \a parent
0059    * particle and decayproducts, \a children, distributed according to
0060    * a flat distribution in phase space, return a weight (less or
0061    * equal to unity) modifying the flat distribution to the desired
0062    * one. Note that the chosen phase space point may be rejected, but
0063    * the chosen decay channel will not. This means that the weight
0064    * returned by this function does not influence the branching
0065    * ratios. For the FlatDecayer class this function simply returns 1.
0066    */
0067   virtual double reweight(const DecayMode &, const Particle & ,
0068               const ParticleVector & ) const {
0069     return 1.0;
0070   }
0071   //@}
0072 
0073 public:
0074 
0075   /**
0076    * Standard Init function used to initialize the interfaces.
0077    */
0078   static void Init();
0079 
0080 protected:
0081 
0082   /** @name Clone Methods. */
0083   //@{
0084   /**
0085    * Make a simple clone of this object.
0086    * @return a pointer to the new object.
0087    */
0088   virtual IBPtr clone() const;
0089 
0090   /** Make a clone of this object, possibly modifying the cloned object
0091    * to make it sane.
0092    * @return a pointer to the new object.
0093    */
0094   virtual IBPtr fullclone() const;
0095   //@}
0096 
0097 private:
0098 
0099   /**
0100    * Describe a concrete class without persistent data.
0101    */
0102   static NoPIOClassDescription<FlatDecayer> initFlatDecayer;
0103 
0104   /**
0105    *  Private and non-existent assignment operator.
0106    */
0107   FlatDecayer & operator=(const FlatDecayer &) = delete;
0108 
0109 };
0110 
0111 }
0112 
0113 
0114 namespace ThePEG {
0115 
0116 /** @cond TRAITSPECIALIZATIONS */
0117 
0118 /** This template specialization informs ThePEG about the base classes
0119  *  of FlatDecayer. */
0120 template <>
0121 struct BaseClassTrait<FlatDecayer,1>: public ClassTraitsType {
0122   /** Typedef of the first base class of FlatDecayer. */
0123   typedef Decayer NthBase;
0124 };
0125 
0126 /** This template specialization informs ThePEG about the name of the
0127  *  FlatDecayer class. */
0128 template <>
0129 struct ClassTraits<FlatDecayer>: public ClassTraitsBase<FlatDecayer> {
0130   /** Return a platform-independent class name */
0131   static string className() { return "ThePEG::FlatDecayer"; }
0132 };
0133 
0134 /** @endcond */
0135 
0136 }
0137 
0138 #endif /* ThePEG_FlatDecayer_H */