#include <Calibration/Tools/interface/CalibCoeff.h>
Public Member Functions | |
CalibCoeff (const double &value=1., const bool &isGood=0) | |
ctor | |
double | difference () const |
the abs difference wrt prev value | |
double | operator *= (const double &var) |
update the value and turn into good the coefficient | |
void | setStatus (const bool &stat) |
set its value and turn into good the coefficient | |
void | setValue (const double &val) |
set its value and turn into good the coefficient | |
bool | status () const |
its status | |
double | value () const |
its value | |
~CalibCoeff () | |
dtor | |
Private Attributes | |
double | m_difference |
the difference with the previous value | |
bool | m_isGood |
if it is good | |
double | m_value |
the actual value |
Definition at line 14 of file CalibCoeff.h.
CalibCoeff::CalibCoeff | ( | const double & | value = 1. , |
|
const bool & | isGood = 0 | |||
) |
ctor
Definition at line 11 of file CalibCoeff.cc.
00012 : 00013 m_value (value), 00014 m_isGood (isGood), 00015 m_difference (m_value) 00016 {}
CalibCoeff::~CalibCoeff | ( | ) |
double CalibCoeff::difference | ( | ) | const |
the abs difference wrt prev value
Definition at line 39 of file CalibCoeff.cc.
References m_difference, and m_isGood.
00040 { 00041 return m_isGood * m_difference - !m_isGood ; 00042 }
double CalibCoeff::operator *= | ( | const double & | var | ) |
update the value and turn into good the coefficient
Definition at line 83 of file CalibCoeff.cc.
References m_difference, m_isGood, m_value, and true.
00084 { 00085 double oldval = m_value ; 00086 m_value *= var ; 00087 m_difference = fabs (m_value - oldval) ; 00088 m_isGood = true ; 00089 return m_value ; 00090 }
set its value and turn into good the coefficient
Definition at line 72 of file CalibCoeff.cc.
References m_isGood.
00073 { 00074 m_isGood = stat ; 00075 return ; 00076 }
void CalibCoeff::setValue | ( | const double & | val | ) |
set its value and turn into good the coefficient
Definition at line 59 of file CalibCoeff.cc.
References m_difference, m_isGood, m_value, and true.
00060 { 00061 m_value = val ; 00062 m_difference = m_value ; 00063 m_isGood = true ; 00064 return ; 00065 }
bool CalibCoeff::status | ( | ) | const |
its status
Definition at line 49 of file CalibCoeff.cc.
References m_isGood.
00050 { 00051 return m_isGood ; 00052 }
double CalibCoeff::value | ( | ) | const |
double CalibCoeff::m_difference [private] |
the difference with the previous value
Definition at line 43 of file CalibCoeff.h.
Referenced by difference(), operator *=(), and setValue().
bool CalibCoeff::m_isGood [private] |
if it is good
Definition at line 41 of file CalibCoeff.h.
Referenced by difference(), operator *=(), setStatus(), setValue(), status(), and value().
double CalibCoeff::m_value [private] |
the actual value
Definition at line 39 of file CalibCoeff.h.
Referenced by operator *=(), setValue(), and value().