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) {}

◆ ~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.

20 { return m_isGood * m_difference - !m_isGood; }

References m_difference, and m_isGood.

◆ operator*=()

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

update the value and turn into good the coefficient

Definition at line 44 of file CalibCoeff.cc.

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 }

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

◆ setStatus()

void CalibCoeff::setStatus ( const bool &  stat)

set its value and turn into good the coefficient

Definition at line 37 of file CalibCoeff.cc.

37  {
38  m_isGood = stat;
39  return;
40 }

References m_isGood, and hgcalPlots::stat.

◆ setValue()

void CalibCoeff::setValue ( const double &  val)

set its value and turn into good the coefficient

Definition at line 28 of file CalibCoeff.cc.

28  {
29  m_value = val;
31  m_isGood = true;
32  return;
33 }

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

◆ status()

bool CalibCoeff::status ( ) const

its status

Definition at line 24 of file CalibCoeff.cc.

24 { return m_isGood; }

References m_isGood.

◆ 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().

CalibCoeff::m_value
double m_value
the actual value
Definition: CalibCoeff.h:32
CalibCoeff::m_difference
double m_difference
the difference with the previous value
Definition: CalibCoeff.h:36
CalibCoeff::m_isGood
bool m_isGood
if it is good
Definition: CalibCoeff.h:34
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
hgcalPlots.stat
stat
Definition: hgcalPlots.py:1111
value
Definition: value.py:1
heppy_batch.val
val
Definition: heppy_batch.py:351