53 fValue.set_value(_value, _unit);
54 fError.set_value(_err, _unit);
55 fErrorLow.set_unit(_unit);
56 fErrorHigh.set_unit(_unit);
61 fValue.set_value(_value, _unit);
62 fError.set_unit(_unit);
63 fErrorLow.set_value(_errlow, _unit);
64 fErrorHigh.set_value(_errhigh, _unit);
76 finfo_tag.remove_all(
";ERR=?");
80 finfo_tag.remove_all(
";ERR=CA");
84 finfo_tag.remove_all(
";ERR=AP");
88 finfo_tag.remove_all(
";ERR=SY");
92 finfo_tag.remove_all(
";VAL=()");
99 finfo_tag.remove_all(
";ERR=CONV");
106 fValue.set_value(_val);
112 fValue.set_value(_val,_unit);
118 if(fValue.get_unit_key() && gunits->get_type(fValue.get_unit_key()) != gunits->get_type(_unit) ) {
119 double value = fValue.get_value();
120 double value_low = value-fError.get_value();
121 if(fAsymError) value_low = value-fErrorLow.get_value();
122 double value_high = value+fError.get_value();
123 if(fAsymError) value_high = value+fErrorHigh.get_value();
125 if(!fValue.set_unit(_unit))
return false;
126 fErrorLow.set_value(value_low);
127 fErrorLow.set_unit(_unit);
128 value_low = fErrorLow.get_value();
130 fErrorHigh.set_value(value_high);
131 fErrorHigh.set_unit(_unit);
132 value_high = fErrorHigh.get_value();
134 if(value_low>value_high) {
135 double tmp = value_high;
136 value_high = value_low;
139 value_low = fValue.
get_value() - value_low;
140 value_high = value_high-fValue.
get_value();
141 if(value_low != value_high) {
144 fErrorHigh.set_value(value_high);
155 if(!fValue.set_unit(_unit))
return false;
156 fError.set_unit(_unit);
157 fErrorLow.set_unit(_unit);
158 fErrorHigh.set_unit(_unit);
177 glog <<
warning_o <<
"The measure contains assymetric errors, the return value is the largest one" <<
do_endl;
178 return std::max(fErrorLow.get_value(),fErrorHigh.get_value());
212 return fError.get_value();
214 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)