1#include "EvtGenBase/EvtPatches.hh"
14#include "EvtGenBase/EvtValError.hh"
19 : _valKnown(0), _val(0.), _errKnown(0), _err(0.)
23 : _valKnown(1), _val(val), _errKnown(0), _err(0.)
27 : _valKnown(1), _val(val), _errKnown(1), _err(err)
31 : _valKnown(other._valKnown), _val(other._val),
32 _errKnown(other._errKnown), _err(other._err)
40 assert(_valKnown && _errKnown);
41 return ( _val != 0) ? _err/_val : 0;
46 _valKnown = other._valKnown;
48 _errKnown = other._errKnown;
54 assert(_valKnown && other._valKnown);
57 if(_errKnown && other._errKnown)
58 _err = _val * other._val * sqrt(
prec()*
prec() + other.prec() * other.prec());
67 assert(_valKnown && other._valKnown && other._val != 0.);
70 if(_errKnown && other._errKnown)
71 _err = _val/other._val * sqrt(
prec()*
prec() + other.prec() * other.prec());
81 if(_valKnown) os << _val;
84 if(_errKnown) os << _err;
92 assert(_valKnown); assert(other._valKnown);
97 if(_errKnown && other._errKnown) {
99 _err = sqrt(_err*_err + other._err*other._err);
111 if(_errKnown) _err*=c;
EvtValError operator+(const EvtValError &x1, const EvtValError &x2)
EvtValError operator/(const EvtValError &x1, const EvtValError &x2)
ostream & operator<<(ostream &os, const EvtValError &other)
EvtValError operator*(const EvtValError &x1, const EvtValError &x2)
void operator=(const EvtValError &other)
void operator/=(const EvtValError &other)
void operator+=(const EvtValError &other)
void operator*=(const EvtValError &other)
void print(std::ostream &) const