TkN 2.4
Toolkit for Nuclei
Loading...
Searching...
No Matches
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 * Licensed under the MIT License <http://opensource.org/licenses/MIT>. *
11 * SPDX-License-Identifier: MIT *
12 ********************************************************************************/
13
14#ifndef tklevel_H
15#define tklevel_H
16
17#include "tkn_config.h"
18
19#ifdef HAS_ROOT
20#include "TClass.h"
21#endif
22
23#include "tkdb_table.h"
24#include "tkproperty_list.h"
25#include "tkmeasure.h"
26#include "tkspin_parity.h"
27#include "tkdecay.h"
28
29namespace tkn {
30
31class tklevel: public tkproperty_list {
32 friend class tkdataset;
33 friend class tklevel_scheme;
34
35protected:
36
37 int flevel_id=-1;
38 tkstring fbelongs_to_nucleus="";
39
40 shared_ptr<tkspin_parity> fspin_parity;
41
42 bool fis_stable = false;
43 bool fis_isomer = false;
44 int fisomer_level = 0;
45
46 bool fisYrast_exact = false;
47 bool fisYrast_uncertain = false;
48
49 vector<shared_ptr<tkdecay>> fdecays_down;
50 vector<shared_ptr<tkdecay>> fdecays_up;
51
52 tkstring fcomment{};
53 bool fhas_comment=false;
54
55 tkstring funcertain_level{};
56
57 tkstring fenergy_offset = "";
58
59public:
60 tklevel(int _id, const tkdb_table::measure_data_struct &_struc);
61 virtual ~tklevel() override = default;
62
64 shared_ptr<tkmeasure> get_energy_measure() {return get("energy");}
66 double get_energy(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::keV, bool _with_offset=false);
67
69 bool is_energy_offset() {return (!fenergy_offset.is_empty());}
71 tkstring get_offset_bandhead(){return fenergy_offset;}
72
74 shared_ptr<tkmeasure> get_lifetime_measure() {return get("lifetime");}
79
81 shared_ptr<tkspin_parity> get_spin_parity() {return fspin_parity;}
83 const tkstring &get_spin_parity_str() {return fspin_parity->get_jpi_str();}
84
86 vector<shared_ptr<tkdecay>> get_decays_down() {return fdecays_down;}
88 vector<shared_ptr<tkdecay>> get_decays_up() {return fdecays_up;}
89
91 bool is_stable() {return fis_stable;}
93 bool is_isomer() {return fisomer_level;}
95 int get_isomer_level() {return fisomer_level;}
96
98 bool is_yrast(bool _with_tentative=false);
99
101 bool has_comment() {return fhas_comment;}
103 const tkstring &get_comment() {return fcomment;}
105 bool is_uncertain() {return !funcertain_level.is_empty();}
106
108 void print(const tkstring &_option="");
109
111 int get_id() {return flevel_id;}
112
114 void set_energy_offset(const tkstring &_offset) {fenergy_offset = _offset;}
115
119 void set_jpi(double _spin, int _parity, const tkstring &_jpi_str);
120
122 void add_decay_down(shared_ptr<tkdecay> _dec) {fdecays_down.push_back(_dec);}
124 void add_decay_up(shared_ptr<tkdecay> _dec) {fdecays_up.push_back(_dec);}
125
127 void set_comment(const tkstring &_comment) {fcomment = _comment; fhas_comment=true;}
129 void set_uncertain_level(const tkstring &_uncertain) {funcertain_level = _uncertain;}
130
131#ifdef HAS_ROOT
133 ClassDefOverride(tklevel,0);
134#endif
135};
136}
137
138#endif
Stores information on a nuclear level.
Definition tklevel.h:31
bool is_isomer()
returns true is the level an isomer
Definition tklevel.h:93
void add_decay_up(shared_ptr< tkdecay > _dec)
add a up decay to the level
Definition tklevel.h:124
bool is_stable()
returns true if the level stable
Definition tklevel.h:91
double get_lifetime(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::s)
returns the lifetime (in second by default)
Definition tklevel.cpp:196
int get_id()
get the level id
Definition tklevel.h:111
shared_ptr< tkmeasure > get_lifetime_measure()
returns the lifetime tkmeasure object
Definition tklevel.h:74
const tkstring & get_comment()
get the level comment string
Definition tklevel.h:103
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:171
tkstring get_offset_bandhead()
returns the bandhead string offset value (ex: X)
Definition tklevel.h:71
shared_ptr< tkmeasure > get_energy_measure()
returns the energy tkmeasure object
Definition tklevel.h:64
void set_jpi(double _spin, int _parity, const tkstring &_jpi_str)
define the spin parity
Definition tklevel.cpp:154
void set_energy_offset(const tkstring &_offset)
define the energy offset
Definition tklevel.h:114
void add_decay_down(shared_ptr< tkdecay > _dec)
add a down decay to the level
Definition tklevel.h:122
tklevel(int _id, const tkdb_table::measure_data_struct &_struc)
Definition tklevel.cpp:115
tkstring get_lifetime_str()
returns the lifetime in string (using the best adapted unit)
Definition tklevel.cpp:210
bool is_uncertain()
check if the level is uncertain
Definition tklevel.h:105
bool is_energy_offset()
to know if the energy is known with an energy offset
Definition tklevel.h:69
shared_ptr< tkspin_parity > get_spin_parity()
returns the spin parity shared pointer object
Definition tklevel.h:81
vector< shared_ptr< tkdecay > > get_decays_up()
return a vector of tkdecay containing the upward decays
Definition tklevel.h:88
virtual ~tklevel() override=default
void set_comment(const tkstring &_comment)
set the level comment string
Definition tklevel.h:127
friend class tkdataset
Definition tklevel.h:32
void print(const tkstring &_option="")
print the level properties
Definition tklevel.cpp:254
int get_isomer_level()
get the isomer level (1 for the ␌1rst (lowest energy) isomer, 2 for the second, etc....
Definition tklevel.h:95
bool is_yrast(bool _with_tentative=false)
returns true is the leve is Yrast
Definition tklevel.cpp:241
void set_uncertain_level(const tkstring &_uncertain)
set the level as uncertain
Definition tklevel.h:129
vector< shared_ptr< tkdecay > > get_decays_down()
return a vector of tkdecay containing of the downward decays
Definition tklevel.h:86
const tkstring & get_spin_parity_str()
returns the spin parity as as string
Definition tklevel.h:83
void set_lifetime(tkdb_table::measure_data_struct &_struc)
define the level lifetime
Definition tklevel.cpp:135
bool has_comment()
check if a comment exists
Definition tklevel.h:101
friend class tklevel_scheme
Definition tklevel.h:33
shared_ptr< tkmeasure > get(const tkstring &_property) const
get the property as tkmeasure
tkproperty_list(tkstring _name)
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
Definition tkstring.h:31
units_keys
units identifiers
Definition tkunit.h:46
Definition tklog.cpp:16
data structure used to fill a tkmeasure object from the sqlite database
Definition tkdb_table.h:49