thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
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 
13 #include "ThePEG/Config/ThePEG.h"
14 #include "ThePEG/Interface/Interfaced.h"
15 #include "DecayMode.fh"
16 #include "MatcherBase.h"
17 #include "Decayer.h"
18 
19 namespace ThePEG {
20 
24 
87 class DecayMode: public Interfaced {
88 
89 public:
90 
92  friend class ParticleData;
93 
95  friend class RemnantData;
96 
98  friend class EventGenerator;
99 
100 public:
101 
103  typedef vector<tcDMPtr> ModeVector;
105  typedef vector<tPDPair> LinkVector;
106 
107 public:
108 
116  static DMPtr constructDecayMode(string & tag, vector<DMPtr> * save = 0);
117 
123  DecayMode();
124 
128  DecayMode(const DecayMode &);
129 
133  ~DecayMode();
135 
140  virtual DMPtr clone(tPDPtr pd) const;
141 
142 public:
143 
148  const string & tag() const {
149  return theTag.size() ? theTag : ( theTag = makeTag() );
150  }
151 
156  tcPDPtr parent() const { return theParent; }
157 
161  const ParticleMSet & products() const { return theProducts; }
162 
166  const tPDVector & orderedProducts() const { return theOrderedProducts; }
167 
173  PVector produceProducts() const;
174 
179  const ModeMSet & cascadeProducts() const { return theCascadeProducts; }
180 
184  const MatcherMSet & productMatchers() const { return theMatchers; }
185 
191 
196  const ParticleMSet & excluded() const { return theExcluded; }
197 
201  double brat() const;
202 
206  double brat(const Particle &) const;
207 
211  tDecayerPtr decayer() const { return theDecayer; }
212 
216  bool includes(const DecayMode &) const;
217 
222  tDMPtr CC() const { return theAntiPartner; }
223 
228  bool operator == (const DecayMode & d) const {
229  return tag() == d.tag() ;
230  }
231 
236  const LinkVector & links() const { return theLinks; }
237 
241  const ModeVector & overlap() const { return theOverlap; }
242 
246  void synchronize();
247 
251  bool on() const { return isOn; }
252 
253 public:
254 
261  void persistentOutput(PersistentOStream & os) const;
262 
268  void persistentInput(PersistentIStream & is, int version);
270 
274  static void Init();
275 
276 protected:
277 
283  virtual void doupdate();
284 
294  virtual void rebind(const TranslationMap & trans)
295  ;
296 
302  virtual IVector getReferences();
304 
305 protected:
306 
311  void parent(tPDPtr pd) { theParent = pd; }
312 
316  void brat(double);
317 
321  void switchOn();
322 
326  void switchOff();
327 
332  void decayer(tDecayerPtr);
333 
337  void addProduct(tPDPtr);
338 
343  void addLink(tPDPtr a, tPDPtr b);
344 
349 
354 
358  void setWildMatcher(tPMPtr);
359 
364  void addExcluded(tPDPtr);
365 
369  static DMPtr Create(tPDPtr newParent, double newBrat = 0.0,
370  bool newOn = false);
374  DecayMode(tPDPtr newParticle, double newBrat, bool newOn);
375 
382  virtual IBPtr clone() const;
383 
388  virtual IBPtr fullclone() const;
390 
394  DMPtr dmclone() const;
395 
402  virtual void readSetup(istream & is);
403 
408 
414 
419 
425 
431 
436  void CC(tDMPtr cc) {theAntiPartner = cc;}
437 
438 private:
439 
443  bool addOverlap(tcDMPtr);
444 
448  void resetOverlap();
449 
453  bool compareId(const ParticleMSet &, const ParticleMSet &) const;
454 
458  ParticleMSet::const_iterator findId(const ParticleMSet &,
459  const ParticleData &) const;
460 
465  string makeTag() const;
466 
470  void resetTag() {
471  theTag = "";
472  if ( CC() ) CC()->theTag = "";
473  }
474 
475 
476 private:
477 
481  void setOn(long);
482 
486  long getOn() const;
487 
491  void setDecayer(DecayerPtr);
492 
493 private:
494 
498  mutable string theTag;
499 
503  double theBrat;
504 
508  bool isOn;
509 
515 
520 
525 
531 
537 
542 
548 
552  ModeVector theOverlap;
553 
558 
563 
568  LinkVector theLinks;
569 
570 private:
571 
576 
580  DecayMode & operator=(const DecayMode &) = delete;
581 
582 };
583 
588 template <>
589 struct BaseClassTrait<DecayMode,1>: public ClassTraitsType {
591  typedef Interfaced NthBase;
592 };
593 
596 template <>
597 struct ClassTraits<DecayMode>:
598  public ClassTraitsBase<DecayMode> {
600  static string className() { return "ThePEG::DecayMode"; }
601 };
602 
605 }
606 
607 #endif /* ThePEG_DecayMode_H */
The RemnantData class is not a normal ParticleData class.
Definition: RemnantData.h:46
ParticleMSet & excluded()
The set particles corresponding to excluded intermediate resonances.
Definition: DecayMode.h:430
string makeTag() const
Use the members in this decay channel and generate the corresponding tag.
tDMPtr CC() const
Return a pointer to the corresponding decaymode for the antiparticle decay.
Definition: DecayMode.h:222
PersistentIStream is used to read persistent objects from a stream where they were previously written...
void addCascadeProduct(tDMPtr)
Add identified resonant product with specified decay mode.
bool compareId(const ParticleMSet &, const ParticleMSet &) const
Check if two sets of particles have equivalent types.
~DecayMode()
Destructor.
DecayMode()
Default constructor.
ParticleMSet theProducts
The set of specified decay particles.
Definition: DecayMode.h:519
The Particle class is used to describe an instance of a particle.
Definition: Particle.h:83
ModeMSet theCascadeProducts
The set of matching decay channels corresponding to a specified with a specified subsequent decay mod...
Definition: DecayMode.h:530
bool operator==(const DecayMode &d) const
Check if another decay mode has the same final state as this one.
Definition: DecayMode.h:228
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
ModeVector theOverlap
A list of decay modes which are included in this one.
Definition: DecayMode.h:552
bool includes(const DecayMode &) const
Check if another decay mode is included in this one.
void addProductMatcher(tPMPtr)
Add a mathcer corresponding to one decay product.
ModeMSet & cascadeProducts()
The set of identified resonant products with specified decay modes.
Definition: DecayMode.h:413
ParticleMSet::const_iterator findId(const ParticleMSet &, const ParticleData &) const
Check if a particle set contains a given particle ID.
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data...
const string & tag() const
Return the tag for this decay mode.
Definition: DecayMode.h:148
void resetOverlap()
Remove all decay modes from the list of overlapping modes.
void addProduct(tPDPtr)
Add identified decay products.
void switchOff()
Switch off this decay mode.
const ModeMSet & cascadeProducts() const
The set of identified resonance products with specified decay modes.
Definition: DecayMode.h:179
bool on() const
Check whether this decay mode is switched on.
Definition: DecayMode.h:251
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
string theTag
The tag.
Definition: DecayMode.h:498
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
void resetTag()
Delete the tag (it will be regenerated later if asked for).
Definition: DecayMode.h:470
void setOn(long)
Utility function for the interface.
double theBrat
The branching ratio.
Definition: DecayMode.h:503
Rebinder is a class associating pairs of pointers to objects.
Definition: Rebinder.h:27
multiset< tDMPtr, less< tDMPtr > > ModeMSet
A multiset of tDMPtr .
Definition: DecayMode.h:23
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
DMPtr dmclone() const
Protected special clone function.
This is the main config header file for ThePEG.
ParticleMSet theExcluded
A set of particles which are not allowed as intermediate resonances.
Definition: DecayMode.h:547
virtual void doupdate()
Check sanity of the object during the setup phase.
tcPDPtr parent() const
Get a pointer to the particle data object corresponding to the decaying particle. ...
Definition: DecayMode.h:156
tPMPtr & wildProductMatcher()
The pointer to a matcher corresponding to any number of decay products.
Definition: DecayMode.h:424
ParticleData inherits from InterfacedBase and represents the properties of a particle type...
Definition: ParticleData.h:36
tDecayerPtr decayer() const
Get the decayer assigned to this mode.
Definition: DecayMode.h:211
void setWildMatcher(tPMPtr)
Add a matcher corresponding to any number of decay products.
bool isOn
True if this mode is switched on.
Definition: DecayMode.h:508
long getOn() const
Utility function for the interface.
multiset< tPMPtr, less< tPMPtr > > MatcherMSet
A multiset of tPMPtr .
Definition: DecayMode.h:22
DecayerPtr theDecayer
The decayer object responsible for performing the decay.
Definition: DecayMode.h:557
vector< tcDMPtr > ModeVector
A vector of DecayMode pointers.
Definition: DecayMode.h:103
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
virtual IBPtr clone() const
Make a simple clone of this object.
tPDVector theOrderedProducts
The set of specified decay particles in the order they was specified.
Definition: DecayMode.h:524
virtual IVector getReferences()
Return a vector of all pointers to Interfaced objects used in this object.
void addLink(tPDPtr a, tPDPtr b)
Add a pair of decay products which are linked together (e.g.
tPMPtr theWildMatcher
A particle matcher which corresponds to zero or more particles.
Definition: DecayMode.h:541
vector< tPDPair > LinkVector
A vector of pairs of ParticleData pointers.
Definition: DecayMode.h:105
vector< tPDPtr > tPDVector
A vector of transient pointers to ParticleData objects.
Definition: Containers.h:39
void CC(tDMPtr cc)
Set the pointer to the corresponding decaymode for the antiparticle decay.
Definition: DecayMode.h:436
void parent(tPDPtr pd)
Set a pointer to the particle data object corresponding to the decaying particle. ...
Definition: DecayMode.h:311
static DMPtr constructDecayMode(string &tag, vector< DMPtr > *save=0)
Create a decay mode from a given tag.
tPMPtr wildProductMatcher() const
The pointer to a matcher corresponding to any number of decay products.
Definition: DecayMode.h:190
tPDPtr theParent
Pointer to a particle data object corresponding to the decaying particle.
Definition: DecayMode.h:514
void synchronize()
Modify this mode to have properties corresponding to its anti-partner.
MatcherMSet & productMatchers()
The set of matchers each corresponding to one decay product.
Definition: DecayMode.h:418
const MatcherMSet & productMatchers() const
The set of matchers each corresponding to one decay product.
Definition: DecayMode.h:184
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
void switchOn()
Switch on this decay mode.
void addExcluded(tPDPtr)
Add a particle corresponding to an excluded intermediate resonance.
tDMPtr theAntiPartner
The corresponding decay mode of the anti particle.
Definition: DecayMode.h:562
The Interfaced class is derived from the InterfacedBase class adding a couple of things particular to...
Definition: Interfaced.h:38
LinkVector theLinks
The vector of pairs of decay products which are linked together (e.g.
Definition: DecayMode.h:568
double brat() const
Return the branching ratio to be used.
const ModeVector & overlap() const
Return the list of overlapping decay modes.
Definition: DecayMode.h:241
multiset< tPDPtr, less< tPDPtr > > ParticleMSet
A multiset of tPDPtr .
Definition: DecayMode.h:21
static ClassDescription< DecayMode > initDecayMode
Describe a concrete class with persistent data.
Definition: DecayMode.h:575
const ParticleMSet & excluded() const
The set particles corresponding to excluded intermediate resonances.
Definition: DecayMode.h:196
virtual void readSetup(istream &is)
Read setup info from a standard stream used by the Repository.
const tPDVector & orderedProducts() const
The set of identified decay products in the order they were specified.
Definition: DecayMode.h:166
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
The DecayMode class describes a decay channel of a particle.
Definition: DecayMode.h:87
void setDecayer(DecayerPtr)
Utility function for the interface.
bool addOverlap(tcDMPtr)
Add a decay mode to the list of overlapping modes if included.
PVector produceProducts() const
Produce particles corresponding to the identified decay products.
const LinkVector & links() const
Return a vector of pairs of decay products which are linked together (e.g.
Definition: DecayMode.h:236
static void Init()
Standard Init function used to initialize the interface.
static DMPtr Create(tPDPtr newParent, double newBrat=0.0, bool newOn=false)
Protected creation and clone methods.
const ParticleMSet & products() const
The set of identified decay products.
Definition: DecayMode.h:161
vector< IBPtr > IVector
A vector of pointers to InterfacedBase objects.
Definition: Containers.h:67
vector< PPtr > PVector
A vector of pointers to Particle objects.
Definition: Containers.h:76
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
MatcherMSet theMatchers
The set of matching decay products.
Definition: DecayMode.h:536
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
ParticleMSet & products()
The set of identified decay products.
Definition: DecayMode.h:407
The EventGenerator class manages a whole event generator run.
virtual void rebind(const TranslationMap &trans)
Rebind pointer to other Interfaced objects.
#define ThePEG_DECLARE_MULTISET(VALTYPE, NAME)
Macro for declaring a multiset.
Definition: std.h:179
DecayMode & operator=(const DecayMode &)=delete
Private and non-existent assignment operator.
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.