56array<tkstring,6> tkdecay::decay_type_str = {
"undefined",
"beta",
"ec",
"alpha",
"particle",
"gamma"};
61 fdecay_level_from_id(_from_id),
62 fdecay_level_to_id(_to_id),
65 shared_ptr<tkmeasure> energy = make_shared<tkmeasure>(_struc.
value,_struc.
unit);
67 if(_struc.
err>0.) energy->set_error(_struc.
err);
71 add_property(
"energy",energy);
81 return get(
"energy")->get_value(_unit);
96 std::cout << std::setw(15) << left << fdecay_id << std::setw(15) << left <<
get_energy_meas()->get_value();
98 else std::cout <<
" " << std::setw(15) << left <<
" " << std::endl;
104 for(
auto &prop: fProperties) {
105 if(prop.first==
"energy")
continue;
106 if(prop.first==
"mult")
continue;
107 if(prop.second.type==
"TEXT") {
108 glog <<
", " << prop.second.value;
109 if(!prop.second.unit.is_empty()) cout <<
" " << prop.second.unit;
111 else glog <<
", " <<
get(prop.first).get();
114 glog <<
" uncertain decay tag: " << funcertain_decay;
117 glog <<
" final level: " << flevelto->get_spin_parity_str() <<
" (";
118 if(flevelto->is_energy_offset()) glog << flevelto->get_offset_bandhead()<<
"+";
119 auto save_precision = cout.precision();
120 glog << setprecision(flevelto->get_energy_measure()->get_exp_error_precision(flevelto->get_energy_measure()->get_value())) << flevelto->get_energy(
tkunit_manager::keV,
true) <<
" keV)";
121 cout.precision(save_precision);
138 shared_ptr<tkmeasure> RI = make_shared<tkmeasure>(_struc.
value,_struc.
unit);
141 if(_struc.
err>0.) RI->set_error(_struc.
err);
144 add_property(
"RI",RI);
151 shared_ptr<tkmeasure> RI = make_shared<tkmeasure>(_val,
"%");
154 if(_unc>0.) RI->set_error(_unc);
156 add_property(
"RI",RI);
160 if(_unc>0.) RI->set_error(_unc);
166 add_property_str(
"mult",_mul,
"");
171 shared_ptr<tkmeasure> MR = make_shared<tkmeasure>(_struc.
value,_struc.
unit);
174 if(_struc.
err>0.) MR->set_error(_struc.
err);
177 MR->set_type(
"mix ratio");
178 add_property(
"mix ratio",MR);
183 shared_ptr<tkmeasure> CC = make_shared<tkmeasure>(_struc.
value,_struc.
unit);
186 if(_struc.
err>0.) CC->set_error(_struc.
err);
188 CC->set_type(
"conv");
189 add_property(
"conv",CC);
196 shared_ptr<tkmeasure> B = make_shared<tkmeasure>(_struc.
value,_struc.
unit);
198 if(_struc.
err>0.) B->set_error(_struc.
err);
202 add_property(type,B);
215 return get(
"RI")->get_value();
228 return get(
"mix ratio")->get_value();
241 return get(
"conv")->get_value();
247 if(_elec) name +=
"E";
249 name += to_string(_L);
265 if(!meas)
return std::nan(
"1");
266 return meas->get_value();
Stores information on a nuclear decay.
bool is_uncertain() const
check if the decay is uncertain
const tkstring & get_comment() const
get the level comment string
void print(const tkstring &_option="") const
print the decay properties
static array< tkstring, 6 > decay_type_str
bool has_comment() const
check if a comment exists
double get_energy(const tkunit_manager::units_keys _unit=tkunit_manager::units_keys::keV)
returns the energy in keV by default
shared_ptr< tkmeasure > get_energy_meas() const
returns the energy tkmeasure object
void set_relative_intensity(tkdb_table::measure_data_struct &_struc)
set the relative intensity info
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,...
void set_mixing_ratio(tkdb_table::measure_data_struct &_struc)
set the mixing ratio info
double get_conv_coeff()
returns the gamma conversion coefficient value
double get_mixing_ratio()
returns the gamma mixing ratio value
double get_relative_intensity()
returns the gamma relative intensity (100% correspond the the more intence gamma-ray)
void set_multipolarity(const tkstring &_mul)
set the relative intensity info
void set_transition_probability(tkdb_table::measure_data_struct &_struc)
set the transition probability
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,...
void set_conv_coeff(tkdb_table::measure_data_struct &_struc)
set the conversion coeff
Contains list of properties.
bool has_property(const tkstring &_property) const
to check if the property is available
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....
tkstring copy() const
Returns a copy of this string.
static const char * form(const char *_format,...)
std::vector< tkstring > tokenize(const tkstring &_delim=" ") const
Create a vector of string separated by at least one delimiter.
bool contains(const char *_pat, ECaseCompare _cmp=kExact) const
tkstring & replace_all(const tkstring &_s1, const tkstring &_s2)
units_keys
units identifiers
tklog & do_endl(tklog &log)
tklog & comment(tklog &log)
data structure used to fill a tkmeasure object from the sqlite database