MARLEY (Model of Argon Reaction Low Energy Yields)  v1.2.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
MassTable.hh
1 //
5 // This file is part of MARLEY (Model of Argon Reaction Low Energy Yields)
6 //
7 // MARLEY is free software: you can redistribute it and/or modify it under the
8 // terms of version 3 of the GNU General Public License as published by the
9 // Free Software Foundation.
10 //
11 // For the full text of the license please see COPYING or
12 // visit http://opensource.org/licenses/GPL-3.0
13 //
14 // Please respect the MCnet academic usage guidelines. See GUIDELINES
15 // or visit https://www.montecarlonet.org/GUIDELINES for details.
16 
17 #pragma once
18 #include <unordered_map>
19 
20 namespace marley {
21 
22  // Forward-declare some classes
23  class Fragment;
24  class JSON;
25 
27  class MassTable {
28 
29  public:
30 
32  MassTable(const MassTable&) = delete;
33 
35  MassTable(MassTable&&) = delete;
36 
38  MassTable& operator=(const MassTable&) = delete;
39 
42 
45  static const MassTable& Instance();
46 
50  double get_particle_mass(int pdg_code) const;
51 
59  double get_atomic_mass(int pdg_code, bool theory_ok = true) const;
60 
69  double get_atomic_mass(int Z, int A, bool theory_ok = true) const;
70 
81  double get_fragment_separation_energy(int Z, int A, int pdg,
82  bool theory_ok = true) const;
83 
93  double get_fragment_separation_energy(int nuc_pdg, int frag_pdg,
94  bool theory_ok = true) const;
95 
104  double get_binding_energy(int Z, int A, bool theory_ok = true) const;
105 
115  double get_mass_excess(int Z, int A, bool theory_ok = true) const;
116 
123  double liquid_drop_model_mass_excess(int Z, int A) const;
124 
129  double liquid_drop_model_atomic_mass(int Z, int A) const;
130 
136  double fragment_emission_threshold(const int Zi, const int Ai,
137  const marley::Fragment& f) const;
138 
144  double unbound_threshold(const int Zi, const int Ai) const;
145 
150  double unbound_threshold(const int initial_nucleus_pdg) const;
151 
152  protected:
153 
155  MassTable();
156 
157  private:
158 
159  // Helper function that converts the input JSON array into
160  // (PDG code, mass) pairs and stores them in map_to_use
161  void assign_masses(const marley::JSON& obj_array,
162  const std::string& array_key,
163  std::unordered_map<int, double>& map_to_use);
164 
165  // Function used internally by the mass table. Returns an atomic mass and
166  // loads the boolean value exp with true if it is an experimental value
167  // from the lookup table (and therefore has units of micro-amu) or false
168  // if it is a theoretical value computed using the liquid drop model (and
169  // has units of MeV). This method of looking up masses is used to avoid
170  // unnecessary unit conversions that can lead to losses of precision.
171  double lookup_atomic_mass(int nucleus_pid, bool& exp,
172  bool theory_ok = true) const;
173  double lookup_atomic_mass(int Z, int A, bool& exp,
174  bool theory_ok = true) const;
175 
176  // Lookup table for particle masses. Keys are PDG particle
177  // ID numbers, values are masses in micro-amu.
178  std::unordered_map<int, double> particle_masses_;
179 
180  // Lookup table for atomic masses. Keys are PDG particle
181  // ID numbers for the nuclei, values are masses in micro-amu.
182  std::unordered_map<int, double> atomic_masses_;
183 
184  // Factor to use when converting from micro-amu to MeV
185  static constexpr double micro_amu_ = 0.000931494061; // MeV/uAMU
186 
188  static const std::string data_file_name_;
189  };
190 
191 }
Simple container for storing reference data about each of the nuclear fragments considered by MARLEY'...
Definition: Fragment.hh:27
Definition: JSON.hh:62
Singleton lookup table for particle and atomic masses.
Definition: MassTable.hh:27
MassTable(MassTable &&)=delete
Deleted move constructor.
double fragment_emission_threshold(const int Zi, const int Ai, const marley::Fragment &f) const
Get the approximate excitation energy threshold for emission of a particular nuclear fragment.
Definition: MassTable.cc:264
double get_fragment_separation_energy(int Z, int A, int pdg, bool theory_ok=true) const
Get the separation energy for emission of a nuclear fragment from a nucleus.
Definition: MassTable.cc:205
static const MassTable & Instance()
Get a const reference to the singleton instance of the MassTable.
Definition: MassTable.cc:68
double get_mass_excess(int Z, int A, bool theory_ok=true) const
Get the mass excess of a nucleus.
Definition: MassTable.cc:182
double get_atomic_mass(int pdg_code, bool theory_ok=true) const
Get the mass of an atom.
Definition: MassTable.cc:94
double liquid_drop_model_atomic_mass(int Z, int A) const
Calculate a theoretical atomic mass using the liquid drop model.
Definition: MassTable.cc:79
double get_binding_energy(int Z, int A, bool theory_ok=true) const
Get the binding energy of a nucleus.
Definition: MassTable.cc:166
MassTable & operator=(const MassTable &)=delete
Deleted copy assignment operator.
MassTable & operator=(MassTable &&)=delete
Deleted move assignment operator.
double get_particle_mass(int pdg_code) const
Get the mass of a particle.
Definition: MassTable.cc:83
double liquid_drop_model_mass_excess(int Z, int A) const
Calculate a theoretical mass excess for a nucleus using the liquid drop model.
Definition: MassTable.cc:232
double unbound_threshold(const int Zi, const int Ai) const
Computes the lowest excitation energy at which one of the nuclear fragments considered by the HauserF...
Definition: MassTable.cc:275
MassTable(const MassTable &)=delete
Deleted copy constructor.
MassTable()
Create the singleton MassTable object.
Definition: MassTable.cc:29