CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes
HcalDetDiagPedestalData Class Reference

Public Member Functions

void add_statistics (unsigned int val)
 
void change_status (int val)
 
bool get_average (double *ave, double *rms)
 
int get_overflow ()
 
bool get_reference (double *val, double *rms)
 
int get_statistics ()
 
int get_status ()
 
 HcalDetDiagPedestalData ()
 
void reset ()
 
void set_data (float val, float rms)
 
void set_reference (float val, float rms)
 
void set_statistics (int stat)
 

Public Attributes

float nBadPed
 
float nBadRms
 
float nChecks
 
float nMissing
 
float nUnstable
 

Private Attributes

int adc [128]
 
float ds_ped
 
float ds_rms
 
bool IsReference
 
int n
 
int overflow
 
float ref_ped
 
float ref_rms
 
int status
 

Detailed Description

Definition at line 59 of file HcalDetDiagPedestalMonitor.cc.

Constructor & Destructor Documentation

HcalDetDiagPedestalData::HcalDetDiagPedestalData ( )
inline

Member Function Documentation

void HcalDetDiagPedestalData::add_statistics ( unsigned int  val)
inline

Definition at line 72 of file HcalDetDiagPedestalMonitor.cc.

References adc, n, and overflow.

Referenced by HcalDetDiagPedestalMonitor::analyze().

void HcalDetDiagPedestalData::change_status ( int  val)
inline

Definition at line 82 of file HcalDetDiagPedestalMonitor.cc.

References status.

Referenced by HcalDetDiagPedestalMonitor::CheckStatus().

82  {
83  status|=val;
84  }
bool HcalDetDiagPedestalData::get_average ( double *  ave,
double *  rms 
)
inline

Definition at line 92 of file HcalDetDiagPedestalMonitor.cc.

References adc, ds_ped, ds_rms, i, bookConverter::max, mathSSE::sqrt(), and Sum.

Referenced by HcalDetDiagPedestalMonitor::CheckStatus(), HcalDetDiagPedestalMonitor::fillHistos(), and HcalDetDiagPedestalMonitor::SaveReference().

92  {
93  if(ds_ped>-100){ *ave=ds_ped; *rms=ds_rms; return true;}
94  double Sum=0,nSum=0;
95  int from,to,max=adc[0],maxi=0;
96  for(int i=1;i<128;i++) if(adc[i]>max){ max=adc[i]; maxi=i;}
97  from=0; to=maxi+6; if(to>127) to=127;
98  for(int i=from;i<=to;i++){
99  Sum+=i*adc[i];
100  nSum+=adc[i];
101  }
102  if(nSum>0) *ave=Sum/nSum; else return false;
103  Sum=0;
104  for(int i=from;i<=to;i++) Sum+=adc[i]*(i-*ave)*(i-*ave);
105  *rms=sqrt(Sum/nSum);
106  return true;
107  }
int i
Definition: DBlmapReader.cc:9
T sqrt(T t)
Definition: SSEVec.h:48
int HcalDetDiagPedestalData::get_overflow ( )
inline

Definition at line 114 of file HcalDetDiagPedestalMonitor.cc.

References overflow.

Referenced by HcalDetDiagPedestalMonitor::CheckStatus().

114  {
115  return overflow;
116  }
bool HcalDetDiagPedestalData::get_reference ( double *  val,
double *  rms 
)
inline
int HcalDetDiagPedestalData::get_statistics ( )
inline
int HcalDetDiagPedestalData::get_status ( )
inline

Definition at line 85 of file HcalDetDiagPedestalMonitor.cc.

References status.

Referenced by HcalDetDiagPedestalMonitor::SaveReference().

85  {
86  return status;
87  }
void HcalDetDiagPedestalData::reset ( void  )
inline

Definition at line 68 of file HcalDetDiagPedestalMonitor.cc.

References adc, i, and overflow.

Referenced by HcalDetDiagPedestalData().

68  {
69  for(int i=0;i<128;i++) adc[i]=0;
70  overflow=0;
71  }
int i
Definition: DBlmapReader.cc:9
void HcalDetDiagPedestalData::set_data ( float  val,
float  rms 
)
inline
void HcalDetDiagPedestalData::set_reference ( float  val,
float  rms 
)
inline
void HcalDetDiagPedestalData::set_statistics ( int  stat)
inline

Definition at line 111 of file HcalDetDiagPedestalMonitor.cc.

References n.

Referenced by HcalDetDiagPedestalMonitor::LoadDataset().

111  {
112  n=stat;
113  }

Member Data Documentation

int HcalDetDiagPedestalData::adc[128]
private

Definition at line 123 of file HcalDetDiagPedestalMonitor.cc.

Referenced by add_statistics(), get_average(), and reset().

float HcalDetDiagPedestalData::ds_ped
private

Definition at line 128 of file HcalDetDiagPedestalMonitor.cc.

Referenced by get_average(), HcalDetDiagPedestalData(), and set_data().

float HcalDetDiagPedestalData::ds_rms
private

Definition at line 129 of file HcalDetDiagPedestalMonitor.cc.

Referenced by get_average(), HcalDetDiagPedestalData(), and set_data().

bool HcalDetDiagPedestalData::IsReference
private
int HcalDetDiagPedestalData::n
private
float HcalDetDiagPedestalData::nBadPed
float HcalDetDiagPedestalData::nBadRms
float HcalDetDiagPedestalData::nChecks
float HcalDetDiagPedestalData::nMissing
float HcalDetDiagPedestalData::nUnstable
int HcalDetDiagPedestalData::overflow
private
float HcalDetDiagPedestalData::ref_ped
private

Definition at line 126 of file HcalDetDiagPedestalMonitor.cc.

Referenced by get_reference(), and set_reference().

float HcalDetDiagPedestalData::ref_rms
private

Definition at line 127 of file HcalDetDiagPedestalMonitor.cc.

Referenced by get_reference(), and set_reference().

int HcalDetDiagPedestalData::status
private