30 fValue.set_value(_value, _unit);
31 fError.set_value(_err, _unit);
32 fErrorLow.set_unit(_unit);
33 fErrorHigh.set_unit(_unit);
38 fValue.set_value(_value, _unit);
39 fError.set_unit(_unit);
40 fErrorLow.set_value(_errlow, _unit);
41 fErrorHigh.set_value(_errhigh, _unit);
53 finfo_tag.remove_all(
";ERR=?");
57 finfo_tag.remove_all(
";ERR=CA");
61 finfo_tag.remove_all(
";ERR=AP");
65 finfo_tag.remove_all(
";ERR=SY");
69 finfo_tag.remove_all(
";VAL=()");
76 finfo_tag.remove_all(
";ERR=CONV");
83 fValue.set_value(_val);
89 fValue.set_value(_val,_unit);
95 if(fValue.get_unit_key() && gunits->get_type(fValue.get_unit_key()) != gunits->get_type(_unit) ) {
96 double value = fValue.get_value();
97 double value_low = value-fError.get_value();
98 if(fAsymError) value_low = value-fErrorLow.get_value();
99 double value_high = value+fError.get_value();
100 if(fAsymError) value_high = value+fErrorHigh.get_value();
102 if(!fValue.set_unit(_unit))
return false;
103 fErrorLow.set_value(value_low);
104 fErrorLow.set_unit(_unit);
105 value_low = fErrorLow.get_value();
107 fErrorHigh.set_value(value_high);
108 fErrorHigh.set_unit(_unit);
109 value_high = fErrorHigh.get_value();
111 if(value_low>value_high) {
112 double tmp = value_high;
113 value_high = value_low;
116 value_low = fValue.
get_value() - value_low;
117 value_high = value_high-fValue.
get_value();
118 if(value_low != value_high) {
121 fErrorHigh.set_value(value_high);
132 if(!fValue.set_unit(_unit))
return false;
133 fError.set_unit(_unit);
134 fErrorLow.set_unit(_unit);
135 fErrorHigh.set_unit(_unit);
154 glog <<
warning_o <<
"The measure contains assymetric errors, the return value is the largest one" <<
do_endl;
155 return std::max(fErrorLow.get_value(),fErrorHigh.get_value());
189 return fError.get_value();
191 return fErrorHigh.get_value();
Stores information on an experimental measure.
double get_error() const
returns the error on the measured value
double get_error_high() const
returns the high assymetric error on the measured value
tkunit_manager::units_keys get_unit_key() const
returns the unit key
double get_value() const
returns the measure value
bool set_unit(const tkstring &_unit_name)
set the measured data unit (value and errors)
double get_error_low() const
returns the low assymetric error on the measured value
void set(const double &_val, const tkstring &_unit="")
set the measured value and unit. No given units keeps the current one
void set_info_tag(const tkstring &_tag)
define the info tag (calculation, systematic, approx value...)
void set_info(tkproperty::data_info _info)
to set some information about this data
void set_converted(bool _val=true)
to define the value as a converted one
std::string with usefull tricks from TString (ROOT) and KVString (KaliVeda) and more....
bool contains(const char *_pat, ECaseCompare _cmp=kExact) const
units_keys
units identifiers
double get_value() const
get the value in the current unit
void set_value(const double &_val, const tkstring &_unit="")
set the value and unit from string, if _unit not defined, let in the current unit
tklog & warning_o(tklog &log)
tklog & do_endl(tklog &log)