Version: SMASH-1.5
isoparticletype.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2018
3  * SMASH Team
4  *
5  * GNU General Public License (GPLv3 or later)
6  */
7 
8 #ifndef SRC_INCLUDE_ISOPARTICLETYPE_H_
9 #define SRC_INCLUDE_ISOPARTICLETYPE_H_
10 
11 #include <string>
12 #include <unordered_map>
13 
14 #include "particletype.h"
15 #include "tabulation.h"
16 
17 namespace smash {
18 
27  public:
37  IsoParticleType(const std::string &n, double m, double w, unsigned int s,
38  Parity p);
39 
44  IsoParticleType(const IsoParticleType &) = delete;
46  IsoParticleType &operator=(const IsoParticleType &) = delete;
47 
49  IsoParticleType(IsoParticleType &&) = default;
52 
59  bool operator==(const IsoParticleType &rhs) const {
60  return states_[0]->pdgcode() == rhs.states_[0]->pdgcode();
61  }
62 
64  const std::string &name() const { return name_; }
65 
67  double mass() const { return mass_; }
68 
70  double width() const { return width_; }
71 
73  int isospin() const { return states_.size() - 1; }
74 
79  unsigned int spin() const { return spin_; }
80 
84  Parity parity() const { return parity_; }
85 
89  bool is_hadron() const { return states_[0]->is_hadron(); }
90 
92  ParticleTypePtrList get_states() const { return states_; }
93 
100  void add_state(const ParticleType &type);
101 
106  bool has_anti_multiplet() const;
107 
109  static const IsoParticleTypeList &list_all();
110 
119  static const IsoParticleType *try_find(const std::string &name);
120 
128  static const IsoParticleType &find(const std::string &name);
129 
137  static IsoParticleType *find(const ParticleType &type);
138 
143  struct ParticleNotFoundFailure : public std::runtime_error {
144  using std::runtime_error::runtime_error;
145  };
146 
153  static bool exists(const std::string &name);
154 
162  static const ParticleTypePtr find_state(const std::string &name);
163 
171  static void create_multiplet(const ParticleType &type);
172 
178  double get_integral_NR(double sqrts);
179 
186  double get_integral_RR(const ParticleType &type_res_2, double sqrts);
187 
193  TabulationPtr integrate_RR(ParticleTypePtr &type_res_2);
194 
200  double get_integral_RK(double sqrts);
201 
207  double get_integral_piR(double sqrts);
208 
209  private:
211  std::string name_;
213  double mass_;
215  double width_;
217  unsigned int spin_;
221  ParticleTypePtrList states_;
222 
224  TabulationPtr XS_piR_tabulation_;
226  TabulationPtr XS_RK_tabulation_;
231  TabulationPtr XS_NR_tabulation_;
236  TabulationPtr XS_DR_tabulation_;
243  std::unordered_map<IsoParticleType *, TabulationPtr> XS_RR_tabulations;
244 
251  static IsoParticleType &find_private(const std::string &name);
252 };
253 
254 } // namespace smash
255 
256 #endif // SRC_INCLUDE_ISOPARTICLETYPE_H_
static const IsoParticleType & find(const std::string &name)
Returns the IsoParticleType object for the given name.
ParticleTypePtrList get_states() const
Returns list of states that form part of the multiplet.
static IsoParticleType & find_private(const std::string &name)
Private version of the &#39;find&#39; method that returns a non-const reference.
double get_integral_piR(double sqrts)
Look up the tabulated resonance integral for the XX -> piR cross section.
double mass_
(average) mass of the multiplet
double width() const
Returns the (average) multiplet width.
std::unordered_map< IsoParticleType *, TabulationPtr > XS_RR_tabulations
A tabulation list for the NN -> RR&#39; cross sections, where R is this multiplet and R&#39; is a baryon reso...
double get_integral_RR(const ParticleType &type_res_2, double sqrts)
Look up the tabulated resonance integral for the XX -> RR cross section.
Parity
Represent the parity of a particle type.
Definition: particletype.h:24
unsigned int spin_
twice the spin of the multiplet
double get_integral_NR(double sqrts)
Look up the tabulated resonance integral for the XX -> NR cross section.
double get_integral_RK(double sqrts)
Look up the tabulated resonance integral for the XX -> RK cross section.
static bool exists(const std::string &name)
Returns whether the ParticleType with the given pdgcode exists.
IsoParticleType & operator=(const IsoParticleType &)=delete
Assignment is not allowed, see copy constructor above.
unsigned int spin() const
Returns twice the spin of the multiplet.
TabulationPtr XS_RK_tabulation_
A tabulation of the spectral integral for the NK -> RK cross sections.
Throw when requested particle could not be found.
ParticleTypePtrList states_
list of states that are contained in the multiplet
Particle type contains the static properties of a particle species.
Definition: particletype.h:87
IsoParticleType is a class to represent isospin multiplets.
double width_
(average) width of the multiplet
std::string name_
name of the multiplet
static void create_multiplet(const ParticleType &type)
Add a new multiplet to the global list of IsoParticleTypes, which contains type.
TabulationPtr XS_DR_tabulation_
A tabulation for the NN -> DR cross sections, where R is a resonance from this multiplet.
void add_state(const ParticleType &type)
Add a new state to an existing multiplet (and check if isospin symmetry is fulfilled).
static const IsoParticleType * try_find(const std::string &name)
Returns the IsoParticleType pointer for the given name.
Parity parity_
parity of the multiplet
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...
double mass() const
Returns the (average) multiplet mass.
constexpr int p
Proton.
TabulationPtr XS_NR_tabulation_
A tabulation for the NN -> NR cross sections, where R is a resonance from this multiplet.
TabulationPtr XS_piR_tabulation_
A tabulation of the spectral integral for the dpi -> d&#39;pi cross sections.
IsoParticleType(const std::string &n, double m, double w, unsigned int s, Parity p)
Creates a fully initialized IsoParticleType object.
A pointer-like interface to global references to ParticleType objects.
Definition: particletype.h:660
bool has_anti_multiplet() const
Check if there is a multiplet of antiparticles, which is different from the original multiplet...
constexpr int n
Neutron.
bool operator==(const IsoParticleType &rhs) const
Returns whether the two IsoParticleType objects have the same PDG code for their first state; if so...
int isospin() const
Returns twice the total isospin of the multiplet.
TabulationPtr integrate_RR(ParticleTypePtr &type_res_2)
Utility function to help compute various XX->RR spectral integrals.
const std::string & name() const
Returns the name of the multiplet.
Definition: action.h:24
static const IsoParticleTypeList & list_all()
Returns a list of all IsoParticleTypes.