CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CalibCoeff Class Reference

intercalibration coefficient More...

#include <CalibCoeff.h>

Public Member Functions

 CalibCoeff (const double &value=1., const bool &isGood=false)
 ctor More...
 
double difference () const
 the abs difference wrt prev value More...
 
double operator*= (const double &var)
 update the value and turn into good the coefficient More...
 
void setStatus (const bool &stat)
 set its value and turn into good the coefficient More...
 
void setValue (const double &val)
 set its value and turn into good the coefficient More...
 
bool status () const
 its status More...
 
double value () const
 its value More...
 
 ~CalibCoeff ()
 dtor More...
 

Private Attributes

double m_difference
 the difference with the previous value More...
 
bool m_isGood
 if it is good More...
 
double m_value
 the actual value More...
 

Detailed Description

intercalibration coefficient

Definition at line 10 of file CalibCoeff.h.

Constructor & Destructor Documentation

◆ CalibCoeff()

CalibCoeff::CalibCoeff ( const double &  value = 1.,
const bool &  isGood = false 
)

ctor

Definition at line 7 of file CalibCoeff.cc.

8  : m_value(value), m_isGood(isGood), m_difference(m_value) {}
double m_difference
the difference with the previous value
Definition: CalibCoeff.h:36
Definition: value.py:1
bool m_isGood
if it is good
Definition: CalibCoeff.h:34
double m_value
the actual value
Definition: CalibCoeff.h:32

◆ ~CalibCoeff()

CalibCoeff::~CalibCoeff ( )

dtor

Definition at line 12 of file CalibCoeff.cc.

12 {}

Member Function Documentation

◆ difference()

double CalibCoeff::difference ( ) const

the abs difference wrt prev value

Definition at line 20 of file CalibCoeff.cc.

References m_difference, and m_isGood.

20 { return m_isGood * m_difference - !m_isGood; }
double m_difference
the difference with the previous value
Definition: CalibCoeff.h:36
bool m_isGood
if it is good
Definition: CalibCoeff.h:34

◆ operator*=()

double CalibCoeff::operator*= ( const double &  var)

update the value and turn into good the coefficient

Definition at line 44 of file CalibCoeff.cc.

References m_difference, m_isGood, m_value, and ALCARECOEcalPhiSym_cff::var.

44  {
45  double oldval = m_value;
46  m_value *= var;
47  m_difference = fabs(m_value - oldval);
48  m_isGood = true;
49  return m_value;
50 }
double m_difference
the difference with the previous value
Definition: CalibCoeff.h:36
bool m_isGood
if it is good
Definition: CalibCoeff.h:34
double m_value
the actual value
Definition: CalibCoeff.h:32

◆ setStatus()

void CalibCoeff::setStatus ( const bool &  stat)

set its value and turn into good the coefficient

Definition at line 37 of file CalibCoeff.cc.

References m_isGood, and edm_modernize_messagelogger::stat.

37  {
38  m_isGood = stat;
39  return;
40 }
bool m_isGood
if it is good
Definition: CalibCoeff.h:34

◆ setValue()

void CalibCoeff::setValue ( const double &  val)

set its value and turn into good the coefficient

Definition at line 28 of file CalibCoeff.cc.

References m_difference, m_isGood, m_value, and heppy_batch::val.

Referenced by Types._ProxyParameter::__init__().

28  {
29  m_value = val;
31  m_isGood = true;
32  return;
33 }
double m_difference
the difference with the previous value
Definition: CalibCoeff.h:36
bool m_isGood
if it is good
Definition: CalibCoeff.h:34
double m_value
the actual value
Definition: CalibCoeff.h:32

◆ status()

bool CalibCoeff::status ( ) const

its status

Definition at line 24 of file CalibCoeff.cc.

References m_isGood.

24 { return m_isGood; }
bool m_isGood
if it is good
Definition: CalibCoeff.h:34

◆ value()

double CalibCoeff::value ( ) const

Member Data Documentation

◆ m_difference

double CalibCoeff::m_difference
private

the difference with the previous value

Definition at line 36 of file CalibCoeff.h.

Referenced by difference(), operator*=(), and setValue().

◆ m_isGood

bool CalibCoeff::m_isGood
private

if it is good

Definition at line 34 of file CalibCoeff.h.

Referenced by difference(), operator*=(), setStatus(), setValue(), status(), and value().

◆ m_value

double CalibCoeff::m_value
private

the actual value

Definition at line 32 of file CalibCoeff.h.

Referenced by operator*=(), setValue(), and value().