44#include "tklevel_scheme.h"
58 static std::recursive_mutex& get_mutex() {
59 static std::recursive_mutex mutex;
64 std::map<tkstring, shared_ptr<tklevel_scheme>> fmap_of_level_scheme;
66 std::vector<shared_ptr<tknucleus>> fvector_of_nuclei;
68 std::map<tkstring, shared_ptr<tknucleus>> fmap_of_nuclei;
69 std::map<int, std::map<int, shared_ptr<tknucleus>>> fmap_of_nuclei_per_z_and_a;
70 std::map<int, std::vector<shared_ptr<tknucleus>>> fmap_of_nuclei_per_z;
71 std::map<int, std::vector<shared_ptr<tknucleus>>> fmap_of_nuclei_per_a;
72 std::map<int, std::vector<shared_ptr<tknucleus>>> fmap_of_nuclei_per_n;
74 std::map<int, tkstring> fmap_of_symbols;
95 bool known_nucleus(
int _z,
int _a){
return (fmap_of_nuclei_per_z_and_a.count(_z) && fmap_of_nuclei_per_z_and_a.at(_z).count(_a));}
104 vector<shared_ptr<tknucleus> >
get_nuclei(std::function<
bool(shared_ptr<tknucleus>)>
const& _selection);
107 const vector<shared_ptr<tknucleus>> &
get_nuclei(){
return fvector_of_nuclei;}
119 const vector<shared_ptr<tknucleus>> &
get_nuclei_for_z(
int z){
return fmap_of_nuclei_per_z[z];}
121 const vector<shared_ptr<tknucleus>> &
get_nuclei_for_a(
int a){
return fmap_of_nuclei_per_a[a];}
123 const vector<shared_ptr<tknucleus>> &
get_nuclei_for_n(
int n){
return fmap_of_nuclei_per_n[n];}
126 shared_ptr<tknucleus>
get_nucleus(
const tkstring &_nuc){
return (fmap_of_nuclei.count(_nuc)) ? fmap_of_nuclei[_nuc] :
nullptr;}
128 shared_ptr<tknucleus>
get_nucleus(
int _z,
int _a) {
return (
known_nucleus(_z, _a)) ? fmap_of_nuclei_per_z_and_a[_z][_a] :
nullptr;}
141 void preload_nuclei();
142 shared_ptr<tklevel_scheme> get_level_scheme(
const tkstring &_nuc,
int _zz,
int _aa);
152#define gmanager (tkn::tkmanager::the_data_manager())
Manages the database loading and provides access to the physics properties.
void set_max_level_id(int _id)
define the max value of the attributed level ids
static tkmanager * the_data_manager()
int get_new_level_id()
define a new unique level id
const std::map< int, std::vector< shared_ptr< tknucleus > > > & get_map_of_nuclei_per_a()
return a map of nuclei vector sorted by a
const vector< shared_ptr< tknucleus > > & get_nuclei_for_a(int a)
return a vector containing all the known nuclei for a given a
const std::map< tkstring, shared_ptr< tknucleus > > & get_map_of_nuclei()
return a map of nuclei sorted by name
shared_ptr< tknucleus > get_nucleus(const tkstring &_nuc)
return a shared pointer to a nucleus from its name
bool known_nucleus(int _z, int _a)
is the nucleus Z and A known
const vector< shared_ptr< tknucleus > > & get_nuclei_for_n(int n)
return a vector containing all the known nuclei for a given n
const vector< shared_ptr< tknucleus > > & get_nuclei()
return a vector containing all the known nuclei
int get_new_decay_id()
define a new unique decay id
shared_ptr< tknucleus > get_nucleus(int _z, int _a)
return a shared pointer to a nucleus from its z an a
bool known_nucleus(tkstring _nuc)
is the nucleus symbol known (ex: "12C")
const tkstring & get_element_symbol(int _charge)
returns the element symbol for a given proton number
void set_max_decay_id(int _id)
define the max value of the attributed level ids
const std::map< int, std::vector< shared_ptr< tknucleus > > > & get_map_of_nuclei_per_z()
return a map of nuclei vector sorted by z
const std::map< int, std::vector< shared_ptr< tknucleus > > > & get_map_of_nuclei_per_n()
return a map of nuclei vector sorted by n
bool known_element(int _z)
is the element Z is known
bool known_element(tkstring _nuc, int &_z)
is the element symbol is known (ex: "C")
void preload_level_schemes(bool _verbose=false)
preload all the level schemes from the database
const vector< shared_ptr< tknucleus > > & get_nuclei_for_z(int z)
return a vector containing all the known nuclei for a given z
bool is_level_scheme_loaded(const tkstring &_nuc)
returns true if the level scheme has already been loaded
A nucleus made of Z protons and N neutrons.
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....