TkN 2.5
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; }
82
84 int get_z() { return fZ; }
86 int get_n() { return fN; }
88 int get_a() { return fA; }
89
91 const tkstring &get_symbol() { return fSymbol; }
92
94 bool is_z_magic();
96 bool is_n_magic();
98 bool is_doubly_magic() { return is_z_magic() && is_n_magic(); }
99
101 shared_ptr<tklevel_scheme> get_level_scheme();
102
104 shared_ptr<tkmeasure> get_radius_measure() { return get("radius"); }
106 double get_radius() const;
107
109 shared_ptr<tkmeasure> get_magnetic_dipole_measure() { return get("magnetic_dipole"); }
111 double get_magnetic_dipole();
112
114 shared_ptr<tkmeasure> get_electric_quadrupole_measure() { return get("electric_quadrupole"); }
117
119 shared_ptr<tkmeasure> get_abundance_measure() { return get("abundance"); }
121 double get_abundance() const;
122
124 shared_ptr<tkmeasure> get_mass_excess_measure() { return get("mass_excess"); }
127
129 shared_ptr<tkmeasure> get_binding_energy_over_a_measure() { return get("binding_energy_overA"); }
132
134 shared_ptr<tkmeasure> get_lifetime_measure() const { return get("lifetime"); }
139
141 double get_fission_yield(tkstring _parent, bool _cumulative = false);
142
144 shared_ptr<tklevel> get_ground_state();
145
147 tkstring get_decay_mode_str() { return get_property("decay_modes"); }
148
150 int get_discovery_year() { return get_property("isotope_year_discovered").atoi(); }
151
153 vector<pair<tkstring, double>> get_decay_modes();
154
156 bool is_known() const { return fis_known; }
158 bool is_stable() const { return fis_stable; }
160 bool is_bound() const;
161
163 const tkspin_parity &get_spin_parity() { return fspin_parity; }
165 const tkstring &get_jpi() const { return fspin_parity.get_jpi_str(); }
166
168 const vector<shared_ptr<tkmeasure>> get_xrays() { return get_data_properties("XRay*"); }
169
171 void print() const;
172
173private:
174 void set_name(const char *_name);
175
176#ifdef HAS_ROOT
178 ClassDefOverride(tknucleus, 0);
179#endif
180};
181} // namespace tkn
182
183#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
const vector< shared_ptr< tkmeasure > > get_xrays()
returns the list of xrays
Definition tknucleus.h:168
const tkstring & get_jpi() const
return the ground state spin and parity as a string
Definition tknucleus.h:165
int get_a()
return the mass number
Definition tknucleus.h:88
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
const tkspin_parity & get_spin_parity()
return the ground state spin and parity object
Definition tknucleus.h:163
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_stable() const
test if the nucleus is stable
Definition tknucleus.h:158
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:114
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
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:84
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:104
int get_discovery_year()
return the discovery year
Definition tknucleus.h:150
shared_ptr< tkmeasure > get_mass_excess_measure()
return the mass excess tkmeasure object
Definition tknucleus.h:124
shared_ptr< tkmeasure > get_binding_energy_over_a_measure()
returns the binding energy tkmeasure object
Definition tknucleus.h:129
shared_ptr< tkmeasure > get_magnetic_dipole_measure()
return the magnetic dipole moment tkmeasure object
Definition tknucleus.h:109
shared_ptr< tkmeasure > get_abundance_measure()
return the abundance tkmeasure object
Definition tknucleus.h:119
bool is_known() const
test if the nucleus is known
Definition tknucleus.h:156
shared_ptr< tkmeasure > get_lifetime_measure() const
returns the lifetime tkmeasure object
Definition tknucleus.h:134
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:91
bool is_doubly_magic()
return true in case of z and n are magic numbers
Definition tknucleus.h:98
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:147
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:86
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:32
int atoi() const
Converts a string to integer value.
Definition tkstring.cpp:196
units_keys
units identifiers
Definition tkunit.h:46
Definition tklog.cpp:16