thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
Decayer.h
1 // -*- C++ -*-
2 //
3 // Decayer.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2019 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ThePEG_Decayer_H
10 #define ThePEG_Decayer_H
11 // This is the declaration of the Decayer class.
12 
13 #include "ThePEG/Config/ThePEG.h"
14 #include "Decayer.fh"
15 #include "ThePEG/Handlers/HandlerBase.h"
16 #include "ThePEG/MatrixElement/Amplitude.h"
17 
18 namespace ThePEG {
19 
29 class Decayer: public HandlerBase {
30 
31 public:
32 
41  virtual bool accept(const DecayMode & dm) const = 0;
42 
50  virtual bool needsFullStep() const;
51 
58  virtual ParticleVector decay(const DecayMode & dm,
59  const Particle & p) const = 0;
60 
74  virtual ParticleVector decay(const DecayMode & dm, const Particle & p,
75  Step & step) const;
76 
84  virtual double brat(const DecayMode & dm, const ParticleData & pd,
85  double oldbrat) const;
86 
94  virtual double brat(const DecayMode & dm, const Particle & p,
95  double oldbrat) const;
96 
103  virtual ParticleVector getChildren(const DecayMode & dm,
104  const Particle & parent) const;
105 
111  virtual void finalBoost(const Particle & parent,
112  const ParticleVector & children) const;
113 
119  virtual void setScales(const Particle & parent,
120  const ParticleVector & children) const;
122 
128 
136  static ParticleVector
137  DecayParticle(tPPtr parent, Step & step, long maxtry = 1000);
138 
142  struct DecayFailure: public Exception {};
143 
144 public:
145 
146 
153  void persistentOutput(PersistentOStream & os) const;
154 
160  void persistentInput(PersistentIStream & is, int version);
162 
166  static void Init();
167 
168 private:
169 
175 
179  Decayer & operator=(const Decayer &) = delete;
180 
186 
187 };
188 
193 template <>
194 struct BaseClassTrait<Decayer,1>: public ClassTraitsType {
196  typedef HandlerBase NthBase;
197 };
198 
201 template <>
202 struct ClassTraits<Decayer>: public ClassTraitsBase<Decayer> {
204  static string className() { return "ThePEG::Decayer"; }
205 };
206 
209 }
210 
211 #endif /* ThePEG_Decayer_H */
static void Init()
Standard Init function used to initialize the interfaces.
PersistentIStream is used to read persistent objects from a stream where they were previously written...
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
virtual double brat(const DecayMode &dm, const ParticleData &pd, double oldbrat) const
Calculate branching ratio.
The Particle class is used to describe an instance of a particle.
Definition: Particle.h:83
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
virtual bool needsFullStep() const
Return true if this Decayer need to access the full current step when a particle is decayed...
const Exception & operator=(const Exception &ex)
Assignment.
Definition: Exception.h:104
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
Exception class used if something goes wrong in DecayParticle().
Definition: Decayer.h:142
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
Ptr< Amplitude >::pointer theAmplitude
A possible null pointer to an amplitude associated with this matrix element.
Definition: Decayer.h:185
virtual ParticleVector getChildren(const DecayMode &dm, const Particle &parent) const
Produce the children.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
This is the main config header file for ThePEG.
ParticleData inherits from InterfacedBase and represents the properties of a particle type...
Definition: ParticleData.h:36
Ptr< Amplitude >::pointer amplitude() const
Return an amplitude associated with this decay matrix element.
Definition: Decayer.h:127
virtual ParticleVector decay(const DecayMode &dm, const Particle &p) const =0
Perform a decay for a given DecayMode and a given Particle instance.
static AbstractNoPIOClassDescription< Decayer > initDecayer
The static object used to initialize the description of this class.
Definition: Decayer.h:174
virtual bool accept(const DecayMode &dm) const =0
Check if this decayer can perfom the decay specified by the given decay mode.
A concreate implementation of ClassDescriptionBase describing an abstract class without persistent da...
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
virtual void setScales(const Particle &parent, const ParticleVector &children) const
Set the scales.
HandlerBase is an abstract base class derived from the Interfaced class via the HandlerBaseT class ad...
Definition: HandlerBase.h:151
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
Exception is the base class for all exceptions to be used in ThePEG.
Definition: Exception.h:44
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
The DecayMode class describes a decay channel of a particle.
Definition: DecayMode.h:87
Decayer is an abstract base class to specify objects modelling the decay of a particle.
Definition: Decayer.h:29
vector< PPtr > ParticleVector
A vector of pointers to Particle objects.
Definition: Containers.h:73
virtual void finalBoost(const Particle &parent, const ParticleVector &children) const
Boost the decay products.
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52
The Step class contains information of all particles present after certain step in the event generati...
Definition: Step.h:34
static ParticleVector DecayParticle(tPPtr parent, Step &step, long maxtry=1000)
Static function to administer the decay of a particle.