![]() |
TkN 2.5
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, builds the C++ structures in memory and makes 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 creates the corresponding nucleus millions of times.
It 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:
As seen previously with the levels and decays, we can also use a lambda expression to filter the list of nuclei, e.g. the carbon isotopes:
Some tools are also provided to easily loop on the Z or N known ranges:
Definition at line 50 of file tkmanager.h.
#include <tkmanager.h>
Public Member Functions | |
| tkmanager () | |
| virtual | ~tkmanager () |
| std::vector< tkn_drip_point > | get_drip_line (const std::string &_type, bool reduce_per_Z=true) |
| Get the drip line for a given type (optionally reduced per Z) | |
| const tkstring & | get_element_symbol (int _charge) |
| returns the element symbol for a given proton number | |
| const std::map< tkstring, shared_ptr< tknucleus > > & | get_map_of_nuclei () |
| return a map of nuclei sorted by name | |
| 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 std::map< int, std::vector< shared_ptr< tknucleus > > > & | get_map_of_nuclei_per_n () |
| return a map of nuclei vector sorted by n | |
| const std::map< int, std::vector< shared_ptr< tknucleus > > > & | get_map_of_nuclei_per_z () |
| return a map of nuclei vector sorted by z | |
| int | get_new_decay_id () |
| define a new unique decay id | |
| int | get_new_level_id () |
| define a new unique level id | |
| const vector< shared_ptr< tknucleus > > & | get_nuclei () |
| return a vector containing all the known nuclei | |
| 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 | |
| const vector< shared_ptr< tknucleus > > & | get_nuclei_for_a (int a) |
| return a vector containing all the known nuclei for a given a | |
| 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_for_z (int z) |
| return a vector containing all the known nuclei for a given z | |
| shared_ptr< tknucleus > | get_nucleus (const tkstring &_nuc) |
| return a shared pointer to a nucleus from its name | |
| shared_ptr< tknucleus > | get_nucleus (int _z, int _a) |
| return a shared pointer to a nucleus from its z an a | |
| bool | is_level_scheme_loaded (const tkstring &_nuc) |
| returns true if the level scheme has already been loaded | |
| 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") | |
| bool | known_nucleus (int _z, int _a) |
| is the nucleus Z and A known | |
| bool | known_nucleus (tkstring _nuc) |
| is the nucleus symbol known (ex: "12C") | |
| void | preload_level_schemes (bool _verbose=false) |
| preload all the level schemes from the database | |
| void | set_max_decay_id (int _id) |
| define the max value of the attributed level ids | |
| void | set_max_level_id (int _id) |
| define the max value of the attributed level ids | |
Static Public Member Functions | |
| static tkmanager * | the_data_manager () |
Friends | |
| class | tknucleus |
| tkmanager | ( | ) |
Definition at line 96 of file tkmanager.cpp.
|
virtual |
Definition at line 105 of file tkmanager.cpp.
| std::vector< tkn_drip_point > get_drip_line | ( | const std::string & | _type, |
| bool | reduce_per_Z = true ) |
Get the drip line for a given type (optionally reduced per Z)
Return drip-line data points for a given quantity type.
Loads data on-demand from the default JSON file if not already available.
| _type | Quantity type: "S1n", "S2n", "S1p", or "S2p". |
| reduce_per_Z | If true, keep at most one (Z,N) per Z: the entry with the minimal absolute value of value_mev. If false (default), return the full set for that type. |
Definition at line 551 of file tkmanager.cpp.
|
inline |
returns the element symbol for a given proton number
Definition at line 100 of file tkmanager.h.
return a map of nuclei sorted by name
Definition at line 109 of file tkmanager.h.
|
inline |
return a map of nuclei vector sorted by a
Definition at line 113 of file tkmanager.h.
|
inline |
return a map of nuclei vector sorted by n
Definition at line 115 of file tkmanager.h.
|
inline |
return a map of nuclei vector sorted by z
Definition at line 111 of file tkmanager.h.
| int get_new_decay_id | ( | ) |
define a new unique decay id
Definition at line 419 of file tkmanager.cpp.
| int get_new_level_id | ( | ) |
define a new unique level id
Definition at line 412 of file tkmanager.cpp.
|
inline |
return a vector containing all the known nuclei
Definition at line 106 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 392 of file tkmanager.cpp.
|
inline |
return a vector containing all the known nuclei for a given a
Definition at line 120 of file tkmanager.h.
|
inline |
return a vector containing all the known nuclei for a given n
Definition at line 122 of file tkmanager.h.
|
inline |
return a vector containing all the known nuclei for a given z
Definition at line 118 of file tkmanager.h.
return a shared pointer to a nucleus from its name
Definition at line 125 of file tkmanager.h.
|
inline |
return a shared pointer to a nucleus from its z an a
Definition at line 127 of file tkmanager.h.
|
inline |
returns true if the level scheme has already been loaded
Definition at line 86 of file tkmanager.h.
|
inline |
is the element Z is known
Definition at line 98 of file tkmanager.h.
| bool known_element | ( | tkstring | _nuc, |
| int & | _z ) |
is the element symbol is known (ex: "C")
Definition at line 400 of file tkmanager.cpp.
|
inline |
is the nucleus Z and A known
Definition at line 94 of file tkmanager.h.
|
inline |
is the nucleus symbol known (ex: "12C")
Definition at line 92 of file tkmanager.h.
| void preload_level_schemes | ( | bool | _verbose = false | ) |
preload all the level schemes from the database
Definition at line 367 of file tkmanager.cpp.
|
inline |
define the max value of the attributed level ids
Definition at line 137 of file tkmanager.h.
|
inline |
define the max value of the attributed level ids
Definition at line 135 of file tkmanager.h.
|
static |
Definition at line 83 of file tkmanager.cpp.
|
friend |
Definition at line 52 of file tkmanager.h.