thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ParticleData.h
1// -*- C++ -*-
2//
3// ParticleData.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_ParticleData_H
10#define ThePEG_ParticleData_H
11// This is the declaration of the ParticleData class.
12
14#include "ThePEG/PDT/PDT.h"
15#include "ThePEG/PDT/PID.h"
18#include "ThePEG/Interface/Interfaced.h"
19#include "ThePEG/Utilities/Selector.h"
20#include "ThePEG/PDT/WidthGenerator.h"
21#include "ThePEG/PDT/MassGenerator.h"
22#include "ThePEG/PDT/DecayMode.fh"
23#include "ThePEG/Utilities/ClassTraits.h"
24#include "ThePEG/Utilities/ClassDescription.h"
25
26namespace ThePEG {
27
36class ParticleData: public Interfaced {
37
38public:
39
41 friend class Repository;
42
44 friend class EventGenerator;
45
47 friend class DecayMode;
48
51
52public:
53
58
65 static PDPtr Create(PID newId, const string & newPDGName);
66
70 static PDPair Create(PID newId, const string & newPDGName, const string & newAntiPDGName);
72
73public:
74
80 long id() const { return theId; }
81
86 const string & PDGName() const { return thePDGName; }
87
92 const string & genericName() const { return thePDGName; }
94
101
106
111
116
121
126 PPtr produceParticle(Energy plus, Energy minus, Energy px, Energy py) const;
127
132
138
145 // Given a mass and a width of an instance of this particle type,
146 // generate a life time.
148
155 const DecaySelector & decaySelector() const { return theDecaySelector; }
156
164
169 const DecaySet & decayModes() const { return theDecayModes; }
171
176
180 Energy mass() const { return theMass; }
181
186 return
188 }
189
193 Energy massMax() const { return mass() + widthUpCut(); }
194
198 Energy massMin() const { return max(mass() - widthLoCut(), ZERO); }
199
204 virtual Energy constituentMass() const { return mass(); }
205
210
215 Energy width() const {
216 return theWidth >= ZERO ? theWidth :
217 ( theCTau > Length() ? hbarc/theCTau :
219 }
220
225 widthUpCut(wci);
226 return widthLoCut(wci);
227 }
228
232 Energy widthCut() const { return max(widthUpCut(), widthLoCut()); }
233
238
244 }
245
250
256 }
257
262
269 Length cTau() const {
270 return theCTau > Length() ? theCTau :
272 ( stable() ? Constants::MaxLength : Length() ) );
273 }
274
279 return
281 }
282
288
293 Charge charge() const { return eplus*double(theCharge)/3.0; }
294
298 PDT::Charge iCharge() const { return theCharge; }
299
303 bool charged() const { return PDT::charged(theCharge); }
304
308 bool positive() const { return PDT::positive(theCharge); }
309
313 bool negative() const { return PDT::negative(theCharge); }
314
320
324 AngularMomentum spin() const { return hbar_Planck*double(theSpin-1)*0.5; }
325
329 PDT::Spin iSpin() const { return theSpin; }
330
335
339 PDT::Colour iColour() const { return theColour; }
340
344 bool coloured() const { return PDT::coloured(iColour()); }
345
349 bool hasColour(bool anti = false) const {
350 return anti? hasAntiColour():
351 ( iColour() == PDT::Colour3 || iColour() == PDT::Colour6 ||
352 iColour() == PDT::Colour8 );
353 }
354
358 bool hasAntiColour() const {
359 return iColour() == PDT::Colour3bar || iColour() == PDT::Colour6bar ||
361 }
362
368 }
369
374 void stable(bool stab);
375
381 bool stable() const { return isStable; }
382
386 tPDPtr CC() const { return theAntiPartner; }
387
392 void synchronized(bool sync);
393
398 bool synchronized() const { return syncAnti; }
399
405
409 void massGenerator(tMassGenPtr);
410
414 tMassGenPtr massGenerator() const { return theMassGenerator; }
415
419 void widthGenerator(tWidthGeneratorPtr);
420
424 tWidthGeneratorPtr widthGenerator() const { return theWidthGenerator; }
425
430 void variableRatio(bool varRatio);
431
436 bool variableRatio() const { return theVariableRatio; }
437
438public:
439
440
448
454 void persistentInput(PersistentIStream & is, int version);
456
457 static void Init();
458
459protected:
460
467 virtual IBPtr clone() const;
468
473 virtual IBPtr fullclone() const;
475
481 virtual PDPtr pdclone() const;
482
487 ParticleData(PID newId, const string & newPDGName);
488
498 virtual void readSetup(istream & is);
499
504 static void antiSetup(const PDPair & pap);
505
506
507protected:
508
514 virtual void doupdate();
515
521 virtual void doinit();
522
532 virtual void rebind(const TranslationMap & trans)
533 ;
534
541
546 virtual void doinitrun();
548
549protected:
550
555
560
561private:
562
567
572
577
582
587
592
597
602
607
612
617
622
627
632
637
647
652
658
663
671 WidthGeneratorPtr theWidthGenerator;
672
678
684
690
695
700
705
710
715
720
725
730
735
740
745
750 string doAdjustNominalMass(string);
751
756
761
766
771
776
781
786
790 Energy getCut() const;
791
795 Energy defCut() const;
796
801
806
811
816
821
826
831
835 void setStable(long);
836
840 long getStable() const;
841
845 void setSync(long);
846
850 long getSync() const;
851
856
860 long getVariableRatio() const;
861
865 string doSync(string);
866
870 void setMassGenerator(MassGenPtr);
871
875 void setWidthGenerator(WidthGeneratorPtr);
876
880 void setCharge(int);
881
885 string ssetCharge(string);
886
890 int getCharge() const;
891
895 int defCharge() const;
896
900 void setSpin(int);
901
905 int getSpin() const;
906
910 int defSpin() const;
911
915 void setColour(long);
916
920 long getColour() const;
921
925 long defColour() const;
926
931
936
941
945 void insDecayModes(DMPtr dm, int);
946
950 void delDecayModes(int i);
951
955 vector<DMPtr> getDecayModes() const;
956
960 string doSelectDecayModes(string);
961
965 string doPrintDecayModes(string);
966
971
972};
973
978template <>
981 typedef Interfaced NthBase;
982};
983
986template <>
987struct ClassTraits<ParticleData>: public ClassTraitsBase<ParticleData> {
989 static string className() { return "ThePEG::ParticleData"; }
990};
991
994}
995
996#endif /* ThePEG_ParticleData_H */
contains the LorentzVector class.
This is the main config header file for ThePEG.
contains the ThreeVector class.
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
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
static bool positive(Charge c)
True if the argument corresponds to a positive charge.
Definition: PDT.h:125
Charge
Definition of enumerated values used for charge information.
Definition: PDT.h:51
Spin
Definition of enumerated values used for spin information.
Definition: PDT.h:32
static bool negative(Charge c)
True if the argument corresponds to a negative charge.
Definition: PDT.h:132
Colour
Definition of enumerated values used for colour information.
Definition: PDT.h:92
@ Colour3
Colour-triplet.
Definition: PDT.h:98
@ Colour8
Colour-octet.
Definition: PDT.h:102
@ Colour6bar
Colour-anti-sextet.
Definition: PDT.h:101
@ Colour6
Colour-sextet.
Definition: PDT.h:100
@ Colour3bar
Colour-anti-triplet.
Definition: PDT.h:99
ColouredInteraction
Define type of nonabelian interactions.
Definition: PDT.h:108
static bool charged(Charge c)
True if the argument corresponds to a non-zero charge.
Definition: PDT.h:118
static bool coloured(Colour c)
True if the argument corresponds to a non-zero colour charge.
Definition: PDT.h:139
PID is a helper class implementing the type of PDG particle ids.
Definition: PID.h:23
ParticleData inherits from InterfacedBase and represents the properties of a particle type.
Definition: ParticleData.h:36
string doPrintDecayModes(string)
Utility function for the interface.
int defCharge() const
Utility function for the interface.
virtual IVector getReferences()
Return a vector of all pointers to Interfaced objects used in this object.
static ClassDescription< ParticleData > initParticleData
Describe a concrete class with persistent data.
Definition: ParticleData.h:970
void synchronize()
If there is an anti-partner, update this object to have correct anti-properties.
void setWidth(Energy)
Utility function for the interface.
virtual PDPtr pdclone() const
Special clone function used by the Repository.
Energy theWidthLoCut
Lower width cut.
Definition: ParticleData.h:611
PDT::Spin theDefSpin
Helper variable to keep track of the default spin.
Definition: ParticleData.h:719
int defSpin() const
Utility function for the interface.
void massGenerator(tMassGenPtr)
Set the mass generator object.
void insDecayModes(DMPtr dm, int)
Utility function for the interface.
PDT::Spin iSpin(PDT::Spin)
Set the spin.
Energy theDefWidth
Helper variable to keep track of the default width.
Definition: ParticleData.h:699
string doAdjustNominalMass(string)
Adjust the nominal mass to the hard process mass if a reshuffling is not desirable.
bool charged() const
Return true if charged.
Definition: ParticleData.h:303
const DecaySelector & decaySelector() const
Return the nominal decay selector for this particle.
Definition: ParticleData.h:155
static PDPtr Create(PID newId, const string &newPDGName)
Create a Particle which is its own anti-particle.
WidthGeneratorPtr theWidthGenerator
A pointer to an object capable to generate the branching fractions for different decay modes for this...
Definition: ParticleData.h:671
void setSpin(int)
Utility function for the interface.
string thePDGName
Name and Id number according to the STDHEP/PDG standard.
Definition: ParticleData.h:571
void variableRatio(bool varRatio)
Specify if the branching ratio of the Particle instances should vary with their masses.
Length theDefCTau
Helper variable to keep track of the default lifetime.
Definition: ParticleData.h:709
PPtr produceParticle(const Lorentz5Momentum &) const
Produce a particle specifying momentum.
PPtr produceParticle(Energy plus, Energy minus, Energy px, Energy py) const
Produce a particle specifying light-cone momentum components and transverse momentum components.
bool hasColour(bool anti=false) const
Return true if (anti) coloured or colour-octet.
Definition: ParticleData.h:349
Length theCTau
Lifetime.
Definition: ParticleData.h:616
bool syncAnti
If syncAnti is true all changes to this object will be transfered to the antiParticle.
Definition: ParticleData.h:689
tPDPtr CC() const
Get the pointer to the corresponding anti partner.
Definition: ParticleData.h:386
long getColouredInteraction() const
Utility function for the interface.
AngularMomentum spin() const
Get the spin.The spin is returned in standard units.
Definition: ParticleData.h:324
void setCut(Energy)
Utility function for the interface.
Energy widthUpCut(Energy)
Set the upper width cut.
PPtr produceParticle(const Momentum3 &pp=Momentum3()) const
Produce a particle specifying 3-momentum.
long getSync() const
Utility function for the interface.
void addDecayMode(tDMPtr)
Add a decay mode for this particle.
void setLoCut(Energy)
Utility function for the interface.
MassGenPtr theMassGenerator
The nonabelian interaction of this particle.
Definition: ParticleData.h:646
Selector< tDMPtr > DecaySelector
A selector of DecayMode objects.
Definition: ParticleData.h:50
Length defCTau() const
Utility function for the interface.
Energy theHardProcessMass
The mass to be used when evaluating hard process cross sections.
Definition: ParticleData.h:586
long defColouredInteraction() const
Utility function for the interface.
void setCharge(int)
Utility function for the interface.
Energy hardProcessWidth() const
Return the width to be used when evaluating hard process cross sections.
Definition: ParticleData.h:278
PDT::Charge theDefCharge
Helper variable to keep track of the default charge.
Definition: ParticleData.h:714
void setStable(long)
Utility function for the interface.
void setVariableRatio(long)
Utility function for the interface.
Energy massMax() const
Return the maximum possible mass of this particle type.
Definition: ParticleData.h:193
ParticleData(PID newId, const string &newPDGName)
Protected constructor only to be used by subclasses or by the Create method.
Energy widthLoCut(Energy)
Set the lower width cut.
long getStable() const
Utility function for the interface.
Energy width(Energy)
Set the width.
bool hasAntiColour() const
Return true if anti coloured or colour-octet.
Definition: ParticleData.h:358
long defColour() const
Utility function for the interface.
void setMass(Energy)
Utility function for the interface.
PDT::Spin iSpin() const
Get the spin.
Definition: ParticleData.h:329
virtual void readSetup(istream &is)
Read setup info from a standard stream.
tDMPtr selectMode(Particle &p) const
Selects a decay mode randomly according to the branching ratios.
PID theId
Id number according to the STDHEP/PDG standard.
Definition: ParticleData.h:566
Energy widthCut(Energy wci)
Set the width cut.
Definition: ParticleData.h:224
const DecaySet & decayModes() const
Access all the decay modes, including those which are switched off, or have zero branching ratio.
Definition: ParticleData.h:169
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
Energy mass() const
Return the nominal mass.
Definition: ParticleData.h:180
void setSync(long)
Utility function for the interface.
string doSync(string)
Utility function for the interface.
void setHardProcessWidth(Energy)
Utility function for the interface.
DecaySet theDecayModes
The set of all decay modes.
Definition: ParticleData.h:662
Energy getCut() const
Utility function for the interface.
PDT::Spin theSpin
2 times the spin plus one.
Definition: ParticleData.h:626
Energy generateMass() const
Generate a mass for an instance of this particle type.
static PDPair Create(PID newId, const string &newPDGName, const string &newAntiPDGName)
Create a particle - anti particle pair.
int getCharge() const
Utility function for the interface.
bool variableRatio() const
Return true if the branching ratio should vary with the mass of the Particle instance.
Definition: ParticleData.h:436
const string & PDGName() const
Return the generic PDG name.
Definition: ParticleData.h:86
void setUpCut(Energy)
Utility function for the interface.
long id() const
Return the PDG id number.
Definition: ParticleData.h:80
long getColour() const
Utility function for the interface.
bool stable() const
Return true if particle is to be considered stable.
Definition: ParticleData.h:381
Length cTau() const
Get the life time cTau cTau.
Definition: ParticleData.h:269
Energy getLoCut() const
Utility function for the interface.
void removeDecayMode(tDMPtr)
Remove a decay mode for this particle.
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
virtual IBPtr clone() const
Make a simple clone of this object.
Length cTau(Length)
Set the life time cTau.
tPDPtr theAntiPartner
Pointer to the object corresponding to the antiparticle.
Definition: ParticleData.h:683
PPtr produceParticle(const LorentzMomentum &) const
Produce a particle specifying momentum.
string doUnsetHardProcessMass(string)
Reset the hard process mass.
PDT::Colour iColour(PDT::Colour)
Set the colour of the particle in units of PDT::Colour.
Charge charge() const
Get the charge.
Definition: ParticleData.h:293
vector< DMPtr > getDecayModes() const
Utility function for the interface.
void stable(bool stab)
Specify if particle is to be considered stable according to stab.
PDT::Charge iCharge(PDT::Charge)
Set the charge.
Energy massMin() const
Return the minimum possible mass of this particle type.
Definition: ParticleData.h:198
Energy theDefCut
Helper variable to keep track of the default width cut.
Definition: ParticleData.h:704
void setMassGenerator(MassGenPtr)
Utility function for the interface.
virtual void rebind(const TranslationMap &trans)
Rebind pointer to other Interfaced objects.
tWidthGeneratorPtr widthGenerator() const
Get the width generator object.
Definition: ParticleData.h:424
Energy theWidth
Width.
Definition: ParticleData.h:581
void delDecayModes(int i)
Utility function for the interface.
PPtr produceParticle(const LorentzMomentum &, Energy m) const
Produce a particle specifying 4-momentum and a mass.
Energy width() const
Get the width.
Definition: ParticleData.h:215
void setWidthGenerator(WidthGeneratorPtr)
Utility function for the interface.
void widthGenerator(tWidthGeneratorPtr)
Set the width generator object.
string doSelectDecayModes(string)
Utility function for the interface.
bool hardProcessWidthSet
True, if a hard process width has been set.
Definition: ParticleData.h:601
bool positive() const
Return true if positively charged.
Definition: ParticleData.h:308
Length generateLifeTime(Energy mass, Energy width) const
Generate a mass for an instance of this particle type.
PDT::Colour iColour() const
Get the colour of the particle in units of PDT::Colour.
Definition: ParticleData.h:339
Energy defCut() const
Utility function for the interface.
const string & genericName() const
Return the generic PDG name.
Definition: ParticleData.h:92
PDT::ColouredInteraction theColouredInteraction
The coloured interaction of this particle.
Definition: ParticleData.h:636
Energy widthCut() const
Get the width cut.
Definition: ParticleData.h:232
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
tMassGenPtr massGenerator() const
Get the mass generator object.
Definition: ParticleData.h:414
bool hardProcessMassSet
True, if a hard process mass has been set.
Definition: ParticleData.h:591
Energy defWidth() const
Utility function for the interface.
PDT::Charge theCharge
Three times the charge.
Definition: ParticleData.h:621
PDT::ColouredInteraction theDefColouredInteraction
Helper variable to keep track of the default coloured interaction.
Definition: ParticleData.h:729
PPtr produceParticle(Energy m, const Momentum3 &pp=Momentum3()) const
Produce a particle specifying mass and 3-momentum.
Energy mass(Energy)
Set the nominal mass.
string ssetCharge(string)
Utility function for the interface.
PDT::Colour theColour
The colour for this particle.
Definition: ParticleData.h:631
int getSpin() const
Utility function for the interface.
void setHardProcessMass(Energy)
Utility function for the interface.
bool negative() const
Return true if negatively charged.
Definition: ParticleData.h:313
long getVariableRatio() const
Utility function for the interface.
ParticleData()
Default constructor.
virtual Energy constituentMass() const
Return the constituent mass of this particle if relevant.
Definition: ParticleData.h:204
Energy theWidthUpCut
Upper width cut.
Definition: ParticleData.h:606
Energy theMass
Nominal mass.
Definition: ParticleData.h:576
PDT::ColouredInteraction colouredInteraction() const
Return what kind of colour charge this particle carries.
Definition: ParticleData.h:366
bool coloured() const
Return true if coloured.
Definition: ParticleData.h:344
Energy theHardProcessWidth
The width to be used when evaluating hard process cross sections.
Definition: ParticleData.h:596
Energy widthLoCut() const
Get the lower width cut.
Definition: ParticleData.h:254
PDT::Colour theDefColour
Helper variable to keep track of the default colour.
Definition: ParticleData.h:724
bool theVariableRatio
Determine whether the branching fractions are allowed to change on a particle-by-particle basis.
Definition: ParticleData.h:677
DecaySelector theDecaySelector
A selector of decay modes weighted by the nominal branching ratios.
Definition: ParticleData.h:657
Energy getUpCut() const
Utility function for the interface.
Energy generateWidth(Energy mass) const
Generate a width for an instance of this particle type.
virtual void doinitrun()
Initialize this object.
Length getCTau() const
Utility function for the interface.
void setColour(long)
Utility function for the interface.
Energy hardProcessMass() const
Return the mass to be used when evaluating hard process cross sections.
Definition: ParticleData.h:185
Energy theDefMass
Helper variable to keep track of the default mass.
Definition: ParticleData.h:694
string doUnsetHardProcessWidth(string)
Reset the hard process mass.
Energy getWidth() const
Utility function for the interface.
void setColouredInteraction(long)
Utility function for the interface.
virtual void doupdate()
Check sanity of the object during the setup phase.
Energy widthUpCut() const
Get the upper width cut.
Definition: ParticleData.h:242
PDT::Charge iCharge() const
Get the charge.
Definition: ParticleData.h:298
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
void setCTau(Length)
Utility function for the interface.
static void antiSetup(const PDPair &pap)
Used by subclasses or by the Create method to setup anti-relationship.
Energy defMass() const
Utility function for the interface.
bool isStable
True if the particle is considered stable.
Definition: ParticleData.h:651
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
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
Repository inherits from the BaseRepository class.
Definition: Repository.h:45
Selector is a templated class for storing objects associated with probabilities in a way such that,...
Definition: Selector.h:46
A 3-component vector.
Definition: ThreeVector.h:35
constexpr Energy MaxEnergy
A really large energy.
Definition: Constants.h:33
constexpr Length MaxLength
A really large length.
Definition: Constants.h:30
ThreeVector< Energy > Momentum3
A momentum in three-dimensional euclidean space.
Definition: Unitsystem.h:136
constexpr Qty< 1, 1, 0 > hbarc
Planck's constant times c (PDG 2006 value 197.326968(17) MeV fm)
Definition: Unitsystem.h:245
Qty< 1, 0, 0 > Length
Length.
Definition: Unitsystem.h:48
constexpr Qty< 1, 1, 0 > hbar_Planck
Planck's constant (PDG 2006 value 197.326968(17) MeV fm)
Definition: Unitsystem.h:247
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
constexpr ZeroUnit ZERO
ZERO can be used as zero for any unitful quantity.
Definition: PhysicalQty.h:35
pair< PDPtr, PDPtr > PDPair
A pair of pointers to ParticleData objects.
Definition: Containers.h:115
vector< IBPtr > IVector
A vector of pointers to InterfacedBase objects.
Definition: Containers.h:67
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