38 fdecay_level_from_id(_from_id),
39 fdecay_level_to_id(_to_id),
42 shared_ptr<tkmeasure> energy = make_shared<tkmeasure>(_struc.
value,_struc.
unit);
44 if(_struc.
err>0.) energy->set_error(_struc.
err);
47 energy->set_type(
tkstring::form(
"%s decay energy",decay_type_str.at(fdecay_type).data()));
48 add_property(
"energy",energy);
58 return get(
"energy")->get_value(_unit);
73 std::cout << std::setw(15) << left << fdecay_id << std::setw(15) << left <<
get_energy_meas()->get_value();
75 else std::cout <<
" " << std::setw(15) << left <<
" " << std::endl;
81 for(
auto &prop: fProperties) {
82 if(prop.first==
"energy")
continue;
83 if(prop.first==
"mult")
continue;
84 if(prop.second.type==
"TEXT") {
85 glog <<
", " << prop.second.value;
86 if(!prop.second.unit.is_empty()) cout <<
" " << prop.second.unit;
88 else glog <<
", " <<
get(prop.first).get();
91 glog <<
" uncertain decay tag: " << funcertain_decay;
94 glog <<
" final level: " << flevelto->get_spin_parity_str() <<
" (";
95 if(flevelto->is_energy_offset()) glog << flevelto->get_offset_bandhead()<<
"+";
96 auto save_precision = cout.precision();
97 glog << setprecision(flevelto->get_energy_measure()->get_exp_error_precision(flevelto->get_energy_measure()->get_value())) << flevelto->get_energy(
tkunit_manager::keV,
true) <<
" keV)";
98 cout.precision(save_precision);
115 shared_ptr<tkmeasure> RI = make_shared<tkmeasure>(_struc.
value,_struc.
unit);
118 if(_struc.
err>0.) RI->set_error(_struc.
err);
121 add_property(
"RI",RI);
128 auto new_RI = make_shared<tkmeasure>(_val,
"%");
129 new_RI->set(_val,
"%");
131 if(_unc>0.) new_RI->set_error(_unc);
132 new_RI->set_type(
"RI");
133 add_property(
"RI",new_RI);
137 if(_unc>0.) RI->set_error(_unc);
143 add_property_str(
"mult",_mul,
"");
148 shared_ptr<tkmeasure> MR = make_shared<tkmeasure>(_struc.
value,_struc.
unit);
151 if(_struc.
err>0.) MR->set_error(_struc.
err);
154 MR->set_type(
"mix ratio");
155 add_property(
"mix ratio",MR);
160 shared_ptr<tkmeasure> CC = make_shared<tkmeasure>(_struc.
value,_struc.
unit);
163 if(_struc.
err>0.) CC->set_error(_struc.
err);
165 CC->set_type(
"conv");
166 add_property(
"conv",CC);
173 shared_ptr<tkmeasure> B = make_shared<tkmeasure>(_struc.
value,_struc.
unit);
175 if(_struc.
err>0.) B->set_error(_struc.
err);
179 add_property(type,B);
192 return get(
"RI")->get_value();
205 return get(
"mix ratio")->get_value();
218 return get(
"conv")->get_value();
224 if(_elec) name +=
"E";
226 name += to_string(_L);
242 if(!meas)
return std::nan(
"1");
243 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
tkdecay(int _id, int _from_id, int _to_id, const tkdb_table::measure_data_struct &_struc, decay_type _type)
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