Version: SMASH-2.0
isoparticletype.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2020
3  * SMASH Team
4  *
5  * GNU General Public License (GPLv3 or later)
6  */
7 
8 #ifndef SRC_INCLUDE_SMASH_ISOPARTICLETYPE_H_
9 #define SRC_INCLUDE_SMASH_ISOPARTICLETYPE_H_
10 
11 #include <string>
12 #include <unordered_map>
13 #include <vector>
14 
15 #include "particletype.h"
16 #include "sha256.h"
17 #include "tabulation.h"
18 
19 namespace smash {
20 
29  public:
39  IsoParticleType(const std::string &n, double m, double w, unsigned int s,
40  Parity p);
41 
46  IsoParticleType(const IsoParticleType &) = delete;
48  IsoParticleType &operator=(const IsoParticleType &) = delete;
49 
51  IsoParticleType(IsoParticleType &&) = default;
54 
61  bool operator==(const IsoParticleType &rhs) const {
62  return states_[0]->pdgcode() == rhs.states_[0]->pdgcode();
63  }
64 
66  const std::string &name() const { return name_; }
67 
69  double mass() const { return mass_; }
70 
72  double width() const { return width_; }
73 
75  int isospin() const { return states_.size() - 1; }
76 
81  unsigned int spin() const { return spin_; }
82 
86  Parity parity() const { return parity_; }
87 
91  bool is_hadron() const { return states_[0]->is_hadron(); }
92 
94  ParticleTypePtrList get_states() const { return states_; }
95 
102  void add_state(const ParticleType &type);
103 
108  const IsoParticleType *anti_multiplet() const;
109 
114  bool has_anti_multiplet() const;
115 
117  static const IsoParticleTypeList &list_all();
118 
121  static const std::vector<const IsoParticleType *> list_baryon_resonances();
122 
131  static const IsoParticleType *try_find(const std::string &name);
132 
140  static const IsoParticleType &find(const std::string &name);
141 
149  static IsoParticleType *find(const ParticleType &type);
150 
155  struct ParticleNotFoundFailure : public std::runtime_error {
156  using std::runtime_error::runtime_error;
157  };
158 
165  static bool exists(const std::string &name);
166 
174  static const ParticleTypePtr find_state(const std::string &name);
175 
183  static void create_multiplet(const ParticleType &type);
184 
194  static void tabulate_integrals(sha256::Hash hash,
195  const bf::path &tabulations_path);
196 
202  double get_integral_NR(double sqrts);
203 
210  double get_integral_RR(IsoParticleType *type_res_2, double sqrts);
211 
217  double get_integral_RK(double sqrts);
218 
224  double get_integral_piR(double sqrts);
225 
231  double get_integral_rhoR(double sqrts);
232 
233  private:
235  std::string name_;
237  double mass_;
239  double width_;
241  unsigned int spin_;
245  ParticleTypePtrList states_;
246 
265 
272  static IsoParticleType &find_private(const std::string &name);
273 };
274 
275 } // namespace smash
276 
277 #endif // SRC_INCLUDE_SMASH_ISOPARTICLETYPE_H_
smash
Definition: action.h:24
smash::IsoParticleType::isospin
int isospin() const
Returns twice the total isospin of the multiplet.
Definition: isoparticletype.h:75
smash::IsoParticleType::parity
Parity parity() const
Definition: isoparticletype.h:86
smash::IsoParticleType::anti_multiplet
const IsoParticleType * anti_multiplet() const
Return a multiplet of antiparticles, if it is different from the original multiplet.
Definition: isoparticletype.cc:106
smash::IsoParticleType::width
double width() const
Returns the (average) multiplet width.
Definition: isoparticletype.h:72
smash::IsoParticleType::find
static const IsoParticleType & find(const std::string &name)
Returns the IsoParticleType object for the given name.
Definition: isoparticletype.cc:61
smash::IsoParticleType::spin_
unsigned int spin_
twice the spin of the multiplet
Definition: isoparticletype.h:241
smash::IsoParticleType::name_
std::string name_
name of the multiplet
Definition: isoparticletype.h:235
smash::IsoParticleType::name
const std::string & name() const
Returns the name of the multiplet.
Definition: isoparticletype.h:66
smash::IsoParticleType::get_integral_rhoR
double get_integral_rhoR(double sqrts)
Look up the tabulated resonance integral for the XX -> rhoR cross section.
Definition: isoparticletype.cc:328
smash::IsoParticleType::has_anti_multiplet
bool has_anti_multiplet() const
Check if there is a multiplet of antiparticles, which is different from the original multiplet.
Definition: isoparticletype.cc:119
smash::IsoParticleType::mass_
double mass_
(average) mass of the multiplet
Definition: isoparticletype.h:237
smash::IsoParticleType::spin
unsigned int spin() const
Returns twice the spin of the multiplet.
Definition: isoparticletype.h:81
smash::IsoParticleType::states_
ParticleTypePtrList states_
list of states that are contained in the multiplet
Definition: isoparticletype.h:245
smash::IsoParticleType::parity_
Parity parity_
parity of the multiplet
Definition: isoparticletype.h:243
smash::IsoParticleType::XS_NR_tabulation_
Tabulation * XS_NR_tabulation_
A tabulation for the NN -> NR cross sections, where R is a resonance from this multiplet.
Definition: isoparticletype.h:255
smash::IsoParticleType::XS_RK_tabulation_
Tabulation * XS_RK_tabulation_
A tabulation of the spectral integral for the NK -> RK cross sections.
Definition: isoparticletype.h:250
smash::IsoParticleType::operator==
bool operator==(const IsoParticleType &rhs) const
Returns whether the two IsoParticleType objects have the same PDG code for their first state; if so,...
Definition: isoparticletype.h:61
smash::IsoParticleType::is_hadron
bool is_hadron() const
Definition: isoparticletype.h:91
smash::IsoParticleType::tabulate_integrals
static void tabulate_integrals(sha256::Hash hash, const bf::path &tabulations_path)
Tabulate all relevant integrals.
Definition: isoparticletype.cc:266
smash::IsoParticleType::XS_rhoR_tabulation_
Tabulation * XS_rhoR_tabulation_
A tabulation for the ρρ integrals.
Definition: isoparticletype.h:264
smash::ParticleTypePtr
Definition: particletype.h:665
smash::IsoParticleType::get_integral_piR
double get_integral_piR(double sqrts)
Look up the tabulated resonance integral for the XX -> piR cross section.
Definition: isoparticletype.cc:312
smash::IsoParticleType::find_state
static const ParticleTypePtr find_state(const std::string &name)
Returns the ParticleType object for the given name, by first finding the correct multiplet and then l...
Definition: isoparticletype.cc:123
smash::IsoParticleType
Definition: isoparticletype.h:28
smash::IsoParticleType::list_baryon_resonances
static const std::vector< const IsoParticleType * > list_baryon_resonances()
Returns a list of all IsoParticleTypes that are baryon resonances.
Definition: isoparticletype.cc:24
smash::IsoParticleType::add_state
void add_state(const ParticleType &type)
Add a new state to an existing multiplet (and check if isospin symmetry is fulfilled).
Definition: isoparticletype.cc:139
smash::IsoParticleType::exists
static bool exists(const std::string &name)
Returns whether the ParticleType with the given pdgcode exists.
Definition: isoparticletype.cc:78
smash::IsoParticleType::get_integral_NR
double get_integral_NR(double sqrts)
Look up the tabulated resonance integral for the XX -> NR cross section.
Definition: isoparticletype.cc:304
smash::ParticleType
Definition: particletype.h:97
smash::IsoParticleType::XS_piR_tabulation_
Tabulation * XS_piR_tabulation_
A tabulation of the spectral integral for the dpi -> d'pi cross sections.
Definition: isoparticletype.h:248
particletype.h
smash::Tabulation
A class for storing a one-dimensional lookup table of floating-point values.
Definition: tabulation.h:35
smash::IsoParticleType::mass
double mass() const
Returns the (average) multiplet mass.
Definition: isoparticletype.h:69
sha256.h
smash::sha256::Hash
std::array< uint8_t, HASH_SIZE > Hash
A SHA256 hash.
Definition: sha256.h:25
smash::IsoParticleType::ParticleNotFoundFailure
Definition: isoparticletype.h:155
smash::IsoParticleType::XS_DeltaR_tabulation_
Tabulation * XS_DeltaR_tabulation_
A tabulation for the NN -> RΔ cross sections, where R is a resonance from this multiplet.
Definition: isoparticletype.h:260
smash::IsoParticleType::try_find
static const IsoParticleType * try_find(const std::string &name)
Returns the IsoParticleType pointer for the given name.
Definition: isoparticletype.cc:57
smash::IsoParticleType::get_integral_RK
double get_integral_RK(double sqrts)
Look up the tabulated resonance integral for the XX -> RK cross section.
Definition: isoparticletype.cc:320
smash::IsoParticleType::find_private
static IsoParticleType & find_private(const std::string &name)
Private version of the 'find' method that returns a non-const reference.
Definition: isoparticletype.cc:69
smash::IsoParticleType::get_integral_RR
double get_integral_RR(IsoParticleType *type_res_2, double sqrts)
Look up the tabulated resonance integral for the XX -> RR cross section.
Definition: isoparticletype.cc:336
smash::Parity
Parity
Represent the parity of a particle type.
Definition: particletype.h:24
smash::pdg::p
constexpr int p
Proton.
Definition: pdgcode_constants.h:28
smash::IsoParticleType::operator=
IsoParticleType & operator=(const IsoParticleType &)=delete
Assignment is not allowed, see copy constructor above.
smash::IsoParticleType::width_
double width_
(average) width of the multiplet
Definition: isoparticletype.h:239
smash::pdg::n
constexpr int n
Neutron.
Definition: pdgcode_constants.h:30
smash::IsoParticleType::IsoParticleType
IsoParticleType(const std::string &n, double m, double w, unsigned int s, Parity p)
Creates a fully initialized IsoParticleType object.
Definition: isoparticletype.cc:38
tabulation.h
smash::IsoParticleType::get_states
ParticleTypePtrList get_states() const
Returns list of states that form part of the multiplet.
Definition: isoparticletype.h:94
smash::IsoParticleType::list_all
static const IsoParticleTypeList & list_all()
Returns a list of all IsoParticleTypes.
Definition: isoparticletype.cc:42
smash::IsoParticleType::create_multiplet
static void create_multiplet(const ParticleType &type)
Add a new multiplet to the global list of IsoParticleTypes, which contains type.
Definition: isoparticletype.cc:160