TkN 2.5
Toolkit for Nuclei
Loading...
Searching...
No Matches
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 * Licensed under the MIT License <http://opensource.org/licenses/MIT>. *
11 * SPDX-License-Identifier: MIT *
12 ********************************************************************************/
13
14#ifndef tkdecay_H
15#define tkdecay_H
16
17#include "tkn_config.h"
18
19#ifdef HAS_ROOT
20#include "TClass.h"
21#endif
22
23#include <array>
24
25#include "tkdb_table.h"
26#include "tkproperty_list.h"
27#include "tkmeasure.h"
28
29namespace tkn {
30
31class tklevel;
32
48class tkdecay : public tkproperty_list {
49 friend class tkdataset;
50 friend class tklevel_scheme;
51
52public:
61 static array<tkstring, 6> decay_type_str;
62
63protected:
64 int fdecay_id;
65 int fdecay_level_from_id;
66 int fdecay_level_to_id;
67
68 decay_type fdecay_type = kundef;
69
70 tkstring funcertain_decay{};
71
72 tkstring fcomment;
73 bool fhas_comment = false;
74
75 shared_ptr<tklevel> flevelfrom = nullptr;
76 shared_ptr<tklevel> flevelto = nullptr;
77
78public:
79 tkdecay(int _id, int _from_id, int _to_id, const tkdb_table::measure_data_struct &_struc, decay_type _type);
80 virtual ~tkdecay() override = default;
81
83 shared_ptr<tkmeasure> get_energy_meas() const { return get("energy"); }
86
88 decay_type get_decay_type() { return fdecay_type; }
89
91 bool has_comment() const { return fhas_comment; }
93 const tkstring &get_comment() const { return fcomment; }
95 bool is_uncertain() const { return !funcertain_decay.is_empty(); }
96
98 shared_ptr<tklevel> get_level_from() { return flevelfrom; }
100 shared_ptr<tklevel> get_level_to() { return flevelto; }
101
103 void print(const tkstring &_option = "") const;
104
105protected:
107 int get_id() const { return fdecay_id; }
109 int get_level_from_id() { return fdecay_level_from_id; }
111 int get_level_to_id() { return fdecay_level_to_id; }
112
114 void set_levels(shared_ptr<tklevel> _lvlfrom, shared_ptr<tklevel> _lvlto)
115 {
116 flevelfrom = _lvlfrom;
117 flevelto = _lvlto;
118 }
119
121 void set_comment(const tkstring &_comment)
122 {
123 fcomment = _comment;
124 fhas_comment = true;
125 }
127 void set_uncertain_decay(const tkstring &_uncertain) { funcertain_decay = _uncertain; }
128
129#ifdef HAS_ROOT
131 ClassDefOverride(tkdecay, 0);
132#endif
133};
134
151class tkgammadecay : public tkdecay {
152
153 friend class tkdataset;
154 friend class tklevel_scheme;
155
156public:
157 tkgammadecay(int _id, int _from_id, int _to_id, const tkdb_table::measure_data_struct &_struc) : tkdecay(_id, _from_id, _to_id, _struc, kgamma) { ; }
158 virtual ~tkgammadecay() override = default;
159
161 shared_ptr<tkmeasure> get_relative_intensity_measure() { return get("RI"); }
163 double get_relative_intensity();
164
166 shared_ptr<tkmeasure> get_mixing_ratio_measure() { return get("mix ratio"); }
168 double get_mixing_ratio();
169
171 shared_ptr<tkmeasure> get_conv_coeff_measure() { return get("conv"); }
173 double get_conv_coeff();
174
176 shared_ptr<tkmeasure> get_trans_prob_measure(bool _elec, int _L, bool _WU);
178 double get_trans_prob(bool _elec, int _L, bool _WU);
179
182
185 void set_relative_intensity(double _val, double _unc);
186
189
191 void set_multipolarity(const tkstring &_mul);
192
195
198
199#ifdef HAS_ROOT
201 ClassDefOverride(tkgammadecay, 0);
202#endif
203};
204
205} // namespace tkn
206
207#endif
shared_ptr< tklevel > get_level_from()
get the parent level
Definition tkdecay.h:98
bool is_uncertain() const
check if the decay is uncertain
Definition tkdecay.h:95
shared_ptr< tklevel > get_level_to()
get the daughter level
Definition tkdecay.h:100
const tkstring & get_comment() const
get the level comment string
Definition tkdecay.h:93
void print(const tkstring &_option="") const
print the decay properties
Definition tkdecay.cpp:181
static array< tkstring, 6 > decay_type_str
Definition tkdecay.h:61
bool has_comment() const
check if a comment exists
Definition tkdecay.h:91
friend class tkdataset
Definition tkdecay.h:49
virtual ~tkdecay() override=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:168
shared_ptr< tkmeasure > get_energy_meas() const
returns the energy tkmeasure object
Definition tkdecay.h:83
decay_type get_decay_type()
get the decay type
Definition tkdecay.h:88
friend class tklevel_scheme
Definition tkdecay.h:50
tkdecay(int _id, int _from_id, int _to_id, const tkdb_table::measure_data_struct &_struc, decay_type _type)
Definition tkdecay.cpp:146
Represents a gamma-ray decay transition between two nuclear levels.
Definition tkdecay.h:151
void set_relative_intensity(tkdb_table::measure_data_struct &_struc)
set the relative intensity info
Definition tkdecay.cpp:269
tkstring get_multipolarity()
get the transition multipolarity
Definition tkdecay.h:181
tkgammadecay(int _id, int _from_id, int _to_id, const tkdb_table::measure_data_struct &_struc)
Definition tkdecay.h:157
shared_ptr< tkmeasure > get_conv_coeff_measure()
returns the gamma conversion coefficient tkmeasure object
Definition tkdecay.h:171
double get_trans_prob(bool _elec, int _L, bool _WU)
returns the gamma transition probability value (ex: BE2 in Weisskopf units, get_trans_prob(1,...
Definition tkdecay.cpp:415
void set_mixing_ratio(tkdb_table::measure_data_struct &_struc)
set the mixing ratio info
Definition tkdecay.cpp:301
double get_conv_coeff()
returns the gamma conversion coefficient value
Definition tkdecay.cpp:374
double get_mixing_ratio()
returns the gamma mixing ratio value
Definition tkdecay.cpp:361
double get_relative_intensity()
returns the gamma relative intensity (100% corresponds to the most intense gamma-ray)
Definition tkdecay.cpp:348
void set_multipolarity(const tkstring &_mul)
set the relative intensity info
Definition tkdecay.cpp:296
friend class tkdataset
Definition tkdecay.h:153
void set_transition_probability(tkdb_table::measure_data_struct &_struc)
set the transition probability
Definition tkdecay.cpp:326
shared_ptr< tkmeasure > get_relative_intensity_measure()
returns the gamma relative intensity tkmeasure object (100% corresponds to the most intense gamma-ray...
Definition tkdecay.h:161
virtual ~tkgammadecay() override=default
shared_ptr< tkmeasure > get_mixing_ratio_measure()
returns the gamma mixing ratio tkmeasure object
Definition tkdecay.h:166
friend class tklevel_scheme
Definition tkdecay.h:154
shared_ptr< tkmeasure > get_trans_prob_measure(bool _elec, int _L, bool _WU)
returns the gamma transition probability tkmeasure object (ex: BE2 in Weisskopf units,...
Definition tkdecay.cpp:395
void set_conv_coeff(tkdb_table::measure_data_struct &_struc)
set the conversion coeff
Definition tkdecay.cpp:315
Represents a nuclear excited level (or ground state).
Definition tklevel.h:43
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
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
Definition tkstring.h:32
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