thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
DecayMode.h
1// -*- C++ -*-
2//
3// DecayMode.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_DecayMode_H
10#define ThePEG_DecayMode_H
11// This is the declaration of the DecayMode class.
12
14#include "ThePEG/Interface/Interfaced.h"
15#include "DecayMode.fh"
16#include "MatcherBase.h"
17#include "Decayer.h"
18
19namespace ThePEG {
20
24
87class DecayMode: public Interfaced {
88
89public:
90
92 friend class ParticleData;
93
95 friend class RemnantData;
96
98 friend class EventGenerator;
99
100public:
101
103 typedef vector<tcDMPtr> ModeVector;
105 typedef vector<tPDPair> LinkVector;
106
107public:
108
116 static DMPtr constructDecayMode(string & tag, vector<DMPtr> * save = 0);
117
124
130
135 virtual DMPtr clone(tPDPtr pd) const;
136
137public:
138
143 const string & tag() const {
144 return theTag.size() ? theTag : ( theTag = makeTag() );
145 }
146
151 tcPDPtr parent() const { return theParent; }
152
156 const ParticleMSet & products() const { return theProducts; }
157
161 const tPDVector & orderedProducts() const { return theOrderedProducts; }
162
169
174 const ModeMSet & cascadeProducts() const { return theCascadeProducts; }
175
179 const MatcherMSet & productMatchers() const { return theMatchers; }
180
186
191 const ParticleMSet & excluded() const { return theExcluded; }
192
196 double brat() const;
197
201 double brat(const Particle &) const;
202
206 tDecayerPtr decayer() const { return theDecayer; }
207
211 bool includes(const DecayMode &) const;
212
217 tDMPtr CC() const { return theAntiPartner; }
218
223 bool operator == (const DecayMode & d) const {
224 return tag() == d.tag() ;
225 }
226
231 const LinkVector & links() const { return theLinks; }
232
236 const ModeVector & overlap() const { return theOverlap; }
237
242
246 bool on() const { return isOn; }
247
248public:
249
257
263 void persistentInput(PersistentIStream & is, int version);
265
269 static void Init();
270
271protected:
272
278 virtual void doupdate();
279
289 virtual void rebind(const TranslationMap & trans)
290 ;
291
299
300protected:
301
306 void parent(tPDPtr pd) { theParent = pd; }
307
311 void brat(double);
312
316 void switchOn();
317
321 void switchOff();
322
328
333
339
344
349
354
360
364 static DMPtr Create(tPDPtr newParent, double newBrat = 0.0,
365 bool newOn = false);
369 DecayMode(tPDPtr newParticle, double newBrat, bool newOn);
370
377 virtual IBPtr clone() const;
378
383 virtual IBPtr fullclone() const;
385
389 DMPtr dmclone() const;
390
397 virtual void readSetup(istream & is);
398
403
409
414
420
426
431 void CC(tDMPtr cc) {theAntiPartner = cc;}
432
433private:
434
439
444
448 bool compareId(const ParticleMSet &, const ParticleMSet &) const;
449
453 ParticleMSet::const_iterator findId(const ParticleMSet &,
454 const ParticleData &) const;
455
460 string makeTag() const;
461
465 void resetTag() {
466 theTag = "";
467 if ( CC() ) CC()->theTag = "";
468 }
469
470
471private:
472
476 void setOn(long);
477
481 long getOn() const;
482
487
488private:
489
493 mutable string theTag;
494
498 double theBrat;
499
503 bool isOn;
504
510
515
520
526
532
537
543
548
553
558
564
565private:
566
571
575 DecayMode & operator=(const DecayMode &) = delete;
576
577};
578
583template <>
584struct BaseClassTrait<DecayMode,1>: public ClassTraitsType {
586 typedef Interfaced NthBase;
587};
588
591template <>
592struct ClassTraits<DecayMode>:
593 public ClassTraitsBase<DecayMode> {
595 static string className() { return "ThePEG::DecayMode"; }
596};
597
600}
601
602#endif /* ThePEG_DecayMode_H */
This is the main config header file for ThePEG.
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data.
The DecayMode class describes a decay channel of a particle.
Definition: DecayMode.h:87
virtual void doupdate()
Check sanity of the object during the setup phase.
MatcherMSet theMatchers
The set of matching decay products.
Definition: DecayMode.h:531
double brat(const Particle &) const
Calculate the branching ratio for a particular particle instance.
tDMPtr theAntiPartner
The corresponding decay mode of the anti particle.
Definition: DecayMode.h:557
double theBrat
The branching ratio.
Definition: DecayMode.h:498
ParticleMSet & excluded()
The set particles corresponding to excluded intermediate resonances.
Definition: DecayMode.h:425
bool on() const
Check whether this decay mode is switched on.
Definition: DecayMode.h:246
bool operator==(const DecayMode &d) const
Check if another decay mode has the same final state as this one.
Definition: DecayMode.h:223
void CC(tDMPtr cc)
Set the pointer to the corresponding decaymode for the antiparticle decay.
Definition: DecayMode.h:431
void addProductMatcher(tPMPtr)
Add a mathcer corresponding to one decay product.
const LinkVector & links() const
Return a vector of pairs of decay products which are linked together (e.g.
Definition: DecayMode.h:231
long getOn() const
Utility function for the interface.
void synchronize()
Modify this mode to have properties corresponding to its anti-partner.
static DMPtr Create(tPDPtr newParent, double newBrat=0.0, bool newOn=false)
Protected creation and clone methods.
void setOn(long)
Utility function for the interface.
ParticleMSet & products()
The set of identified decay products.
Definition: DecayMode.h:402
bool includes(const DecayMode &) const
Check if another decay mode is included in this one.
ParticleMSet::const_iterator findId(const ParticleMSet &, const ParticleData &) const
Check if a particle set contains a given particle ID.
static DMPtr constructDecayMode(string &tag, vector< DMPtr > *save=0)
Create a decay mode from a given tag.
tcPDPtr parent() const
Get a pointer to the particle data object corresponding to the decaying particle.
Definition: DecayMode.h:151
ModeVector theOverlap
A list of decay modes which are included in this one.
Definition: DecayMode.h:547
void addCascadeProduct(tDMPtr)
Add identified resonant product with specified decay mode.
tPMPtr wildProductMatcher() const
The pointer to a matcher corresponding to any number of decay products.
Definition: DecayMode.h:185
const MatcherMSet & productMatchers() const
The set of matchers each corresponding to one decay product.
Definition: DecayMode.h:179
DecayMode(tPDPtr newParticle, double newBrat, bool newOn)
Protected constructor.
DecayMode()
Default constructor.
void parent(tPDPtr pd)
Set a pointer to the particle data object corresponding to the decaying particle.
Definition: DecayMode.h:306
virtual void rebind(const TranslationMap &trans)
Rebind pointer to other Interfaced objects.
bool addOverlap(tcDMPtr)
Add a decay mode to the list of overlapping modes if included.
void resetOverlap()
Remove all decay modes from the list of overlapping modes.
double brat() const
Return the branching ratio to be used.
tDMPtr CC() const
Return a pointer to the corresponding decaymode for the antiparticle decay.
Definition: DecayMode.h:217
void setWildMatcher(tPMPtr)
Add a matcher corresponding to any number of decay products.
const ParticleMSet & products() const
The set of identified decay products.
Definition: DecayMode.h:156
DMPtr dmclone() const
Protected special clone function.
bool compareId(const ParticleMSet &, const ParticleMSet &) const
Check if two sets of particles have equivalent types.
MatcherMSet & productMatchers()
The set of matchers each corresponding to one decay product.
Definition: DecayMode.h:413
PVector produceProducts() const
Produce particles corresponding to the identified decay products.
virtual DMPtr clone(tPDPtr pd) const
Return a clone of this decay mode with pd as the decaying particle.
vector< tcDMPtr > ModeVector
A vector of DecayMode pointers.
Definition: DecayMode.h:103
void addExcluded(tPDPtr)
Add a particle corresponding to an excluded intermediate resonance.
ModeMSet & cascadeProducts()
The set of identified resonant products with specified decay modes.
Definition: DecayMode.h:408
DecayerPtr theDecayer
The decayer object responsible for performing the decay.
Definition: DecayMode.h:552
DecayMode(const DecayMode &)
Copy-constructor.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
bool isOn
True if this mode is switched on.
Definition: DecayMode.h:503
const ParticleMSet & excluded() const
The set particles corresponding to excluded intermediate resonances.
Definition: DecayMode.h:191
void switchOn()
Switch on this decay mode.
ModeMSet theCascadeProducts
The set of matching decay channels corresponding to a specified with a specified subsequent decay mod...
Definition: DecayMode.h:525
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
vector< tPDPair > LinkVector
A vector of pairs of ParticleData pointers.
Definition: DecayMode.h:105
void decayer(tDecayerPtr)
Set the decayer.
tPDVector theOrderedProducts
The set of specified decay particles in the order they was specified.
Definition: DecayMode.h:519
const tPDVector & orderedProducts() const
The set of identified decay products in the order they were specified.
Definition: DecayMode.h:161
static ClassDescription< DecayMode > initDecayMode
Describe a concrete class with persistent data.
Definition: DecayMode.h:570
virtual IVector getReferences()
Return a vector of all pointers to Interfaced objects used in this object.
string theTag
The tag.
Definition: DecayMode.h:493
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
void addProduct(tPDPtr)
Add identified decay products.
const ModeMSet & cascadeProducts() const
The set of identified resonance products with specified decay modes.
Definition: DecayMode.h:174
ParticleMSet theProducts
The set of specified decay particles.
Definition: DecayMode.h:514
LinkVector theLinks
The vector of pairs of decay products which are linked together (e.g.
Definition: DecayMode.h:563
const string & tag() const
Return the tag for this decay mode.
Definition: DecayMode.h:143
tPMPtr theWildMatcher
A particle matcher which corresponds to zero or more particles.
Definition: DecayMode.h:536
virtual IBPtr clone() const
Make a simple clone of this object.
tDecayerPtr decayer() const
Get the decayer assigned to this mode.
Definition: DecayMode.h:206
void switchOff()
Switch off this decay mode.
DecayMode & operator=(const DecayMode &)=delete
Private and non-existent assignment operator.
ParticleMSet theExcluded
A set of particles which are not allowed as intermediate resonances.
Definition: DecayMode.h:542
void setDecayer(DecayerPtr)
Utility function for the interface.
const ModeVector & overlap() const
Return the list of overlapping decay modes.
Definition: DecayMode.h:236
tPDPtr theParent
Pointer to a particle data object corresponding to the decaying particle.
Definition: DecayMode.h:509
static void Init()
Standard Init function used to initialize the interface.
void addLink(tPDPtr a, tPDPtr b)
Add a pair of decay products which are linked together (e.g.
string makeTag() const
Use the members in this decay channel and generate the corresponding tag.
void brat(double)
Set the branching ratio to be used.
tPMPtr & wildProductMatcher()
The pointer to a matcher corresponding to any number of decay products.
Definition: DecayMode.h:419
void resetTag()
Delete the tag (it will be regenerated later if asked for).
Definition: DecayMode.h:465
virtual void readSetup(istream &is)
Read setup info from a standard stream used by the Repository.
The EventGenerator class manages a whole event generator run.
The Interfaced class is derived from the InterfacedBase class adding a couple of things particular to...
Definition: Interfaced.h:38
ParticleData inherits from InterfacedBase and represents the properties of a particle type.
Definition: ParticleData.h:36
The Particle class is used to describe an instance of a particle.
Definition: Particle.h:83
PersistentIStream is used to read persistent objects from a stream where they were previously written...
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
Rebinder is a class associating pairs of pointers to objects.
Definition: Rebinder.h:27
The RemnantData class is not a normal ParticleData class.
Definition: RemnantData.h:46
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
multiset< tPMPtr, less< tPMPtr > > MatcherMSet
A multiset of tPMPtr .
Definition: DecayMode.h:22
multiset< tPDPtr, less< tPDPtr > > ParticleMSet
A multiset of tPDPtr .
Definition: DecayMode.h:21
vector< tPDPtr > tPDVector
A vector of transient pointers to ParticleData objects.
Definition: Containers.h:39
vector< PPtr > PVector
A vector of pointers to Particle objects.
Definition: Containers.h:76
multiset< tDMPtr, less< tDMPtr > > ModeMSet
A multiset of tDMPtr .
Definition: DecayMode.h:23
vector< IBPtr > IVector
A vector of pointers to InterfacedBase objects.
Definition: Containers.h:67
#define ThePEG_DECLARE_MULTISET(VALTYPE, NAME)
Macro for declaring a multiset.
Definition: std.h:180
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
static string className()
Return the name of class T.
Definition: ClassTraits.h:66
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30