TkN 2.4
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
32
33 friend class tkmanager;
34
35protected:
36 static vector<int> fmagic_number_list;
37
38 int fZ{};
39 int fN{};
40 int fA{};
41
42 tkstring felement_symbol{};
43 tkstring felement_name{};
44 tkstring fSymbol{};
45
46 bool fis_known = false;
47 bool fis_stable = false;
48
49 tkspin_parity fspin_parity{};
50
51public:
53 tknucleus() : tkproperty_list("nucleus") {}
54 tknucleus(int _Z, int _A);
55 tknucleus(int _Z);
56 tknucleus(const char * _symbol);
57 virtual ~tknucleus() override = default;
58
60 const tkstring &get_element_symbol(){return felement_symbol;}
62 const tkstring &get_element_name(){return felement_name;}
63
65 int get_z(){return fZ;}
67 int get_n(){return fN;}
69 int get_a(){return fA;}
70
72 const tkstring &get_symbol(){return fSymbol;}
73
75 bool is_z_magic();
77 bool is_n_magic();
79 bool is_doubly_magic() {return is_z_magic() && is_n_magic();}
80
82 shared_ptr<tklevel_scheme> get_level_scheme();
83
85 shared_ptr<tkmeasure> get_radius_measure() {return get("radius");}
87 double get_radius() const;
88
90 shared_ptr<tkmeasure> get_magnetic_dipole_measure() {return get("magnetic_dipole");}
92 double get_magnetic_dipole();
93
95 shared_ptr<tkmeasure> get_electric_quadrupole_measure() {return get("electric_quadrupole");}
98
100 shared_ptr<tkmeasure> get_abundance_measure() {return get("abundance");}
102 double get_abundance() const;
103
105 shared_ptr<tkmeasure> get_mass_excess_measure() {return get("mass_excess");}
108
110 shared_ptr<tkmeasure> get_binding_energy_over_a_measure(){return get("binding_energy_overA");}
113
115 shared_ptr<tkmeasure> get_lifetime_measure() const {return get("lifetime");}
120
122 double get_fission_yield(tkstring _parent, bool _cumulative=false);
123
125 shared_ptr<tklevel> get_ground_state();
126
128 tkstring get_decay_mode_str() {return get_property("decay_modes");}
129
131 int get_discovery_year() {return get_property("isotope_year_discovered").atoi();}
132
134 vector<pair<tkstring, double>> get_decay_modes();
135
137 bool is_known() const {return fis_known;}
139 bool is_stable() const {return fis_stable;}
141 bool is_bound() const;
142
144 const tkspin_parity &get_spin_parity() {return fspin_parity;}
146 const tkstring &get_jpi() const {return fspin_parity.get_jpi_str();}
147
149 const vector<shared_ptr<tkmeasure>> get_xrays() {return get_data_properties("XRay*");}
150
152 void print() const;
153
154private:
155 void set_name(const char*_name);
156
157#ifdef HAS_ROOT
159 ClassDefOverride(tknucleus,0);
160#endif
161};
162}
163
164#endif
Manages the database loading and provides access to the physics properties.
Definition tkmanager.h:51
A nucleus made of Z protons and N neutrons.
Definition tknucleus.h:31
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:149
const tkstring & get_jpi() const
return the ground state spin and parity as a string
Definition tknucleus.h:146
int get_a()
return the mass number
Definition tknucleus.h:69
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:144
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:139
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:95
tknucleus()
default constructor
Definition tknucleus.h:53
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 chimical element
Definition tknucleus.h:62
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:65
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:85
int get_discovery_year()
return the discovery year
Definition tknucleus.h:131
shared_ptr< tkmeasure > get_mass_excess_measure()
return the mass excess tkmeasure object
Definition tknucleus.h:105
shared_ptr< tkmeasure > get_binding_energy_over_a_measure()
returns the binding energy tkmeasure object
Definition tknucleus.h:110
shared_ptr< tkmeasure > get_magnetic_dipole_measure()
return the magnetic dipole moment tkmeasure object
Definition tknucleus.h:90
shared_ptr< tkmeasure > get_abundance_measure()
return the abundance tkmeasure object
Definition tknucleus.h:100
bool is_known() const
test if the nucleus is known
Definition tknucleus.h:137
shared_ptr< tkmeasure > get_lifetime_measure() const
returns the lifetime tkmeasure object
Definition tknucleus.h:115
const tkstring & get_element_symbol()
return the symbol of the chimical element
Definition tknucleus.h:60
void print() const
print the main nucleus properties
const tkstring & get_symbol()
return the nucleus symbol
Definition tknucleus.h:72
bool is_doubly_magic()
return true in case of z and n are magic numbers
Definition tknucleus.h:79
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:128
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:33
bool is_bound() const
test if the nucleus is bound (positive binding energy)
int get_n()
return the neutron number
Definition tknucleus.h:67
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:31
int atoi() const
Converts a string to integer value.
Definition tkstring.cpp:152
units_keys
units identifiers
Definition tkunit.h:46
Definition tklog.cpp:16