TkN 2.7
Toolkit for Nuclei
Loading...
Searching...
No Matches
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 * Licensed under the MIT License <http://opensource.org/licenses/MIT>. *
11 * SPDX-License-Identifier: MIT *
12 ********************************************************************************/
13
14#ifndef tknucleus_H
15#define tknucleus_H
16
17#include "tkn_config.h"
18
19#ifdef HAS_ROOT
20#include "TClass.h"
21#endif
22
23#include "tkproperty_list.h"
24#include "tklevel_scheme.h"
25#include "tkmeasure.h"
26
27namespace tkn {
28
29class tkmanager;
30
50class tknucleus : public tkproperty_list {
51
52 friend class tkmanager;
53
54protected:
55 static vector<int> fmagic_number_list;
56
57 int fZ{};
58 int fN{};
59 int fA{};
60
61 tkstring felement_symbol{};
62 tkstring felement_name{};
63 tkstring fSymbol{};
64
65 bool fis_known = false;
66 bool fis_stable = false;
67
68 tkspin_parity fspin_parity{};
69
70public:
72 tknucleus() : tkproperty_list("nucleus") {}
73 tknucleus(int _Z, int _A);
74 tknucleus(int _Z);
75 tknucleus(const char *_symbol);
76 virtual ~tknucleus() override = default;
77
79 const tkstring &get_element_symbol() { return felement_symbol; }
81 const tkstring &get_element_name() { return felement_name; }
83 tkstring get_element_state() const { return get_property("state"); }
85 bool is_gas() const { return get_element_state() == "Gas"; }
87 bool is_liquid() const { return get_element_state() == "Liquid"; }
89 bool is_solid() const { return get_element_state() == "Solid"; }
90
92 int get_z() { return fZ; }
94 int get_n() { return fN; }
96 int get_a() { return fA; }
97
99 const tkstring &get_symbol() { return fSymbol; }
100
102 bool is_z_magic();
104 bool is_n_magic();
106 bool is_doubly_magic() { return is_z_magic() && is_n_magic(); }
107
109 shared_ptr<tklevel_scheme> get_level_scheme();
110
112 shared_ptr<tkmeasure> get_radius_measure() { return get("radius"); }
114 double get_radius() const;
115
117 shared_ptr<tkmeasure> get_magnetic_dipole_measure() { return get("magnetic_dipole"); }
119 double get_magnetic_dipole();
120
122 shared_ptr<tkmeasure> get_electric_quadrupole_measure() { return get("electric_quadrupole"); }
125
127 shared_ptr<tkmeasure> get_abundance_measure() { return get("abundance"); }
129 double get_abundance() const;
130
132 shared_ptr<tkmeasure> get_mass_excess_measure() { return get("mass_excess"); }
135
137 shared_ptr<tkmeasure> get_binding_energy_over_a_measure() { return get("binding_energy_overA"); }
140
142 shared_ptr<tkmeasure> get_lifetime_measure() const { return get("lifetime"); }
147
149 double get_fission_yield(tkstring _parent, bool _cumulative = false);
150
152 shared_ptr<tklevel> get_ground_state();
153
155 tkstring get_decay_mode_str() { return get_property("decay_modes"); }
156
158 int get_discovery_year() { return get_property("isotope_year_discovered").atoi(); }
159
161 vector<pair<tkstring, double>> get_decay_modes();
162
164 bool is_known() const { return fis_known; }
166 bool is_stable() const { return fis_stable; }
168 bool is_bound() const;
169
171 const tkspin_parity &get_spin_parity() const { return fspin_parity; }
173 const tkstring &get_jpi() const { return fspin_parity.get_jpi_str(); }
174
176 const vector<shared_ptr<tkmeasure>> get_xrays() { return get_data_properties("XRay*"); }
177
179 void print() const;
180
181private:
182 void set_name(const char *_name);
183
184#ifdef HAS_ROOT
186 ClassDefOverride(tknucleus, 0);
187#endif
188};
189} // namespace tkn
190
191#endif
Manages the database loading and provides access to the physics properties.
Definition tkmanager.h:51
Represents a nucleus and provides access to its properties.
Definition tknucleus.h:50
double get_mass_excess(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::keV)
return the mass excess in keV by default
bool is_liquid() const
return true only when the recorded standard state is Liquid
Definition tknucleus.h:87
const vector< shared_ptr< tkmeasure > > get_xrays()
returns the list of xrays
Definition tknucleus.h:176
const tkstring & get_jpi() const
return the ground state spin and parity as a string
Definition tknucleus.h:173
int get_a()
return the mass number
Definition tknucleus.h:96
vector< pair< tkstring, double > > get_decay_modes()
return the decay modes as a vector of decay
double get_radius() const
returns the radius in fm
bool is_solid() const
return true only when the recorded standard state is Solid
Definition tknucleus.h:89
bool is_n_magic()
return true in case of n is a magic number
double get_lifetime(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::s)
returns the lifetime in second
bool is_gas() const
return true only when the recorded standard state is Gas
Definition tknucleus.h:85
bool is_stable() const
test if the nucleus is stable
Definition tknucleus.h:166
double get_abundance() const
returns the natural abundance in percent
shared_ptr< tkmeasure > get_electric_quadrupole_measure()
return the electric quadrupole moment tkmeasure object
Definition tknucleus.h:122
tknucleus()
default constructor
Definition tknucleus.h:72
double get_fission_yield(tkstring _parent, bool _cumulative=false)
returns the fission yield of the current nucleus
tkstring get_lifetime_str()
returns the lifetime in string (using the best adapted unit)
const tkstring & get_element_name()
return the name of the chemical element
Definition tknucleus.h:81
virtual ~tknucleus() override=default
tkstring get_element_state() const
return the physical state at standard conditions, or an empty string if unavailable
Definition tknucleus.h:83
shared_ptr< tklevel > get_ground_state()
return the ground state level (nullptr if no GS known)
bool is_z_magic()
return true in case of z is a magic number
int get_z()
return the proton number
Definition tknucleus.h:92
shared_ptr< tklevel_scheme > get_level_scheme()
return a tklevel_scheme shared pointer to the nucleus level scheme
double get_electric_quadrupole()
return the electric quadrupole moment in barn by default
shared_ptr< tkmeasure > get_radius_measure()
return the radius tkmeasure object
Definition tknucleus.h:112
const tkspin_parity & get_spin_parity() const
return the ground state spin and parity object
Definition tknucleus.h:171
int get_discovery_year()
return the discovery year
Definition tknucleus.h:158
shared_ptr< tkmeasure > get_mass_excess_measure()
return the mass excess tkmeasure object
Definition tknucleus.h:132
shared_ptr< tkmeasure > get_binding_energy_over_a_measure()
returns the binding energy tkmeasure object
Definition tknucleus.h:137
shared_ptr< tkmeasure > get_magnetic_dipole_measure()
return the magnetic dipole moment tkmeasure object
Definition tknucleus.h:117
shared_ptr< tkmeasure > get_abundance_measure()
return the abundance tkmeasure object
Definition tknucleus.h:127
bool is_known() const
test if the nucleus is known
Definition tknucleus.h:164
shared_ptr< tkmeasure > get_lifetime_measure() const
returns the lifetime tkmeasure object
Definition tknucleus.h:142
const tkstring & get_element_symbol()
return the symbol of the chemical element
Definition tknucleus.h:79
void print() const
print the main nucleus properties
const tkstring & get_symbol()
return the nucleus symbol
Definition tknucleus.h:99
bool is_doubly_magic()
return true in case of z and n are magic numbers
Definition tknucleus.h:106
double get_magnetic_dipole()
return the magnetic dipole moment in mun by default
tkstring get_decay_mode_str()
return the decay modes as a string
Definition tknucleus.h:155
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
friend class tkmanager
Definition tknucleus.h:52
bool is_bound() const
test if the nucleus is bound (positive binding energy)
int get_n()
return the neutron number
Definition tknucleus.h:94
shared_ptr< tkmeasure > get(const tkstring &_property) const
get the property as tkmeasure
tkproperty_list(tkstring _name)
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.
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
Definition tkstring.h:33
int atoi() const
Converts a string to integer value.
Definition tkstring.cpp:210
units_keys
units identifiers
Definition tkunit.h:48
Definition tklog.cpp:16