BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtValError Class Reference

#include <EvtValError.hh>

Public Member Functions

 EvtValError ()
 
 EvtValError (double val)
 
 EvtValError (double val, double err)
 
 EvtValError (const EvtValError &other)
 
 ~EvtValError ()
 
int valueKnown () const
 
double value () const
 
int errorKnown () const
 
double error () const
 
double prec () const
 
void operator= (const EvtValError &other)
 
void operator*= (const EvtValError &other)
 
void operator/= (const EvtValError &other)
 
void operator+= (const EvtValError &other)
 
void operator*= (double c)
 
void print (std::ostream &) const
 
 EvtValError ()
 
 EvtValError (double val)
 
 EvtValError (double val, double err)
 
 EvtValError (const EvtValError &other)
 
 ~EvtValError ()
 
int valueKnown () const
 
double value () const
 
int errorKnown () const
 
double error () const
 
double prec () const
 
void operator= (const EvtValError &other)
 
void operator*= (const EvtValError &other)
 
void operator/= (const EvtValError &other)
 
void operator+= (const EvtValError &other)
 
void operator*= (double c)
 
void print (std::ostream &) const
 

Detailed Description

Constructor & Destructor Documentation

◆ EvtValError() [1/8]

EvtValError::EvtValError ( )

Definition at line 18 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.cc.

19 : _valKnown(0), _val(0.), _errKnown(0), _err(0.)
20{}

◆ EvtValError() [2/8]

EvtValError::EvtValError ( double  val)

Definition at line 22 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.cc.

23 : _valKnown(1), _val(val), _errKnown(0), _err(0.)
24{}

◆ EvtValError() [3/8]

EvtValError::EvtValError ( double  val,
double  err 
)

Definition at line 26 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.cc.

27 : _valKnown(1), _val(val), _errKnown(1), _err(err)
28{}

◆ EvtValError() [4/8]

EvtValError::EvtValError ( const EvtValError other)

Definition at line 30 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.cc.

31 : _valKnown(other._valKnown), _val(other._val),
32 _errKnown(other._errKnown), _err(other._err)
33{}

◆ ~EvtValError() [1/2]

EvtValError::~EvtValError ( )

◆ EvtValError() [5/8]

EvtValError::EvtValError ( )

◆ EvtValError() [6/8]

EvtValError::EvtValError ( double  val)

◆ EvtValError() [7/8]

EvtValError::EvtValError ( double  val,
double  err 
)

◆ EvtValError() [8/8]

EvtValError::EvtValError ( const EvtValError other)

◆ ~EvtValError() [2/2]

EvtValError::~EvtValError ( )

Member Function Documentation

◆ error() [1/2]

double EvtValError::error ( ) const
inline

Definition at line 33 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.hh.

33{ assert(_errKnown); return _err; }

◆ error() [2/2]

double EvtValError::error ( ) const
inline

Definition at line 33 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.hh.

33{ assert(_errKnown); return _err; }

◆ errorKnown() [1/2]

int EvtValError::errorKnown ( ) const
inline

Definition at line 32 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.hh.

32{ return _errKnown; }

◆ errorKnown() [2/2]

int EvtValError::errorKnown ( ) const
inline

Definition at line 32 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.hh.

32{ return _errKnown; }

◆ operator*=() [1/4]

void EvtValError::operator*= ( const EvtValError other)

Definition at line 52 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.cc.

53{
54 assert(_valKnown && other._valKnown);
55
56 // Relative errors add in quadrature
57 if(_errKnown && other._errKnown)
58 _err = _val * other._val * sqrt(prec()*prec() + other.prec() * other.prec());
59 else _errKnown = 0;
60
61 // Modify the value
62 _val *= other._val;
63}

◆ operator*=() [2/4]

void EvtValError::operator*= ( const EvtValError other)

◆ operator*=() [3/4]

void EvtValError::operator*= ( double  c)

Definition at line 107 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.cc.

107 {
108
109 assert(_valKnown);
110 _val *= c;
111 if(_errKnown) _err*=c;
112}

◆ operator*=() [4/4]

void EvtValError::operator*= ( double  c)

◆ operator+=() [1/2]

void EvtValError::operator+= ( const EvtValError other)

Definition at line 90 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.cc.

91{
92 assert(_valKnown); assert(other._valKnown);
93 _val += other._val;
94
95 // add errors in quadrature
96
97 if(_errKnown && other._errKnown) {
98
99 _err = sqrt(_err*_err + other._err*other._err);
100 }
101 else {
102
103 _errKnown = 0;
104 }
105}

◆ operator+=() [2/2]

void EvtValError::operator+= ( const EvtValError other)

◆ operator/=() [1/2]

void EvtValError::operator/= ( const EvtValError other)

Definition at line 65 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.cc.

66{
67 assert(_valKnown && other._valKnown && other._val != 0.);
68
69 // Relative errors add in quadrature
70 if(_errKnown && other._errKnown)
71 _err = _val/other._val * sqrt(prec()*prec() + other.prec() * other.prec());
72 else _errKnown = 0;
73
74 // Modify the value
75 _val /= other._val;
76}

◆ operator/=() [2/2]

void EvtValError::operator/= ( const EvtValError other)

◆ operator=() [1/2]

void EvtValError::operator= ( const EvtValError other)

Definition at line 44 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.cc.

45{
46 _valKnown = other._valKnown;
47 _val = other._val;
48 _errKnown = other._errKnown;
49 _err = other._err;
50}

◆ operator=() [2/2]

void EvtValError::operator= ( const EvtValError other)

◆ prec() [1/2]

double EvtValError::prec ( ) const

Definition at line 38 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.cc.

39{
40 assert(_valKnown && _errKnown);
41 return ( _val != 0) ? _err/_val : 0;
42}

Referenced by operator*=(), and operator/=().

◆ prec() [2/2]

double EvtValError::prec ( ) const

◆ print() [1/2]

void EvtValError::print ( std::ostream &  ) const

◆ print() [2/2]

void EvtValError::print ( std::ostream &  ) const

◆ value() [1/2]

double EvtValError::value ( ) const
inline

Definition at line 31 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.hh.

31{ assert(_valKnown); return _val; }

◆ value() [2/2]

double EvtValError::value ( ) const
inline

Definition at line 31 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.hh.

31{ assert(_valKnown); return _val; }

◆ valueKnown() [1/2]

int EvtValError::valueKnown ( ) const
inline

Definition at line 30 of file bak-BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.hh.

30{ return _valKnown; }

Referenced by EvtPdf< T >::getItg().

◆ valueKnown() [2/2]

int EvtValError::valueKnown ( ) const
inline

Definition at line 30 of file BesEvtGen-00-04-08/src/EvtGen/EvtGenBase/EvtValError.hh.

30{ return _valKnown; }

The documentation for this class was generated from the following files: