CMS 3D CMS Logo

Public Member Functions | Private Attributes

CalibCoeff Class Reference

intercalibration coefficient More...

#include <CalibCoeff.h>

List of all members.

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

Detailed Description

intercalibration coefficient

Date:
2008/02/25 16:46:55
Revision:
1.2
Id:
CalibCoeff.h,v 1.2 2008/02/25 16:46:55 malberti Exp
Author:
Author:
malberti

Definition at line 14 of file CalibCoeff.h.


Constructor & Destructor Documentation

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

ctor

Date:
2008/02/25 17:41:51
Revision:
1.2
Id:
CalibCoeff.cc,v 1.2 2008/02/25 17:41:51 malberti Exp
Author:
Author:
malberti

Definition at line 11 of file CalibCoeff.cc.

                                             :
  m_value (value),
  m_isGood (isGood),
  m_difference (m_value)
  {}
CalibCoeff::~CalibCoeff ( )

dtor

Definition at line 22 of file CalibCoeff.cc.

{}

Member Function Documentation

double CalibCoeff::difference ( ) const

the abs difference wrt prev value

Definition at line 39 of file CalibCoeff.cc.

References m_difference, and m_isGood.

{
  return m_isGood * m_difference - !m_isGood ;
}
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 funct::true.

{
  double oldval = m_value ;
  m_value *= var ;
  m_difference = fabs (m_value - oldval) ;
  m_isGood = true ;
  return m_value ;
}
void CalibCoeff::setStatus ( const bool &  stat)

set its value and turn into good the coefficient

Definition at line 72 of file CalibCoeff.cc.

References m_isGood.

{
  m_isGood = stat ;
  return ;
}
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 funct::true.

{
  m_value = val ;
  m_difference = m_value ;
  m_isGood = true ;
  return ;
}
bool CalibCoeff::status ( ) const

its status

Definition at line 49 of file CalibCoeff.cc.

References m_isGood.

{
  return m_isGood ;
}
double CalibCoeff::value ( ) const

its value

Definition at line 29 of file CalibCoeff.cc.

References m_isGood, and m_value.

{
  return m_isGood * m_value + !m_isGood ;
}

Member Data Documentation

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