TkN 2.1
Toolkit for Nuclei
tknucleus.h
1/********************************************************************************
2 * Copyright (c) : Université de Lyon 1, CNRS/IN2P3, UMR5822, *
3 * IP2I, F-69622 Villeurbanne Cedex, France *
4 * Normandie Université, ENSICAEN, UNICAEN, CNRS/IN2P3, *
5 * LPC Caen, F-14000 Caen, France *
6 * Contibutor(s) : *
7 * Jérémie Dudouet jeremie.dudouet@cnrs.fr [2020] *
8 * Diego Gruyer diego.gruyer@cnrs.fr [2020] *
9 * *
10 * This software is governed by the CeCILL-B license under French law and *
11 * abiding by the rules of distribution of free software. You can use, *
12 * modify and/ or redistribute the software under the terms of the *
13 * CeCILL-B license as circulated by CEA, CNRS and INRIA at the following *
14 * URL \"http://www.cecill.info\". *
15 * *
16 * As a counterpart to the access to the source code and rights to copy, *
17 * modify and redistribute granted by the license, users are provided *
18 * only with a limited warranty and the software's author, the holder of *
19 * the economic rights, and the successive licensors have only limited *
20 * liability. *
21 * *
22 * In this respect, the user's attention is drawn to the risks associated *
23 * with loading, using, modifying and/or developing or reproducing the *
24 * software by the user in light of its specific status of free software, *
25 * that may mean that it is complicated to manipulate, and that also *
26 * therefore means that it is reserved for developers and experienced *
27 * professionals having in-depth computer knowledge. Users are therefore *
28 * encouraged to load and test the software's suitability as regards *
29 * their requirements in conditions enabling the security of their *
30 * systems and/or data to be ensured and, more generally, to use and *
31 * operate it in the same conditions as regards security. *
32 * *
33 * The fact that you are presently reading this means that you have had *
34 * knowledge of the CeCILL-B license and that you accept its terms. *
35 ********************************************************************************/
36
37#ifndef tknucleus_H
38#define tknucleus_H
39
40#include "tkn_config.h"
41
42#ifdef HAS_ROOT
43#include "TClass.h"
44#endif
45
46#include "tkproperty_list.h"
47#include "tklevel_scheme.h"
48#include "tkmeasure.h"
49
50namespace tkn {
51
52class tkmanager;
53
55
56 friend class tkmanager;
57
58protected:
59 static vector<int> fmagic_number_list;
60
61 int fZ{};
62 int fN{};
63 int fA{};
64
65 tkstring felement_symbol{};
66 tkstring felement_name{};
67 tkstring fSymbol{};
68
69 bool fis_known = false;
70 bool fis_stable = false;
71
72 tkspin_parity fspin_parity{};
73
74public:
76 tknucleus() : tkproperty_list("nucleus") {}
77 tknucleus(int _Z, int _A);
78 tknucleus(int _Z);
79 tknucleus(const char * _symbol);
80 virtual ~tknucleus() = default;
81
83 const tkstring &get_element_symbol(){return felement_symbol;}
85 const tkstring &get_element_name(){return felement_name;}
86
88 int get_z(){return fZ;}
90 int get_n(){return fN;}
92 int get_a(){return fA;}
93
95 const tkstring &get_symbol(){return fSymbol;}
96
98 bool is_z_magic();
100 bool is_n_magic();
102 bool is_doubly_magic() {return is_z_magic() && is_n_magic();}
103
105 shared_ptr<tklevel_scheme> get_level_scheme();
106
108 shared_ptr<tkmeasure> get_radius_measure() {return get("radius");}
110 double get_radius() const;
111
113 shared_ptr<tkmeasure> get_magnetic_dipole_measure() {return get("magnetic_dipole");}
115 double get_magnetic_dipole();
116
118 shared_ptr<tkmeasure> get_electric_quadrupole_measure() {return get("electric_quadrupole");}
121
123 shared_ptr<tkmeasure> get_abundance_measure() {return get("abundance");}
125 double get_abundance() const;
126
128 shared_ptr<tkmeasure> get_mass_excess_measure() {return get("mass_excess");}
130 double get_mass_excess(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::keV);
131
133 shared_ptr<tkmeasure> get_binding_energy_over_a_measure(){return get("binding_energy_overA");}
135 double get_binding_energy_over_a(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::MeV);
136
138 shared_ptr<tkmeasure> get_lifetime_measure() const {return get("lifetime");}
140 double get_lifetime(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::s);
143
145 double get_fission_yield(tkstring _parent, bool _cumulative=false);
146
148 shared_ptr<tklevel> get_ground_state();
149
151 tkstring get_decay_mode_str() {return get_property("decay_modes");}
152
154 int get_discovery_year() {return get_property("isotope_year_discovered").atoi();}
155
157 vector<pair<tkstring, double>> get_decay_modes();
158
160 bool is_known() const {return fis_known;}
162 bool is_stable() const {return fis_stable;}
164 bool is_bound() const;
165
167 const tkspin_parity &get_spin_parity() {return fspin_parity;}
169 const tkstring &get_jpi() const {return fspin_parity.get_jpi_str();}
170
172 const vector<shared_ptr<tkmeasure>> get_xrays() {return get_data_properties("XRay*");}
173
175 void print() const;
176
177private:
178 void set_name(const char*_name);
179
180#ifdef HAS_ROOT
182 ClassDef(tknucleus,0);
183#endif
184};
185}
186
187#endif
Manages the database loading and provides access to the physics properties.
Definition: tkmanager.h:55
A nucleus made of Z protons and N neutrons.
Definition: tknucleus.h:54
double get_mass_excess(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::keV)
return the mass excess in keV by default
Definition: tknucleus.cpp:205
const vector< shared_ptr< tkmeasure > > get_xrays()
returns the list of xrays
Definition: tknucleus.h:172
const tkstring & get_jpi() const
return the ground state spin and parity as a string
Definition: tknucleus.h:169
int get_a()
return the mass number
Definition: tknucleus.h:92
vector< pair< tkstring, double > > get_decay_modes()
return the decay modes as a vector of decay
Definition: tknucleus.cpp:318
double get_radius() const
returns the radius in fm
Definition: tknucleus.cpp:153
const tkspin_parity & get_spin_parity()
return the ground state spin and parity object
Definition: tknucleus.h:167
bool is_n_magic()
return true in case of n is a magic number
Definition: tknucleus.cpp:136
double get_lifetime(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::s)
returns the lifetime in second
Definition: tknucleus.cpp:239
bool is_stable() const
test if the nucleus is stable
Definition: tknucleus.h:162
double get_abundance() const
returns the natural abundance in percent
Definition: tknucleus.cpp:192
shared_ptr< tkmeasure > get_electric_quadrupole_measure()
return the electric quadrupole moment tkmeasure object
Definition: tknucleus.h:118
virtual ~tknucleus()=default
tknucleus()
default constructor
Definition: tknucleus.h:76
double get_fission_yield(tkstring _parent, bool _cumulative=false)
returns the fission yield of the current nucleus
Definition: tknucleus.cpp:264
tkstring get_lifetime_str()
returns the lifetime in string (using the best adapted unit)
Definition: tknucleus.cpp:275
const tkstring & get_element_name()
return the name of the chimical element
Definition: tknucleus.h:85
shared_ptr< tklevel > get_ground_state()
return the ground state level (nullptr if no GS known)
Definition: tknucleus.cpp:300
bool is_z_magic()
return true in case of z is a magic number
Definition: tknucleus.cpp:131
int get_z()
return the proton number
Definition: tknucleus.h:88
shared_ptr< tklevel_scheme > get_level_scheme()
return a tklevel_scheme shared pointer to the nucleus level scheme
Definition: tknucleus.cpp:141
double get_electric_quadrupole()
return the electric quadrupole moment in barn by default
Definition: tknucleus.cpp:179
shared_ptr< tkmeasure > get_radius_measure()
return the radius tkmeasure object
Definition: tknucleus.h:108
int get_discovery_year()
return the discovery year
Definition: tknucleus.h:154
shared_ptr< tkmeasure > get_mass_excess_measure()
return the mass excess tkmeasure object
Definition: tknucleus.h:128
shared_ptr< tkmeasure > get_binding_energy_over_a_measure()
returns the binding energy tkmeasure object
Definition: tknucleus.h:133
shared_ptr< tkmeasure > get_magnetic_dipole_measure()
return the magnetic dipole moment tkmeasure object
Definition: tknucleus.h:113
shared_ptr< tkmeasure > get_abundance_measure()
return the abundance tkmeasure object
Definition: tknucleus.h:123
bool is_known() const
test if the nucleus is known
Definition: tknucleus.h:160
shared_ptr< tkmeasure > get_lifetime_measure() const
returns the lifetime tkmeasure object
Definition: tknucleus.h:138
const tkstring & get_element_symbol()
return the symbol of the chimical element
Definition: tknucleus.h:83
void print() const
print the main nucleus properties
Definition: tknucleus.cpp:330
const tkstring & get_symbol()
return the nucleus symbol
Definition: tknucleus.h:95
bool is_doubly_magic()
return true in case of z and n are magic numbers
Definition: tknucleus.h:102
double get_magnetic_dipole()
return the magnetic dipole moment in mun by default
Definition: tknucleus.cpp:166
tkstring get_decay_mode_str()
return the decay modes as a string
Definition: tknucleus.h:151
double get_binding_energy_over_a(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::MeV)
returns the binding energy per mass unit in MeV
Definition: tknucleus.cpp:222
bool is_bound() const
test if the nucleus is bound (positive binding energy)
Definition: tknucleus.cpp:307
int get_n()
return the neutron number
Definition: tknucleus.h:90
Contains list of properties.
shared_ptr< tkmeasure > get(const tkstring &_property) const
get the property as tkmeasure
tkstring get_property(const tkstring &_property) const
get the property value as a string
vector< shared_ptr< tkmeasure > > get_data_properties(const tkstring &_opt="*")
get a vector of data properties according to a regular expression
Nuclear excited state spin-parity.
const tkstring & get_jpi_str() const
returns the spin and parity string
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
Definition: tkstring.h:54
int atoi() const
Converts a string to integer value.
Definition: tkstring.cpp:175
units_keys
units identifiers
Definition: tkunit.h:69
Definition: tklog.cpp:39