#include <particletype.h>
Particle type contains the static properties of a particle species.
Before creation of Experiment, SMASH initializes the list of particles (list_all). After construction these values are immutable.
The list of particles is stored in such a way that look up of a ParticleType object (find) for a given PDG code is as efficient as possible ( \(\mathcal O(\log N)\)). This is still not efficient enough to use PdgCode as a substitute for storing information about a particle type, though. Use ParticleTypePtr instead.
Definition at line 98 of file particletype.h.
Classes | |
struct | LoadFailure |
struct | PdgNotFoundFailure |
Public Member Functions | |
ParticleType (std::string n, double m, double w, Parity p, PdgCode id) | |
Creates a fully initialized ParticleType object. More... | |
ParticleType (const ParticleType &)=delete | |
Copies are not allowed as they break intended use. More... | |
ParticleType & | operator= (const ParticleType &)=delete |
assignment is not allowed, see copy constructor above More... | |
ParticleType (ParticleType &&)=default | |
move ctors are needed for std::sort More... | |
ParticleType & | operator= (ParticleType &&)=default |
move ctors are needed for std::sort More... | |
const DecayModes & | decay_modes () const |
const std::string & | name () const |
double | mass () const |
double | mass_sqr () const |
double | width_at_pole () const |
Parity | parity () const |
PdgCode | pdgcode () const |
bool | has_antiparticle () const |
ParticleTypePtr | get_antiparticle () const |
int | antiparticle_sign () const |
int | isospin () const |
Returns twice the isospin vector length \(I\). More... | |
int | isospin3 () const |
double | isospin3_rel () const |
IsoParticleType * | iso_multiplet () const |
int32_t | charge () const |
The charge of the particle. More... | |
unsigned int | spin () const |
unsigned int | spin_degeneracy () const |
bool | is_hadron () const |
bool | is_lepton () const |
bool | is_baryon () const |
bool | is_meson () const |
int | baryon_number () const |
int | strangeness () const |
bool | is_nucleon () const |
bool | is_pion () const |
bool | is_kaon () const |
bool | is_Delta () const |
bool | is_rho () const |
bool | is_Nstar () const |
bool | is_Nstar1535 () const |
bool | is_Deltastar () const |
bool | is_stable () const |
bool | is_nucleus () const |
bool | is_deuteron () const |
bool | is_triton () const |
bool | is_dprime () const |
double | min_mass_kinematic () const |
The minimum mass of the resonance that is kinematically allowed. More... | |
double | min_mass_spectral () const |
The minimum mass of the resonance, where the spectral function is non-zero. More... | |
double | partial_width (const double m, const DecayBranch *mode) const |
Get the mass-dependent partial decay width of a particle with mass m in a particular decay mode. More... | |
double | total_width (const double m) const |
Get the mass-dependent total width of a particle with mass m. More... | |
bool | wanted_decaymode (const DecayType &t, WhichDecaymodes wh) const |
Helper Function that containes the if-statement logic that decides if a decay mode is either a hadronic and dilepton decay mode. More... | |
DecayBranchList | get_partial_widths (const FourVector p, const ThreeVector x, WhichDecaymodes wh) const |
Get all the mass-dependent partial decay widths of a particle with mass m. More... | |
double | get_partial_width (const double m, const ParticleTypePtrList dlist) const |
Get the mass-dependent partial width of a resonance with mass m, decaying into two given daughter particles. More... | |
double | get_partial_in_width (const double m, const ParticleData &p_a, const ParticleData &p_b) const |
Get the mass-dependent partial in-width of a resonance with mass m, decaying into two given daughter particles. More... | |
double | spectral_function (double m) const |
Full spectral function \( A(m) = \frac{2}{\pi} N \frac{m^2\Gamma(m)}{(m^2-m_0^2)^2+(m\Gamma(m))^2} \) of the resonance (relativistic Breit-Wigner distribution with mass-dependent width, where N is a normalization factor). More... | |
double | spectral_function_no_norm (double m) const |
Full spectral function without normalization factor. More... | |
double | spectral_function_const_width (double m) const |
double | spectral_function_simple (double m) const |
This one is the most simple form of the spectral function, using a Cauchy distribution (non-relativistic Breit-Wigner with constant width). More... | |
double | sample_resonance_mass (const double mass_stable, const double cms_energy, int L=0) const |
Resonance mass sampling for 2-particle final state with one resonance (type given by 'this') and one stable particle. More... | |
std::pair< double, double > | sample_resonance_masses (const ParticleType &t2, const double cms_energy, int L=0) const |
Resonance mass sampling for 2-particle final state with two resonances. More... | |
void | dump_width_and_spectral_function () const |
Prints out width and spectral function versus mass to the standard output. More... | |
bool | operator== (const ParticleType &rhs) const |
bool | operator!= (const ParticleType &rhs) const |
bool | operator< (const ParticleType &rhs) const |
"Less than" operator for sorting the ParticleType list (by PDG code) More... | |
ParticleTypePtr | operator& () const |
Returns an object that acts like a pointer, except that it requires only 2 bytes and inhibits pointer arithmetics. More... | |
Static Public Member Functions | |
static const ParticleTypeList & | list_all () |
static ParticleTypePtrList & | list_nucleons () |
static ParticleTypePtrList & | list_anti_nucleons () |
static ParticleTypePtrList & | list_Deltas () |
static ParticleTypePtrList & | list_anti_Deltas () |
static ParticleTypePtrList & | list_baryon_resonances () |
static ParticleTypePtrList & | list_light_nuclei () |
static const ParticleTypePtr | try_find (PdgCode pdgcode) |
Returns the ParticleTypePtr for the given pdgcode . More... | |
static const ParticleType & | find (PdgCode pdgcode) |
Returns the ParticleType object for the given pdgcode . More... | |
static bool | exists (PdgCode pdgcode) |
static bool | exists (const std::string &name) |
static void | create_type_list (const std::string &particles) |
Initialize the global ParticleType list (list_all) from the given input data. More... | |
static void | check_consistency () |
Static Public Attributes | |
static constexpr double | width_cutoff = 1e-5 |
Decay width cutoff for considering a particle as stable. More... | |
Private Attributes | |
std::string | name_ |
name of the particle More... | |
double | mass_ |
pole mass of the particle More... | |
double | width_ |
width of the particle More... | |
Parity | parity_ |
Parity of the particle. More... | |
PdgCode | pdgcode_ |
PDG Code of the particle. More... | |
double | min_mass_kinematic_ |
minimum kinematically allowed mass of the particle Mutable, because it is initialized at first call of minimum mass function, so it's logically const, but not physically const, which is a classical case for using mutable. More... | |
double | min_mass_spectral_ |
minimum mass, where the spectral function is non-zero Mutable, because it is initialized at first call of minimum mass function, so it's logically const, but not physically const, which is a classical case for using mutable. More... | |
double | norm_factor_ = -1. |
This normalization factor ensures that the spectral function is normalized to unity, when integrated over its full domain. More... | |
int32_t | charge_ |
Charge of the particle; filled automatically from pdgcode_. More... | |
int | isospin_ |
Isospin of the particle; filled automatically from pdgcode_. More... | |
int | I3_ |
Isospin projection of the particle; filled automatically from pdgcode_. More... | |
IsoParticleType * | iso_multiplet_ = nullptr |
Container for the isospin multiplet information. More... | |
double | max_factor1_ = 1. |
Maximum factor for single-res mass sampling, cf. sample_resonance_mass. More... | |
double | max_factor2_ = 1. |
Maximum factor for double-res mass sampling, cf. sample_resonance_masses. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const ParticleType &type) |
Writes all information about the particle type to the output stream. More... | |
Creates a fully initialized ParticleType object.
[in] | n | The name of the particle. |
[in] | m | The mass of the particle. |
[in] | w | The width of the particle. |
[in] | p | The parity of the particle. |
[in] | id | The PDG code of the particle. |
Definition at line 122 of file particletype.cc.
|
delete |
Copies are not allowed as they break intended use.
Instead use a const-ref or ParticleTypePtr (as returned from operator&).
|
default |
move ctors are needed for std::sort
|
delete |
assignment is not allowed, see copy constructor above
|
default |
move ctors are needed for std::sort
const DecayModes & smash::ParticleType::decay_modes | ( | ) | const |
Definition at line 432 of file particletype.cc.
|
inline |
|
inline |
|
inline |
Definition at line 148 of file particletype.h.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 160 of file particletype.h.
|
inline |
Definition at line 757 of file particletype.h.
|
inline |
int smash::ParticleType::isospin | ( | ) | const |
Returns twice the isospin vector length \(I\).
This returns e.g. 1 for nucleons, 2 for pions and 3 for Deltas. It is always positive.
Definition at line 414 of file particletype.cc.
|
inline |
This is calculated from the sum of net_quark_number of up and down.
Definition at line 177 of file particletype.h.
|
inline |
Definition at line 180 of file particletype.h.
|
inline |
Definition at line 186 of file particletype.h.
|
inline |
The charge of the particle.
The charge is calculated from the quark content (for hadrons) or basically tabulated; currently leptons, neutrinos and the standard model gauge bosons are known; unknown particles return a charge of 0.
Definition at line 189 of file particletype.h.
|
inline |
The code is good for hadrons, leptons and spin-1-bosons. It returns 2 (meaning spin=1) for the Higgs, though.
runtime_error | if a spin of a nucleus is not coded in and has to be guessed |
Definition at line 192 of file particletype.h.
|
inline |
|
inline |
Definition at line 198 of file particletype.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
For particles with one strange quark, -1 is returned.
Definition at line 213 of file particletype.h.
|
inline |
Definition at line 216 of file particletype.h.
|
inline |
|
inline |
|
inline |
Definition at line 225 of file particletype.h.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 240 of file particletype.h.
|
inline |
Definition at line 246 of file particletype.h.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 258 of file particletype.h.
double smash::ParticleType::min_mass_kinematic | ( | ) | const |
The minimum mass of the resonance that is kinematically allowed.
Calculate the minimum rest energy the resonance must have for any decay channel to be kinematically available. (In other words, find the smallest sum of final-state particle masses.)
Definition at line 364 of file particletype.cc.
double smash::ParticleType::min_mass_spectral | ( | ) | const |
The minimum mass of the resonance, where the spectral function is non-zero.
Calculate the the smallest mass where the spectral function still has a contribution. This value can be different from min_mass_kinematic, if the spectral function becomes zero at masses higher than min_mass_kinematic, since the width is put to zero due to the width_cutoff.
The distinction between it and min_mass_kinematic() might be necessary in edge cases, where a reaction is very close to the kinematic threshold or for optimizations.
Definition at line 378 of file particletype.cc.
double smash::ParticleType::partial_width | ( | const double | m, |
const DecayBranch * | mode | ||
) | const |
Get the mass-dependent partial decay width of a particle with mass m in a particular decay mode.
[in] | m | Invariant mass of the decaying particle. |
[in] | mode | Decay mode to consider. |
Definition at line 423 of file particletype.cc.
double smash::ParticleType::total_width | ( | const double | m | ) | const |
Get the mass-dependent total width of a particle with mass m.
[in] | m | Invariant mass of the decaying particle. |
Definition at line 439 of file particletype.cc.
bool smash::ParticleType::wanted_decaymode | ( | const DecayType & | t, |
WhichDecaymodes | wh | ||
) | const |
Helper Function that containes the if-statement logic that decides if a decay mode is either a hadronic and dilepton decay mode.
[in] | t | type of decay. |
[in] | wh | enum that decides which decay modes are wanted. |
Definition at line 471 of file particletype.cc.
DecayBranchList smash::ParticleType::get_partial_widths | ( | const FourVector | p, |
const ThreeVector | x, | ||
WhichDecaymodes | wh | ||
) | const |
Get all the mass-dependent partial decay widths of a particle with mass m.
This function needs to know the 4-momentum and the position of the decaying particle to calculate the square root of s of the final state particles and mass
[in] | p | 4-momentum of the decaying particle. |
[in] | x | position of the decaying particle. |
[in] | wh | enum that decides which decaymodes are returned. |
Definition at line 489 of file particletype.cc.
double smash::ParticleType::get_partial_width | ( | const double | m, |
const ParticleTypePtrList | dlist | ||
) | const |
Get the mass-dependent partial width of a resonance with mass m, decaying into two given daughter particles.
[in] | m | Invariant mass of the decaying resonance. |
[in] | dlist | List of daughter particles. |
Definition at line 534 of file particletype.cc.
double smash::ParticleType::get_partial_in_width | ( | const double | m, |
const ParticleData & | p_a, | ||
const ParticleData & | p_b | ||
) | const |
Get the mass-dependent partial in-width of a resonance with mass m, decaying into two given daughter particles.
For stable daughter particles, the in-width equals the 'normal' partial decay width (i.e. the 'out-width').
[in] | m | Invariant mass of the decaying resonance. |
[in] | p_a | First daughter particle. |
[in] | p_b | Second daughter particle. |
Definition at line 550 of file particletype.cc.
double smash::ParticleType::spectral_function | ( | double | m | ) | const |
Full spectral function \( A(m) = \frac{2}{\pi} N \frac{m^2\Gamma(m)}{(m^2-m_0^2)^2+(m\Gamma(m))^2} \) of the resonance (relativistic Breit-Wigner distribution with mass-dependent width, where N is a normalization factor).
[in] | m | Actual off-shell mass of the resonance, where the spectral function is to be evaluated. |
Definition at line 569 of file particletype.cc.
double smash::ParticleType::spectral_function_no_norm | ( | double | m | ) | const |
Full spectral function without normalization factor.
[in] | m | Actual off-shell mass of the resonance, where the spectral function is to be evaluated. |
Definition at line 589 of file particletype.cc.
double smash::ParticleType::spectral_function_const_width | ( | double | m | ) | const |
It is guaranteed to be normalized to 1, when integrated from 0 to inf.
Definition at line 599 of file particletype.cc.
double smash::ParticleType::spectral_function_simple | ( | double | m | ) | const |
This one is the most simple form of the spectral function, using a Cauchy distribution (non-relativistic Breit-Wigner with constant width).
It can be integrated analytically, and is normalized to 1 when integrated from -inf to inf.
[in] | m | Actual off-shell mass of the resonance, where the spectral function is to be evaluated. |
Definition at line 609 of file particletype.cc.
double smash::ParticleType::sample_resonance_mass | ( | const double | mass_stable, |
const double | cms_energy, | ||
int | L = 0 |
||
) | const |
Resonance mass sampling for 2-particle final state with one resonance (type given by 'this') and one stable particle.
[in] | mass_stable | Mass of the stable particle. |
[in] | cms_energy | center-of-mass energy of the 2-particle final state. |
[in] | L | relative angular momentum of the final-state particles |
Definition at line 614 of file particletype.cc.
std::pair< double, double > smash::ParticleType::sample_resonance_masses | ( | const ParticleType & | t2, |
const double | cms_energy, | ||
int | L = 0 |
||
) | const |
Resonance mass sampling for 2-particle final state with two resonances.
[in] | t2 | Type of the second resonance (the first resonance is given by 'this'). |
[in] | cms_energy | center-of-mass energy of the 2-particle final state. |
[in] | L | relative angular momentum of the final-state particles |
Definition at line 671 of file particletype.cc.
void smash::ParticleType::dump_width_and_spectral_function | ( | ) | const |
Prints out width and spectral function versus mass to the standard output.
This is useful for debugging and analysis.
if | the particle type is stable |
Definition at line 722 of file particletype.cc.
|
static |
Definition at line 51 of file particletype.cc.
|
static |
Definition at line 69 of file particletype.cc.
|
static |
Definition at line 71 of file particletype.cc.
|
static |
Definition at line 75 of file particletype.cc.
|
static |
Definition at line 77 of file particletype.cc.
|
static |
Definition at line 81 of file particletype.cc.
|
static |
Definition at line 85 of file particletype.cc.
|
static |
Returns the ParticleTypePtr for the given pdgcode
.
If the particle type is not found, an invalid ParticleTypePtr is returned. You can convert a ParticleTypePtr to a bool to check whether it is valid.
[in] | pdgcode | the unique pdg code to try to find |
Definition at line 89 of file particletype.cc.
|
static |
Returns the ParticleType object for the given pdgcode
.
If the particle is not found, a PdgNotFoundFailure is thrown.
[in] | pdgcode | the unique pdg code to try to find |
PdgNotFoundFailure | pdgcode not found in available particle types |
Definition at line 99 of file particletype.cc.
|
static |
[in] | pdgcode | the PdgCode to look for |
pdgcode
exists.Definition at line 107 of file particletype.cc.
|
static |
[in] | name | the name to look for |
name
exists.Definition at line 112 of file particletype.cc.
|
static |
Initialize the global ParticleType list (list_all) from the given input data.
This function must only be called once (will fail on second invocation).
[in] | particles | A string that contains the definition of ParticleTypes to be created. |
LoadFailure | if a line in the particle file could not be read, or if there are duplicates in it |
runtime_error | if the mass of of nucleons, kaons and deltas are different from the hardcoded masses, or if this function is called more than once |
Definition at line 199 of file particletype.cc.
|
inline |
[in] | rhs | another ParticleType to compare to |
Definition at line 540 of file particletype.h.
|
inline |
[in] | rhs | another ParticleType to compare to |
Definition at line 547 of file particletype.h.
|
inline |
"Less than" operator for sorting the ParticleType list (by PDG code)
[in] | rhs | another ParticleType to compare to |
Definition at line 556 of file particletype.h.
|
static |
runtime_error | if unstable particles have no decay modes |
runtime_error | if fake dibaryon d' is present without d |
Note that the particles and decay modes have to be initialized, otherwise calling this is undefined behavior.
Definition at line 455 of file particletype.cc.
ParticleTypePtr smash::ParticleType::operator& | ( | ) | const |
Returns an object that acts like a pointer, except that it requires only 2 bytes and inhibits pointer arithmetics.
This is an optimization for creating references to ParticleType objects. With a normal pointer you would require the original object to stay in its place in memory, as otherwise the pointer would dangle. The ParticleTypePtr does not have this problem as it only stores the index of the ParticleType in the global vector of ParticleType objects.
In addition to returning a more efficient reference type, the overload of operator& effectively inhibits passing ParticleType objects by pointer. This is an intended restriction since ParticleType objects should only be passed by const-ref. (You can now pass by ParticleTypePtr instead, but please prefer not to. It might be useful when you want to store a reference inside the function anyway, but that can just as well be done with a const-ref parameter. A ParticleTypePtr can be invalid, a const-ref is always a valid reference semantically.)
Definition at line 57 of file particletype.cc.
|
staticconstexpr |
Decay width cutoff for considering a particle as stable.
We currently regard a particle type as stable if its on-shell width is less than 10 keV. The cutoff is chosen such that the η and the η' are stable.
Definition at line 108 of file particletype.h.
|
private |
name of the particle
Definition at line 619 of file particletype.h.
|
private |
pole mass of the particle
Definition at line 621 of file particletype.h.
|
private |
width of the particle
Definition at line 623 of file particletype.h.
|
private |
Parity of the particle.
Definition at line 625 of file particletype.h.
|
private |
PDG Code of the particle.
Definition at line 627 of file particletype.h.
|
mutableprivate |
minimum kinematically allowed mass of the particle Mutable, because it is initialized at first call of minimum mass function, so it's logically const, but not physically const, which is a classical case for using mutable.
Definition at line 634 of file particletype.h.
|
mutableprivate |
minimum mass, where the spectral function is non-zero Mutable, because it is initialized at first call of minimum mass function, so it's logically const, but not physically const, which is a classical case for using mutable.
Definition at line 641 of file particletype.h.
|
mutableprivate |
This normalization factor ensures that the spectral function is normalized to unity, when integrated over its full domain.
Definition at line 644 of file particletype.h.
|
private |
Charge of the particle; filled automatically from pdgcode_.
Definition at line 646 of file particletype.h.
|
mutableprivate |
Isospin of the particle; filled automatically from pdgcode_.
Definition at line 648 of file particletype.h.
|
private |
Isospin projection of the particle; filled automatically from pdgcode_.
Definition at line 650 of file particletype.h.
|
private |
Container for the isospin multiplet information.
Definition at line 653 of file particletype.h.
|
mutableprivate |
Maximum factor for single-res mass sampling, cf. sample_resonance_mass.
Definition at line 656 of file particletype.h.
|
mutableprivate |
Maximum factor for double-res mass sampling, cf. sample_resonance_masses.
Definition at line 658 of file particletype.h.