TkN 2.1
Toolkit for Nuclei
tklevel.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 tklevel_H
38#define tklevel_H
39
40#include "tkn_config.h"
41
42#ifdef HAS_ROOT
43#include "TClass.h"
44#endif
45
46#include "tkdb_table.h"
47#include "tkproperty_list.h"
48#include "tkmeasure.h"
49#include "tkspin_parity.h"
50#include "tkdecay.h"
51
52namespace tkn {
53
54class tklevel: public tkproperty_list {
55 friend class tkdataset;
56 friend class tklevel_scheme;
57
58protected:
59
60 int flevel_id=-1;
61 tkstring fbelongs_to_nucleus="";
62
63 shared_ptr<tkspin_parity> fspin_parity;
64
65 bool fis_stable = false;
66 bool fis_isomer = false;
67 int fisomer_level = 0;
68
69 bool fisYrast_exact = false;
70 bool fisYrast_uncertain = false;
71
72 vector<shared_ptr<tkdecay>> fdecays_down;
73 vector<shared_ptr<tkdecay>> fdecays_up;
74
75 tkstring fcomment{};
76 bool fhas_comment=false;
77
78 tkstring funcertain_level{};
79
80 tkstring fenergy_offset = "";
81
82public:
83 tklevel(int _id, const tkdb_table::measure_data_struct &_struc);
84 virtual ~tklevel() = default;
85
87 shared_ptr<tkmeasure> get_energy_measure() {return get("energy");}
89 double get_energy(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::keV, bool _with_offset=false);
90
92 bool is_energy_offset() {return (!fenergy_offset.is_empty());}
94 tkstring get_offset_bandhead(){return fenergy_offset;}
95
97 shared_ptr<tkmeasure> get_lifetime_measure() {return get("lifetime");}
99 double get_lifetime(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::s);
102
104 shared_ptr<tkspin_parity> get_spin_parity() {return fspin_parity;}
106 const tkstring &get_spin_parity_str() {return fspin_parity->get_jpi_str();}
107
109 vector<shared_ptr<tkdecay>> get_decays_down() {return fdecays_down;}
111 vector<shared_ptr<tkdecay>> get_decays_up() {return fdecays_up;}
112
114 bool is_stable() {return fis_stable;}
116 bool is_isomer() {return fisomer_level;}
118 int get_isomer_level() {return fisomer_level;}
119
121 bool is_yrast(bool _with_tentative=false);
122
124 bool has_comment() {return fhas_comment;}
126 const tkstring &get_comment() {return fcomment;}
128 bool is_uncertain() {return !funcertain_level.is_empty();}
129
131 void print(const tkstring &_option="");
132
134 int get_id() {return flevel_id;}
135
137 void set_energy_offset(tkstring &_offset) {fenergy_offset = _offset;}
138
142 void set_jpi(double _spin, int _parity, const tkstring &_jpi_str);
143
145 void add_decay_down(shared_ptr<tkdecay> _dec) {fdecays_down.push_back(_dec);}
147 void add_decay_up(shared_ptr<tkdecay> _dec) {fdecays_up.push_back(_dec);}
148
150 void set_comment(const tkstring &_comment) {fcomment = _comment; fhas_comment=true;}
152 void set_uncertain_level(const tkstring &_uncertain) {funcertain_level = _uncertain;}
153
154#ifdef HAS_ROOT
156 ClassDef(tklevel,0);
157#endif
158};
159}
160
161#endif
Stores information on a specific dataset.
Collection of levels and decay.
Stores information on a nuclear level.
Definition: tklevel.h:54
bool is_isomer()
returns true is the level an isomer
Definition: tklevel.h:116
void add_decay_up(shared_ptr< tkdecay > _dec)
add a up decay to the level
Definition: tklevel.h:147
bool is_stable()
returns true if the level stable
Definition: tklevel.h:114
double get_lifetime(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::s)
returns the lifetime (in second by default)
Definition: tklevel.cpp:136
int get_id()
get the level id
Definition: tklevel.h:134
shared_ptr< tkmeasure > get_lifetime_measure()
returns the lifetime tkmeasure object
Definition: tklevel.h:97
const tkstring & get_comment()
get the level comment string
Definition: tklevel.h:126
double get_energy(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::keV, bool _with_offset=false)
returns the energy in keV by default
Definition: tklevel.cpp:111
tkstring get_offset_bandhead()
returns the bandhead string offset value (ex: X)
Definition: tklevel.h:94
shared_ptr< tkmeasure > get_energy_measure()
returns the energy tkmeasure object
Definition: tklevel.h:87
void set_jpi(double _spin, int _parity, const tkstring &_jpi_str)
define the spin parity
Definition: tklevel.cpp:94
void add_decay_down(shared_ptr< tkdecay > _dec)
add a down decay to the level
Definition: tklevel.h:145
tklevel(int _id, const tkdb_table::measure_data_struct &_struc)
Definition: tklevel.cpp:55
tkstring get_lifetime_str()
returns the lifetime in string (using the best adapted unit)
Definition: tklevel.cpp:150
bool is_uncertain()
check if the level is uncertain
Definition: tklevel.h:128
bool is_energy_offset()
to know if the energy is known with an energy offset
Definition: tklevel.h:92
shared_ptr< tkspin_parity > get_spin_parity()
returns the spin parity shared pointer object
Definition: tklevel.h:104
vector< shared_ptr< tkdecay > > get_decays_up()
return a vector of tkdecay containing the upward decays
Definition: tklevel.h:111
void set_comment(const tkstring &_comment)
set the level comment string
Definition: tklevel.h:150
void print(const tkstring &_option="")
print the level properties
Definition: tklevel.cpp:194
int get_isomer_level()
get the isomer level (1 for the 1rst (lowest energy) isomer, 2 for the second, etc....
Definition: tklevel.h:118
bool is_yrast(bool _with_tentative=false)
returns true is the leve is Yrast
Definition: tklevel.cpp:181
void set_uncertain_level(const tkstring &_uncertain)
set the level as uncertain
Definition: tklevel.h:152
vector< shared_ptr< tkdecay > > get_decays_down()
return a vector of tkdecay containing of the downward decays
Definition: tklevel.h:109
const tkstring & get_spin_parity_str()
returns the spin parity as as string
Definition: tklevel.h:106
void set_energy_offset(tkstring &_offset)
define the energy offset
Definition: tklevel.h:137
void set_lifetime(tkdb_table::measure_data_struct &_struc)
define the level lifetime
Definition: tklevel.cpp:75
bool has_comment()
check if a comment exists
Definition: tklevel.h:124
virtual ~tklevel()=default
Contains list of properties.
shared_ptr< tkmeasure > get(const tkstring &_property) const
get the property as tkmeasure
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
Definition: tkstring.h:54
bool is_empty() const
Definition: tkstring.h:163
units_keys
units identifiers
Definition: tkunit.h:69
Definition: tklog.cpp:39
data structure used to fill a tkmeasure object from the sqlite database
Definition: tkdb_table.h:72