![]() |
TkN 2.1
Toolkit for Nuclei
|
Manages the database loading and provides access to the physics properties. More...
Manages the database loading and provides access to the physics properties.
The TkN data manager is key part of the TkN library. It reads the TkN sqlite3 database, build the C++ structures in memory and make the links between these structures and any object created by the user. This way, the level scheme of a nucleus is only built once, even if the user create the corresponding nucleus millions times.Is also allows the user to easily browse the full database via the use of the gmanager
singleton. For example, we can loop on all the existing nuclei using:
Definition at line 54 of file tkmanager.h.
#include <tkmanager.h>
Public Member Functions | |
tkmanager () | |
virtual | ~tkmanager () |
const tkstring & | get_element_symbol (int _charge) |
returns the element symbol for a given proton number More... | |
const std::map< tkstring, shared_ptr< tknucleus > > & | get_map_of_nuclei () |
return a map of nuclei sorted by name More... | |
const std::map< int, std::vector< shared_ptr< tknucleus > > > & | get_map_of_nuclei_per_a () |
return a map of nuclei vector sorted by a More... | |
const std::map< int, std::vector< shared_ptr< tknucleus > > > & | get_map_of_nuclei_per_n () |
return a map of nuclei vector sorted by n More... | |
const std::map< int, std::vector< shared_ptr< tknucleus > > > & | get_map_of_nuclei_per_z () |
return a map of nuclei vector sorted by z More... | |
int | get_new_decay_id () |
define a new unique decay id More... | |
int | get_new_level_id () |
define a new unique level id More... | |
const vector< shared_ptr< tknucleus > > & | get_nuclei () |
return a vector containing all the known nuclei More... | |
vector< shared_ptr< tknucleus > > | get_nuclei (std::function< bool(shared_ptr< tknucleus >)>const &_selection) |
return a vector containing all the known nuclei filtered by the lambda function More... | |
const vector< shared_ptr< tknucleus > > & | get_nuclei_for_a (int a) |
return a vector containing all the known nuclei for a given a More... | |
const vector< shared_ptr< tknucleus > > & | get_nuclei_for_n (int n) |
return a vector containing all the known nuclei for a given n More... | |
const vector< shared_ptr< tknucleus > > & | get_nuclei_for_z (int z) |
return a vector containing all the known nuclei for a given z More... | |
shared_ptr< tknucleus > | get_nucleus (const tkstring &_nuc) |
return a shared pointer to a nucleus from its name More... | |
shared_ptr< tknucleus > | get_nucleus (int _z, int _a) |
return a shared pointer to a nucleus from its z an a More... | |
bool | is_level_scheme_loaded (const tkstring &_nuc) |
returns true if the level scheme has already been loaded More... | |
bool | known_element (int _z) |
is the element Z is known More... | |
bool | known_element (tkstring _nuc, int &_z) |
is the element symbol is known (ex: "C") More... | |
bool | known_nucleus (int _z, int _a) |
is the nucleus Z and A known More... | |
bool | known_nucleus (tkstring _nuc) |
is the nucleus symbol known (ex: "12C") More... | |
void | preload_level_schemes (bool _verbose=false) |
preload all the level schemes from the database More... | |
void | set_max_decay_id (int _id) |
define the max value of the attributed level ids More... | |
void | set_max_level_id (int _id) |
define the max value of the attributed level ids More... | |
Static Public Member Functions | |
static tkmanager * | the_data_manager () |
Friends | |
class | tknucleus |
tkmanager | ( | ) |
Definition at line 69 of file tkmanager.cpp.
|
virtual |
Definition at line 77 of file tkmanager.cpp.
|
inline |
returns the element symbol for a given proton number
Definition at line 101 of file tkmanager.h.
return a map of nuclei sorted by name
Definition at line 110 of file tkmanager.h.
|
inline |
return a map of nuclei vector sorted by a
Definition at line 114 of file tkmanager.h.
|
inline |
return a map of nuclei vector sorted by n
Definition at line 116 of file tkmanager.h.
|
inline |
return a map of nuclei vector sorted by z
Definition at line 112 of file tkmanager.h.
int get_new_decay_id | ( | ) |
define a new unique decay id
Definition at line 393 of file tkmanager.cpp.
int get_new_level_id | ( | ) |
define a new unique level id
Definition at line 386 of file tkmanager.cpp.
|
inline |
return a vector containing all the known nuclei
Definition at line 107 of file tkmanager.h.
vector< shared_ptr< tknucleus > > get_nuclei | ( | std::function< bool(shared_ptr< tknucleus >)>const & | _selection | ) |
return a vector containing all the known nuclei filtered by the lambda function
_selection | lambda function to filter the list of nuclei to be returned |
Example:
Definition at line 367 of file tkmanager.cpp.
|
inline |
return a vector containing all the known nuclei for a given a
Definition at line 121 of file tkmanager.h.
|
inline |
return a vector containing all the known nuclei for a given n
Definition at line 123 of file tkmanager.h.
|
inline |
return a vector containing all the known nuclei for a given z
Definition at line 119 of file tkmanager.h.
return a shared pointer to a nucleus from its name
Definition at line 126 of file tkmanager.h.
|
inline |
return a shared pointer to a nucleus from its z an a
Definition at line 128 of file tkmanager.h.
|
inline |
returns true if the level scheme has already been loaded
Definition at line 87 of file tkmanager.h.
|
inline |
is the element Z is known
Definition at line 99 of file tkmanager.h.
bool known_element | ( | tkstring | _nuc, |
int & | _z | ||
) |
is the element symbol is known (ex: "C")
Definition at line 375 of file tkmanager.cpp.
|
inline |
is the nucleus Z and A known
Definition at line 95 of file tkmanager.h.
|
inline |
is the nucleus symbol known (ex: "12C")
Definition at line 93 of file tkmanager.h.
void preload_level_schemes | ( | bool | _verbose = false | ) |
preload all the level schemes from the database
Definition at line 342 of file tkmanager.cpp.
|
inline |
define the max value of the attributed level ids
Definition at line 138 of file tkmanager.h.
|
inline |
define the max value of the attributed level ids
Definition at line 136 of file tkmanager.h.
|
static |
Definition at line 56 of file tkmanager.cpp.
|
friend |
Definition at line 56 of file tkmanager.h.