![]() |
Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
A simple class to handle known isotopes (ZAI) and their basic properties (mass & decays). More...
#include <bayeux/materials/isotope.h>
Classes | |
| class | id |
| The identifier for an isotope based on its Z and A>=Z numbers. More... | |
| struct | record_type |
| Isotope record from AME table. More... | |
Public Types | |
| enum | build_flag_type { BF_MASS_DATA = datatools::bit_mask::bit00, BF_DECAY_DATA = datatools::bit_mask::bit01, BF_LOCK = datatools::bit_mask::bit31 } |
| Build flags. More... | |
| enum | ame_release_type { AME_RELEASE_2003 = 0, AME_RELEASE_2012 = 1 } |
| enum | isomeric_level_type { GROUND_STATE = 0, ISOMERIC_STATE = datatools::bit_mask::bit00, ISOMERIC_M = ISOMERIC_STATE, ISOMERIC_M1 = ISOMERIC_STATE | datatools::bit_mask::bit02, ISOMERIC_M2 = ISOMERIC_STATE | datatools::bit_mask::bit03, ISOMERIC_M3 = ISOMERIC_STATE | datatools::bit_mask::bit04, ISOMERIC_FISSION_STATE = datatools::bit_mask::bit01, ISOMERIC_F = ISOMERIC_FISSION_STATE, ISOMERIC_F1 = ISOMERIC_FISSION_STATE | datatools::bit_mask::bit02, ISOMERIC_F2 = ISOMERIC_FISSION_STATE | datatools::bit_mask::bit03, ISOMERIC_F3 = ISOMERIC_FISSION_STATE | datatools::bit_mask::bit04, ISOMERIC_INVALID = datatools::bit_mask::bit31 } |
| Isomeric level. More... | |
| typedef std::map< id, record_type > | isotope_dict_type |
| Dictionary of isotope records. More... | |
Public Types inherited from datatools::i_tree_dumpable | |
| enum | ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 } |
| Enumeration for standard output streams. More... | |
Public Member Functions | |
| isotope () | |
| Default Constructor. More... | |
| isotope (const std::string &name_) | |
| Constructor. More... | |
| isotope (const char *name_) | |
| Constructor. More... | |
| isotope (int z_, int a_, isomeric_level_type i_=GROUND_STATE, unsigned int build_flags_=0) | |
| Constructor. More... | |
| isotope (const std::string &ch_symbol_, int a_, isomeric_level_type i_=GROUND_STATE, unsigned int build_flags_=0) | |
| Constructor. More... | |
| isotope (const char *ch_symbol_, int a_, isomeric_level_type i_=GROUND_STATE, unsigned int build_flags_=0) | |
| Constructor. More... | |
| isotope (const std::string &name_, int z_, int a_, isomeric_level_type i_=GROUND_STATE, unsigned int build_flags_=0) | |
| Constructor. More... | |
| isotope (const char *name_, int z_, int a_, isomeric_level_type i_=GROUND_STATE, unsigned int build_flags_=0) | |
| Constructor. More... | |
| isotope (const std::string &name_, const std::string &ch_symbol_, int a_, isomeric_level_type i_=GROUND_STATE, unsigned int build_flags_=0) | |
| Constructor. More... | |
| isotope (const char *name_, const char *ch_symbol_, int a_, isomeric_level_type i_=GROUND_STATE, unsigned int build_flags_=0) | |
| Constructor. More... | |
| virtual | ~isotope () |
| Destructor. More... | |
| bool | is_valid () const |
| Return true if isotope is valid, false either. More... | |
| bool | find_mass_data () |
| Search & set the mass excess and mass from the tabulated isotopes. More... | |
| bool | find_decay_data () |
| Search & set the half-life from the tabulated isotopes. More... | |
| const std::string & | get_name () const |
| Return the name. More... | |
| const std::string & | get_chemical_symbol () const |
| Return the chemical symbol. More... | |
| std::string | get_zai_name () const |
| Return the zai name : 'ChA(I)'. More... | |
| int | get_z () const |
| Return Z (number of protons) More... | |
| int | get_a () const |
| Return A (number of nucleons) More... | |
| int | get_n () const |
| Return N (number of neutrons) More... | |
| id | get_id () const |
| Return the isotope Id. More... | |
| double | get_mass () const |
| Return the mass in unit of energy. More... | |
| isomeric_level_type | get_isomeric () const |
| Return the isomeric state. More... | |
| bool | is_ground_state () const |
| Check ground state. More... | |
| bool | is_known () const |
| Check if the isotope is known from tables. More... | |
| bool | has_atomic_mass_data () const |
| Return true if atomic mass data have been set properly, false either. More... | |
| bool | has_mass_excess_data () const |
| Return true if mass excess have been set properly, false either. More... | |
| double | get_mass_excess () const |
| Return the mass excess in unit of energy. More... | |
| double | get_err_mass_excess () const |
| Return the error on mass excess in unit of energy. More... | |
| double | get_atomic_mass () const |
| Return the atomic mass in unit of [u]. More... | |
| double | get_err_atomic_mass () const |
| Return the error on the atomic mass in unit of [u]. More... | |
| void | set_z (int z_) |
| Set the number of protons : More... | |
| void | set_a (int a_) |
| Set the number of nucleons : More... | |
| void | set_isomeric (isomeric_level_type i_) |
| Set the isomeric state : More... | |
| void | set_zai (int z_, int a_, isomeric_level_type i_=GROUND_STATE) |
| Set Z, A, I attributes. More... | |
| bool | has_mass () const |
| Check if the mass of the nucleus is defined. More... | |
| void | set_name (const std::string &name_) |
| Set the name. More... | |
| void | set_mass (double mass_) |
| Set the mass. More... | |
| void | set_mass_excess (double mass_excess_, double err_mass_excess_=0.0) |
| Set the mass excess and its error in explicit unit of energy. More... | |
| void | set_binding_energy_per_nucleon (double bea_, double err_bea_=0.0) |
| Set the binding energy per nucleon and its error in explicit unit of energy. More... | |
| void | set_atomic_mass (double mass_, double err_mass_=0.0) |
| Set the atomic mass and its error in implicit unit of [u]. More... | |
| void | set_half_life (double half_life_, double err_half_life_=0.0) |
| Set the decay data. More... | |
| bool | has_decay_data () const |
| Return true if decay data have been set properly, false either. More... | |
| bool | is_stable () const |
| Return true if isotope is stable, false either. More... | |
| double | get_half_life () const |
| Return the half-life in unit of time. More... | |
| double | get_err_half_life () const |
| Return the error on half-life in unit of time. More... | |
| datatools::properties & | grab_properties () |
| Give access to properties. More... | |
| const datatools::properties & | get_properties () const |
| Give access to properties. More... | |
| bool | is_locked () const |
| Return true if isotope is locked (i.e. fully set), false either. More... | |
| void | lock () |
| Lock the isotope. More... | |
| void | unlock () |
| Unlock the isotope. More... | |
| void | build (unsigned int flags_=0) |
| Load additional data in the isotope data structure. More... | |
| void | set_default_data () |
| Set data to default values. More... | |
| void | reset () |
| Reset. More... | |
| virtual void | tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const |
| Smart print. More... | |
Public Member Functions inherited from datatools::i_tree_dumpable | |
| i_tree_dumpable () | |
| Constructor. More... | |
| virtual | ~i_tree_dumpable () |
| Destructor. More... | |
| virtual void | print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const |
| Main new interface method for printing. More... | |
| void | print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const |
| Printing with jsonized options. More... | |
| void | print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const |
| Printing with jsonized options. More... | |
| void | tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const |
| void | tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const |
| void | smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const |
Static Public Member Functions | |
| static int | max_number_of_protons () |
| Maximum number of protons for an isotope (element 'Ei') More... | |
| static int | undefined_number_of_nucleons () |
| Undefined number of nucleons for an isotope. More... | |
| static int | max_number_of_nucleons () |
| Maximum number of nucleons for an isotope (element 'Ei') More... | |
| static void | print_table_of_isotopes (const isotope_dict_type &, std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) |
| Print a table of isotopes. More... | |
| static const isotope_dict_type & | table_of_isotopes () |
| Return the isotope database singleton. More... | |
| static bool | id_is_tabulated (const id &) |
| Check if the database knows a given isotope id. More... | |
| static void | load_ame_table (isotope::isotope_dict_type &, ame_release_type ame_release_=AME_RELEASE_2012) |
| Load a dictionary of isotope records from the AME (2003/2012) data file. More... | |
| static const record_type & | table_record_from_id (const id &) |
| Return the isotope record from the table. More... | |
| static std::string | isomeric_to_label (isomeric_level_type) |
| Return the label associated to an isomeric level. More... | |
| static isomeric_level_type | label_to_isomeric (const std::string &) |
| Return the isomeric level associated to a label. More... | |
| static double | compute_electron_binding_energy (int z_) |
| Compute the atomic electron binding energy for ion with given Z. More... | |
| static double | compute_nucleus_mass (int z_, int a_, double binding_energy_per_nucleon_) |
| Compute the mass of the nucleus from its Z, A and binding energy per nucleon (in unit of energy) More... | |
| static double | compute_nucleus_mass (int z_, double atomic_mass_) |
| Compute the mass of the nucleus from its Z and atomic mass (in unit of energy) More... | |
Static Public Member Functions inherited from datatools::i_tree_dumpable | |
| static const boost::property_tree::ptree & | empty_options () |
| static boost::property_tree::ptree | make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false) |
| static std::ostream & | last_skip_tag (std::ostream &out_) |
| static std::ostream & | skip_tag (std::ostream &out_) |
| static std::ostream & | last_tag (std::ostream &out_) |
| static std::ostream & | tag (std::ostream &out_) |
Protected Member Functions | |
| void | _set_defaults () |
| Set default attributes. More... | |
A simple class to handle known isotopes (ZAI) and their basic properties (mass & decays).
Isotope are built with a name and (Z, A, I) attributes :
We suppose we will only use known isotopes, thus it's should be not possible to create an unknow ZAI (except with default constructor) :
- For consistency, the 3 attributes (Z,A,I) cannot be initialized separately
- Tabulated value of (Z,A) are searched in data file ( 'resources/mass.mas12' by default )
- Note : Isomeric state (I) stay a 'free' parameter which is not checked for the moment
Isotope may have mass excess data [mass excess with its error] and/or mass data [mass with its error], which can be initialized with 'set_mass_excess', 'set_mass' or 'find_mass' methods.
Likewise, isotopes have decay data [stability flag, half-life with its error], initialized with 'set_half_life' or 'find_decay' methods.
Note : when the 'set_zai' method is invoked, all others attributes (mass excess, mass & decay) are reinitialized to their default values.
| typedef std::map<id, record_type> materials::isotope::isotope_dict_type |
Dictionary of isotope records.
Isomeric level.
| materials::isotope::isotope | ( | ) |
Default Constructor.
|
explicit |
Constructor.
| name_ | : ID name |
|
explicit |
Constructor.
| name_ | : ID name |
|
explicit |
Constructor.
| z_ | : Number of protons (0 <= Z <= 118) |
| a_ | : Number of nucleons (Z <= A <= 293) |
| i_ | : Isomeric state { 0 = ground state (default) ; 1 = first excited ; 2 = second excited ; 3 = third excited } |
| build_flags_ | : Flags to store additional data (mass, decay...) |
|
explicit |
Constructor.
| ch_symbol_ | : Chemical symbol ( "H " <= Ch <= "Ei") |
| a_ | : Number of nucleons (Z <= A <= 293) |
| i_ | : Isomeric state { 0 = ground state (default) ; 1 = first excited ; 2 = second excited ; 3 = third excited } |
| build_flags_ | : Flags to store additional data (mass, decay...) |
|
explicit |
Constructor.
| ch_symbol_ | : Chemical symbol ( "H " <= Ch <= "Ei") |
| a_ | : Number of nucleons (Z <= A <= 293) |
| i_ | : Isomeric state { 0 = ground state (default) ; 1 = first excited ; 2 = second excited ; 3 = third excited } |
| build_flags_ | : Flags to store additional data (mass, decay...) |
|
explicit |
Constructor.
| name_ | : ID name |
| z_ | : Number of protons (0 <= Z <= 118) |
| a_ | : Number of nucleons (Z <= A <= 293) |
| i_ | : Isomeric state { 0 = ground state (default) ; 1 = first excited ; 2 = second excited ; 3 = third excited } |
| build_flags_ | : Flags to fetch additional data |
|
explicit |
Constructor.
| name_ | : ID name |
| z_ | : Number of protons (0 <= Z <= 118) |
| a_ | : Number of nucleons (Z <= A <= 293) |
| i_ | : Isomeric state { 0 = ground state (default) ; 1 = first excited ; 2 = second excited ; 3 = third excited } |
| build_flags_ | : Flags to fetch additional data |
|
explicit |
Constructor.
| name_ | : ID name |
| ch_symbol_ | : Chemical symbol ( "H " <= Ch <= "Ei") |
| a_ | : Number of nucleons (Z <= A <= 293) |
| i_ | : Isomeric state { 0 = ground state (default); 1 = first excited ; 2 = second excited ; 3 = third excited } |
| build_flags_ | : Flags to fetch additional data |
|
explicit |
Constructor.
| name_ | : ID name |
| ch_symbol_ | : Chemical symbol ( "H " <= Ch <= "Ei") |
| a_ | : Number of nucleons (Z <= A <= 293) |
| i_ | : Isomeric state { 0 = ground state (default); 1 = first excited ; 2 = second excited ; 3 = third excited } |
| build_flags_ | : Flags to fetch additional data |
|
virtual |
Destructor.
|
protected |
Set default attributes.
| void materials::isotope::build | ( | unsigned int | flags_ = 0 | ) |
Load additional data in the isotope data structure.
|
static |
Compute the atomic electron binding energy for ion with given Z.
|
static |
Compute the mass of the nucleus from its Z, A and binding energy per nucleon (in unit of energy)
|
static |
Compute the mass of the nucleus from its Z and atomic mass (in unit of energy)
| bool materials::isotope::find_decay_data | ( | ) |
Search & set the half-life from the tabulated isotopes.
| bool materials::isotope::find_mass_data | ( | ) |
Search & set the mass excess and mass from the tabulated isotopes.
| int materials::isotope::get_a | ( | ) | const |
Return A (number of nucleons)
| double materials::isotope::get_atomic_mass | ( | ) | const |
Return the atomic mass in unit of [u].
| const std::string& materials::isotope::get_chemical_symbol | ( | ) | const |
Return the chemical symbol.
| double materials::isotope::get_err_atomic_mass | ( | ) | const |
Return the error on the atomic mass in unit of [u].
| double materials::isotope::get_err_half_life | ( | ) | const |
Return the error on half-life in unit of time.
| double materials::isotope::get_err_mass_excess | ( | ) | const |
Return the error on mass excess in unit of energy.
| double materials::isotope::get_half_life | ( | ) | const |
Return the half-life in unit of time.
| id materials::isotope::get_id | ( | ) | const |
Return the isotope Id.
| isomeric_level_type materials::isotope::get_isomeric | ( | ) | const |
Return the isomeric state.
| double materials::isotope::get_mass | ( | ) | const |
Return the mass in unit of energy.
| double materials::isotope::get_mass_excess | ( | ) | const |
Return the mass excess in unit of energy.
| int materials::isotope::get_n | ( | ) | const |
Return N (number of neutrons)
| const std::string& materials::isotope::get_name | ( | ) | const |
Return the name.
| const datatools::properties& materials::isotope::get_properties | ( | ) | const |
Give access to properties.
| int materials::isotope::get_z | ( | ) | const |
Return Z (number of protons)
| std::string materials::isotope::get_zai_name | ( | ) | const |
Return the zai name : 'ChA(I)'.
| datatools::properties& materials::isotope::grab_properties | ( | ) |
Give access to properties.
| bool materials::isotope::has_atomic_mass_data | ( | ) | const |
Return true if atomic mass data have been set properly, false either.
| bool materials::isotope::has_decay_data | ( | ) | const |
Return true if decay data have been set properly, false either.
| bool materials::isotope::has_mass | ( | ) | const |
Check if the mass of the nucleus is defined.
| bool materials::isotope::has_mass_excess_data | ( | ) | const |
Return true if mass excess have been set properly, false either.
|
static |
Check if the database knows a given isotope id.
| bool materials::isotope::is_ground_state | ( | ) | const |
Check ground state.
| bool materials::isotope::is_known | ( | ) | const |
Check if the isotope is known from tables.
| bool materials::isotope::is_locked | ( | ) | const |
Return true if isotope is locked (i.e. fully set), false either.
| bool materials::isotope::is_stable | ( | ) | const |
Return true if isotope is stable, false either.
| bool materials::isotope::is_valid | ( | ) | const |
Return true if isotope is valid, false either.
|
static |
Return the label associated to an isomeric level.
|
static |
Return the isomeric level associated to a label.
|
static |
Load a dictionary of isotope records from the AME (2003/2012) data file.
| void materials::isotope::lock | ( | ) |
Lock the isotope.
|
static |
Maximum number of nucleons for an isotope (element 'Ei')
|
static |
Maximum number of protons for an isotope (element 'Ei')
|
static |
Print a table of isotopes.
| void materials::isotope::reset | ( | ) |
Reset.
| void materials::isotope::set_a | ( | int | a_ | ) |
Set the number of nucleons :
| a_ | : 0 < A <= 293 |
| void materials::isotope::set_atomic_mass | ( | double | mass_, |
| double | err_mass_ = 0.0 |
||
| ) |
Set the atomic mass and its error in implicit unit of [u].
| mass_ | : Atomic mass in implicit unit of [u] |
| err_mass_ | : Atomic mass error in implicit unit of [u] |
| void materials::isotope::set_binding_energy_per_nucleon | ( | double | bea_, |
| double | err_bea_ = 0.0 |
||
| ) |
Set the binding energy per nucleon and its error in explicit unit of energy.
| bea_ | : Binding energy per nucleon |
| err_bea_ | : Binding energy per nucleon error |
| void materials::isotope::set_default_data | ( | ) |
Set data to default values.
| void materials::isotope::set_half_life | ( | double | half_life_, |
| double | err_half_life_ = 0.0 |
||
| ) |
Set the decay data.
| half_life_ | : Half-life in explicit unit of time |
| err_half_life_ | : Half-life error in explicit unit of time |
| void materials::isotope::set_isomeric | ( | isomeric_level_type | i_ | ) |
Set the isomeric state :
| i_ | : isomeric state |
| void materials::isotope::set_mass | ( | double | mass_ | ) |
Set the mass.
| mass_ | : Mass of the nucleus |
| void materials::isotope::set_mass_excess | ( | double | mass_excess_, |
| double | err_mass_excess_ = 0.0 |
||
| ) |
Set the mass excess and its error in explicit unit of energy.
| mass_excess_ | : Mass excess |
| err_mass_excess_ | : Mass excess error |
| void materials::isotope::set_name | ( | const std::string & | name_ | ) |
Set the name.
| name_ | : user name of the isotope |
| void materials::isotope::set_z | ( | int | z_ | ) |
Set the number of protons :
| z_ | : 0 < Z <= 119 (check if exist) |
| void materials::isotope::set_zai | ( | int | z_, |
| int | a_, | ||
| isomeric_level_type | i_ = GROUND_STATE |
||
| ) |
Set Z, A, I attributes.
| z_ | : Number of protons (0 <= Z <= 119) |
| a_ | : Number of nucleons (Z <= A <= 293) |
| i_ | : Isomeric state { 0 = ground state (default); 1 = first excited ; 2 = second excited ; 3 = third excited } |
|
static |
Return the isotope database singleton.
|
static |
Return the isotope record from the table.
|
virtual |
Smart print.
Reimplemented from datatools::i_tree_dumpable.
|
static |
Undefined number of nucleons for an isotope.
| void materials::isotope::unlock | ( | ) |
Unlock the isotope.
1.8.15