TkN 2.1
Toolkit for Nuclei
tkdecay.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 tkdecay_H
38#define tkdecay_H
39
40#include "tkn_config.h"
41
42#ifdef HAS_ROOT
43#include "TClass.h"
44#endif
45
46#include <array>
47
48#include "tkdb_table.h"
49#include "tkproperty_list.h"
50#include "tkmeasure.h"
51
52namespace tkn {
53
54class tklevel;
55
56class tkdecay: public tkproperty_list {
57 friend class tkdataset;
58 friend class tklevel_scheme;
59
60public:
61
63 static array<tkstring,6> decay_type_str;
64
65protected:
66
67 int fdecay_id;
68 int fdecay_level_from_id;
69 int fdecay_level_to_id;
70
71 decay_type fdecay_type = kundef;
72
73 tkstring funcertain_decay{};
74
75 tkstring fcomment;
76 bool fhas_comment=false;
77
78 shared_ptr<tklevel> flevelfrom = nullptr;
79 shared_ptr<tklevel> flevelto = nullptr;
80
81public:
82 tkdecay(int _id, int _from_id, int _to_id, const tkdb_table::measure_data_struct &_struc, decay_type _type);
83 virtual ~tkdecay() = default;
84
86 shared_ptr<tkmeasure> get_energy_meas() const {return get("energy");}
88 double get_energy(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::keV);
89
91 decay_type get_decay_type() {return fdecay_type;}
92
94 bool has_comment() const {return fhas_comment;}
96 const tkstring &get_comment() const {return fcomment;}
98 bool is_uncertain() const {return !funcertain_decay.is_empty();}
99
101 shared_ptr<tklevel> get_level_from() {return flevelfrom;}
103 shared_ptr<tklevel> get_level_to() {return flevelto;}
104
106 void print(const tkstring &_option="") const;
107
108protected:
109
111 int get_id() const {return fdecay_id;}
113 int get_level_from_id() {return fdecay_level_from_id;}
115 int get_level_to_id() {return fdecay_level_to_id;}
116
118 void set_levels(shared_ptr<tklevel> _lvlfrom, shared_ptr<tklevel> _lvlto) {flevelfrom=_lvlfrom; flevelto=_lvlto;}
119
121 void set_comment(const tkstring &_comment) {fcomment = _comment; fhas_comment=true;}
123 void set_uncertain_decay(const tkstring &_uncertain) {funcertain_decay = _uncertain;}
124
125#ifdef HAS_ROOT
127 ClassDef(tkdecay,0);
128#endif
129};
130
131class tkgammadecay: public tkdecay {
132
133 friend class tkdataset;
134 friend class tklevel_scheme;
135
136public:
137 tkgammadecay(int _id, int _from_id, int _to_id, const tkdb_table::measure_data_struct &_struc) : tkdecay(_id,_from_id,_to_id,_struc, kgamma) {;}
138 virtual ~tkgammadecay() = default;
139
141 shared_ptr<tkmeasure> get_relative_intensity_measure() {return get("RI");}
143 double get_relative_intensity();
144
146 shared_ptr<tkmeasure> get_mixing_ratio_measure() {return get("mix ratio");}
148 double get_mixing_ratio();
149
151 shared_ptr<tkmeasure> get_conv_coeff_measure() {return get("conv");}
153 double get_conv_coeff();
154
156 shared_ptr<tkmeasure> get_trans_prob_measure(bool _elec, int _L, bool _WU);
158 double get_trans_prob(bool _elec, int _L, bool _WU);
159
162
165 void set_relative_intensity(double _val, double _unc);
166
169
171 void set_multipolarity(const tkstring &_mul);
172
175
178
179#ifdef HAS_ROOT
181 ClassDef(tkgammadecay,0);
182#endif
183};
184
185}
186
187#endif
Stores information on a specific dataset.
Stores information on a nuclear decay.
Definition: tkdecay.h:56
shared_ptr< tklevel > get_level_from()
get the parent level
Definition: tkdecay.h:101
bool is_uncertain() const
check if the decay is uncertain
Definition: tkdecay.h:98
shared_ptr< tklevel > get_level_to()
get the daughter level
Definition: tkdecay.h:103
const tkstring & get_comment() const
get the level comment string
Definition: tkdecay.h:96
void print(const tkstring &_option="") const
print the decay properties
Definition: tkdecay.cpp:92
static array< tkstring, 6 > decay_type_str
Definition: tkdecay.h:63
bool has_comment() const
check if a comment exists
Definition: tkdecay.h:94
virtual ~tkdecay()=default
double get_energy(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::keV)
returns the energy in keV by default
Definition: tkdecay.cpp:79
shared_ptr< tkmeasure > get_energy_meas() const
returns the energy tkmeasure object
Definition: tkdecay.h:86
decay_type get_decay_type()
get the decay type
Definition: tkdecay.h:91
tkdecay(int _id, int _from_id, int _to_id, const tkdb_table::measure_data_struct &_struc, decay_type _type)
Definition: tkdecay.cpp:58
Stores information on a gamma-ray decay.
Definition: tkdecay.h:131
void set_relative_intensity(tkdb_table::measure_data_struct &_struc)
set the relative intensity info
Definition: tkdecay.cpp:136
tkstring get_multipolarity()
get the transition multipolarity
Definition: tkdecay.h:161
tkgammadecay(int _id, int _from_id, int _to_id, const tkdb_table::measure_data_struct &_struc)
Definition: tkdecay.h:137
shared_ptr< tkmeasure > get_conv_coeff_measure()
returns the gamma conversion coefficient tkmeasure object
Definition: tkdecay.h:151
double get_trans_prob(bool _elec, int _L, bool _WU)
returns the gamma gamma transition probability value (ex: BE2 in Weiksopf units, get_trans_prob(1,...
Definition: tkdecay.cpp:262
virtual ~tkgammadecay()=default
void set_mixing_ratio(tkdb_table::measure_data_struct &_struc)
set the mixing ratio info
Definition: tkdecay.cpp:169
double get_conv_coeff()
returns the gamma conversion coefficient value
Definition: tkdecay.cpp:238
double get_mixing_ratio()
returns the gamma mixing ratio value
Definition: tkdecay.cpp:225
double get_relative_intensity()
returns the gamma relative intensity (100% correspond the the more intence gamma-ray)
Definition: tkdecay.cpp:212
void set_multipolarity(const tkstring &_mul)
set the relative intensity info
Definition: tkdecay.cpp:164
void set_transition_probability(tkdb_table::measure_data_struct &_struc)
set the transition probability
Definition: tkdecay.cpp:192
shared_ptr< tkmeasure > get_relative_intensity_measure()
returns the gamma relative intensity tkmeasure object (100% correspond the the more intence gamma-ray...
Definition: tkdecay.h:141
shared_ptr< tkmeasure > get_mixing_ratio_measure()
returns the gamma mixing ratio tkmeasure object
Definition: tkdecay.h:146
shared_ptr< tkmeasure > get_trans_prob_measure(bool _elec, int _L, bool _WU)
returns the gamma transition probability tkmeasure object (ex: BE2 in Weiksopf units,...
Definition: tkdecay.cpp:244
void set_conv_coeff(tkdb_table::measure_data_struct &_struc)
set the conversion coeff
Definition: tkdecay.cpp:181
Collection of levels and decay.
Contains list of properties.
shared_ptr< tkmeasure > get(const tkstring &_property) const
get the property as tkmeasure
tkstring get_property(const tkstring &_property) const
get the property value as a string
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