7 #ifndef SRC_INCLUDE_PARTICLETYPE_H_ 8 #define SRC_INCLUDE_PARTICLETYPE_H_ 54 throw std::runtime_error(
"unreachable");
107 static constexpr
double width_cutoff = 1e-5;
141 const std::string &
name()
const {
return name_; }
144 double mass()
const {
return mass_; }
180 unsigned int I = isospin();
181 return (I == 0) ? 0 :
static_cast<double>(isospin3()) / I;
188 int32_t
charge()
const {
return charge_; }
191 unsigned int spin()
const {
return pdgcode_.spin(); }
203 bool is_meson()
const {
return pdgcode_.is_meson(); }
215 bool is_Delta()
const {
return pdgcode_.is_Delta(); }
218 bool is_rho()
const {
return pdgcode_.is_rho(); }
222 return is_baryon() && isospin() == 1 && !pdgcode_.is_nucleon() &&
223 pdgcode_.strangeness() == 0 && pdgcode_.charmness() == 0;
231 return is_baryon() && isospin() == 3 && !pdgcode_.is_Delta() &&
232 pdgcode_.strangeness() == 0 && pdgcode_.charmness() == 0;
236 inline bool is_stable()
const {
return width_ < width_cutoff; }
239 inline bool is_nucleus()
const {
return pdgcode_.is_nucleus(); }
242 inline bool is_deuteron()
const {
return pdgcode_.is_deuteron(); }
246 return is_nucleus() && std::abs(pdgcode_.get_decimal()) == 1000010021;
259 double min_mass_kinematic()
const;
272 double min_mass_spectral()
const;
282 double partial_width(
const double m,
const DecayBranch *mode)
const;
290 double total_width(
const double m)
const;
322 double get_partial_width(
const double m,
const ParticleType &t_a,
336 double get_partial_in_width(
const double m,
const ParticleData &p_a,
353 double spectral_function(
double m)
const;
363 double spectral_function_no_norm(
double m)
const;
370 double spectral_function_const_width(
double m)
const;
382 double spectral_function_simple(
double m)
const;
394 double sample_resonance_mass(
const double mass_stable,
395 const double cms_energy,
int L = 0)
const;
407 std::pair<double, double> sample_resonance_masses(
const ParticleType &t2,
408 const double cms_energy,
417 void dump_width_and_spectral_function()
const;
426 static const ParticleTypeList &list_all();
429 static ParticleTypePtrList &list_nucleons();
431 static ParticleTypePtrList &list_anti_nucleons();
436 static ParticleTypePtrList &list_Deltas();
441 static ParticleTypePtrList &list_anti_Deltas();
446 static ParticleTypePtrList &list_baryon_resonances();
451 static ParticleTypePtrList &list_light_nuclei();
486 using std::runtime_error::runtime_error;
495 static bool exists(
PdgCode pdgcode);
503 static bool exists(
const std::string &name);
518 static void create_type_list(
const std::string &particles);
525 return pdgcode() == rhs.
pdgcode();
532 return pdgcode() != rhs.
pdgcode();
541 return pdgcode() < rhs.
pdgcode();
545 static void check_consistency();
592 using std::runtime_error::runtime_error;
622 mutable double norm_factor_ = -1.;
634 mutable double max_factor1_ = 1.;
636 mutable double max_factor2_ = 1.;
663 return std::addressof(lookup());
674 return index_ == rhs.
index_;
682 return index_ != rhs.
index_;
691 return index_ < rhs.
index_;
695 operator bool()
const {
return index_ != 0xffff; }
723 assert(index_ != 0xffff);
732 std::uint16_t index_ = 0xffff;
736 assert(has_antiparticle());
737 return &find(pdgcode_.get_antiparticle());
742 #endif // SRC_INCLUDE_PARTICLETYPE_H_
const ParticleType & lookup() const
Helper function that does the ParticleType lookup from the stored index.
int I3_
Isospin projection of the particle; filled automatically from pdgcode_.
The ThreeVector class represents a physical three-vector with the components .
bool has_antiparticle() const
void operator*=(Parity &x, Parity y)
PdgCode pdgcode_
PDG Code of the particle.
int baryon_number() const
Parity parity_
Parity of the particle.
bool operator!=(const ParticleType &rhs) const
bool operator<(const ParticleTypePtr &rhs) const
"Less than" operator
bool operator<(const ParticleType &rhs) const
"Less than" operator for sorting the ParticleType list (by PDG code)
Parity
Represent the parity of a particle type.
std::string name_
name of the particle
EnergyMomentumTensor operator-(EnergyMomentumTensor a, const EnergyMomentumTensor &b)
Direct subtraction operator.
double mass_
pole mass of the particle
DecayType is the abstract base class for all decay types.
bool operator!=(const ParticleTypePtr &rhs) const
ParticleTypePtr operator&() const
Returns an object that acts like a pointer, except that it requires only 2 bytes and inhibits pointer...
IsoParticleType * iso_multiplet() const
static const ParticleTypeList & list_all()
const std::string & name() const
const ParticleType * operator->() const
bool operator==(const ParticleType &rhs) const
Particle type contains the static properties of a particle species.
IsoParticleType is a class to represent isospin multiplets.
WhichDecaymodes
Decide which decay mode widths are returned in get partical widths.
Ignore dilepton decay modes widths.
EnergyMomentumTensor operator*(EnergyMomentumTensor a, const double b)
Direct multiplication operator.
PdgCode stores a Particle Data Group Particle Numbering Scheme particle type number.
double min_mass_spectral_
minimum mass, where the spectral function is non-zero Mutable, because it is initialized at first cal...
bool operator==(const ParticleTypePtr &rhs) const
Only return dilepton decays widths.
ParticleTypePtr get_antiparticle() const
int32_t charge() const
The charge of the particle.
DecayBranch is a derivative of ProcessBranch, which is used to represent decay channels.
bool is_Nstar1535() const
int antiparticle_sign() const
std::uint16_t index_
Stores the index of the references ParticleType object in the global vector.
const ParticleType & operator*() const
double width_at_pole() const
int32_t charge_
Charge of the particle; filled automatically from pdgcode_.
int isospin_
Isospin of the particle; filled automatically from pdgcode_.
A pointer-like interface to global references to ParticleType objects.
double width_
width of the particle
double isospin3_rel() const
double min_mass_kinematic_
minimum kinematically allowed mass of the particle Mutable, because it is initialized at first call o...
std::ostream & operator<<(std::ostream &out, const ActionPtr &action)
Convenience: dereferences the ActionPtr to Action.
The DecayModes class is used to store and update information about decay branches (i...
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
unsigned int spin() const
ParticleData contains the dynamic information of a certain particle.
ParticleTypePtr(std::uint16_t i)
Constructs a pointer to the ParticleType object at offset i.
bool is_Deltastar() const