![]() |
Particles and Nuclei Sub-Library: Version 0.910
|
Nuclear mass info.
#include <nuclear_mass.h>
Definition at line 38 of file nuclear_mass.h.
Public Member Functions | |
int | parse_elstring (std::string ela, int &Z, int &N, int &A) |
Parse a string representing an element. | |
int | eltoZ (std::string el) |
Return Z given the element name. | |
std::string | Ztoel (size_t Z) |
Return the element name given Z. | |
std::string | tostring (size_t Z, size_t N) |
Return a string of the form "Pb208" for a given Z and N. | |
Protected Types | |
typedef std::map< std::string, int, string_comp >::iterator | table_it |
A convenient typedef for an iterator for element_table. | |
Protected Attributes | |
std::map< std::string, int, string_comp > | element_table |
A map containing the proton numbers organized by element name. | |
std::string | element_list [nelements] |
The list of elements organized by proton number. | |
Static Protected Attributes | |
static const int | nelements = 119 |
The number of elements (proton number) |
int nuclear_mass_info::parse_elstring | ( | std::string | ela, |
int & | Z, | ||
int & | N, | ||
int & | A | ||
) |
Accepts strings of one of the following forms:
Pb208
pb208
Pb 208
Pb-208
pb 208
pb-208
or one of the special strings n
, p
, d
or t
for the neutron, proton, deuteron, and triton, respectively. This function also allows the value of A to precede the element symbol.n4
is interpreted incorrectly as Nitrogen-4, rather than the tetraneutron.int nuclear_mass_info::eltoZ | ( | std::string | el | ) |
If the string parameter el
is invalid, the error handler is called and the value -1 is returned.
std::string nuclear_mass_info::Ztoel | ( | size_t | Z | ) |
"n"
indicating the neutron for Z=0, and if the argument Z
is greater than 118, an empty string is returned after calling the error handler. std::string nuclear_mass_info::tostring | ( | size_t | Z, |
size_t | N | ||
) |
Note that if Z
is zero, then and 'n'
is used to indicate the a nucleus composed entirely of neutrons and if the argument Z
is greater than 118, an empty string is returned (independ.
Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).