MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
Loading...
Searching...
No Matches
StructureDatabase.hh
1
4//
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 <map>
19#include <memory>
20#include <set>
21#include <string>
22#include <unordered_map>
23
24#include "marley/DecayScheme.hh"
25#include "marley/JSON.hh"
26
27namespace marley {
28
30 class Fragment;
32 class OpticalModel;
33
41
42 public:
43
46
53 void emplace_decay_scheme(int pdg, const std::string& filename,
54 DecayScheme::FileFormat format = DecayScheme::FileFormat::talys);
55
61 void add_decay_scheme(int pdg, std::unique_ptr<marley::DecayScheme>& ds);
62
69 std::set<int> find_all_nuclides(const std::string& filename,
70 DecayScheme::FileFormat format = DecayScheme::FileFormat::talys);
71
73 void clear();
74
81 void remove_decay_scheme(int pdg);
82
87 marley::DecayScheme* get_decay_scheme(const int particle_id);
88
94 marley::DecayScheme* get_decay_scheme(const int Z, const int A);
95
100
106 const int A);
107
112
118 const int A);
119
125 const int Z, const int A);
126
131 const int nuc_pdg);
132
134 inline const std::unordered_map<int,
135 std::unique_ptr<marley::DecayScheme> >& decay_schemes() const
136 {
137 return decay_scheme_table_;
138 }
139
141 static inline const std::map<int, marley::Fragment>& fragments() {
142 if ( !initialized_gs_spin_parity_table_ ) initialize_jpi_table();
143 return fragment_table_;
144 }
145
150 static const marley::Fragment* get_fragment(const int fragment_pdg);
151
157 static const marley::Fragment* get_fragment(const int Z, const int A);
158
161 inline int get_fragment_l_max() const { return fragment_l_max_; }
162
165 inline int get_gamma_l_max() const { return gamma_l_max_; }
166
169 inline void set_fragment_l_max( int ell ) { fragment_l_max_ = ell; }
170
173 inline void set_gamma_l_max( int ell ) { gamma_l_max_ = ell; }
174
179 static void get_gs_spin_parity(int nuc_pdg, int& twoJ,
180 marley::Parity& Pi);
181
187 static void get_gs_spin_parity(const int Z, const int A, int& twoJ,
188 marley::Parity& Pi);
189
192 void load_optical_model_params( const marley::JSON* om_config = nullptr );
193
194 private:
195
198 static std::unordered_map<int, std::unique_ptr<marley::DecayScheme> >
199 decay_scheme_table_;
200
203 std::unordered_map<int, std::unique_ptr<marley::OpticalModel> >
204 optical_model_table_;
205
209 std::unordered_map<int, std::unique_ptr<marley::LevelDensityModel> >
210 level_density_table_;
211
215 std::unordered_map<int, std::unique_ptr<
216 marley::GammaStrengthFunctionModel> > gamma_strength_function_table_;
217
220 static std::map<int, marley::Fragment> fragment_table_;
221
223 static constexpr int DEFAULT_FRAGMENT_L_MAX = 5;
224
226 static constexpr int DEFAULT_GAMMA_L_MAX = DEFAULT_FRAGMENT_L_MAX;
227
231 int fragment_l_max_ = DEFAULT_FRAGMENT_L_MAX;
232
236 int gamma_l_max_ = DEFAULT_GAMMA_L_MAX;
237
240 static bool initialized_gs_spin_parity_table_;
241
243 const std::string structure_index_filename_ = "nuclide_index.txt";
244
247 bool loaded_structure_index_ = false;
248
251 std::map< int, std::string > decay_scheme_filenames_;
252
255 static const std::string jpi_data_file_name_;
256
258 static std::map< int, std::pair<int, marley::Parity> > jpi_table_;
259
262 static void initialize_jpi_table();
263
266 void load_structure_index();
267
270 std::map< std::string, marley::JSON > om_config_map_;
271 };
272
273}
Discrete level and γ-ray data for a specific nuclide.
FileFormat
The FileFormat type is used to tell the DecayScheme class which format to assume when parsing a discr...
Simple container for storing reference data about each of the nuclear fragments considered by MARLEY'...
Definition Fragment.hh:27
Abstract base class for models of gamma-ray strength functions.
Abstract base class for models of nuclear level densities.
Abstract base class for nuclear optical model implementations.
Type-safe representation of a parity value (either +1 or -1)
Definition Parity.hh:25
marley::GammaStrengthFunctionModel & get_gamma_strength_function_model(const int Z, const int A)
Retrieves a gamma-ray strength function model object from the database, creating it if one did not al...
void remove_decay_scheme(int pdg)
Deletes the discrete level data in the database associated with a given nuclide.
static const marley::Fragment * get_fragment(const int fragment_pdg)
Retrieves nuclear fragment data from the database.
void load_optical_model_params(const marley::JSON *om_config=nullptr)
Helper function that initializes the map of JSON settings for the optical model parameters.
void set_fragment_l_max(int ell)
Sets the maximum orbital angular momentum to consider when simulating fragment emission to the contin...
marley::OpticalModel & get_optical_model(int nucleus_pid)
Retrieves an optical model object from the database, creating it if one did not already exist.
void add_decay_scheme(int pdg, std::unique_ptr< marley::DecayScheme > &ds)
Add a DecayScheme object to the database that contains discrete level data for a specific nuclide.
std::set< int > find_all_nuclides(const std::string &filename, DecayScheme::FileFormat format=DecayScheme::FileFormat::talys)
Create a set of Particle Data Group codes for every nuclide in a discrete level data file.
static void get_gs_spin_parity(int nuc_pdg, int &twoJ, marley::Parity &Pi)
Looks up the ground-state spin-parity for a particular nuclide.
StructureDatabase()
Creates an empty database.
void set_gamma_l_max(int ell)
Sets the maximum multipolarity to consider when simulating gamma-ray emission to the continuum.
const std::unordered_map< int, std::unique_ptr< marley::DecayScheme > > & decay_schemes() const
Retrieves a const reference to the table of DecayScheme objects.
void emplace_decay_scheme(int pdg, const std::string &filename, DecayScheme::FileFormat format=DecayScheme::FileFormat::talys)
Construct and add a DecayScheme object to the database that contains discrete level data for a specif...
static const std::map< int, marley::Fragment > & fragments()
Retrieves a const reference to the table of Fragment objects.
int get_gamma_l_max() const
Returns the maximum multipolarity to consider when simulating gamma-ray emission to the continuum.
int get_fragment_l_max() const
Returns the maximum orbital angular momentum to consider when simulating fragment emission to the con...
marley::DecayScheme * get_decay_scheme(const int particle_id)
Retrieves discrete level data from the database.
marley::LevelDensityModel & get_level_density_model(const int nucleus_pid)
Retrieves a level density model object from the database, creating it if one did not already exist.
void clear()
Removes all previously stored data from the database.