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 60 of file HcalDetDiagPedestalMonitor.cc.

Constructor & Destructor Documentation

HcalDetDiagPedestalData::HcalDetDiagPedestalData ( )
inline

Member Function Documentation

void HcalDetDiagPedestalData::add_statistics ( unsigned int  val)
inline

Definition at line 73 of file HcalDetDiagPedestalMonitor.cc.

References adc, n, and overflow.

Referenced by HcalDetDiagPedestalMonitor::analyze().

void HcalDetDiagPedestalData::change_status ( int  val)
inline

Definition at line 83 of file HcalDetDiagPedestalMonitor.cc.

References status.

Referenced by HcalDetDiagPedestalMonitor::CheckStatus().

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

Definition at line 93 of file HcalDetDiagPedestalMonitor.cc.

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

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

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

Definition at line 115 of file HcalDetDiagPedestalMonitor.cc.

References overflow.

Referenced by HcalDetDiagPedestalMonitor::CheckStatus().

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

Definition at line 86 of file HcalDetDiagPedestalMonitor.cc.

References status.

Referenced by HcalDetDiagPedestalMonitor::SaveReference().

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

Definition at line 69 of file HcalDetDiagPedestalMonitor.cc.

References adc, i, and overflow.

Referenced by HcalDetDiagPedestalData().

69  {
70  for(int i=0;i<128;i++) adc[i]=0;
71  overflow=0;
72  }
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 112 of file HcalDetDiagPedestalMonitor.cc.

References n.

Referenced by HcalDetDiagPedestalMonitor::LoadDataset().

112  {
113  n=stat;
114  }

Member Data Documentation

int HcalDetDiagPedestalData::adc[128]
private

Definition at line 124 of file HcalDetDiagPedestalMonitor.cc.

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

float HcalDetDiagPedestalData::ds_ped
private

Definition at line 129 of file HcalDetDiagPedestalMonitor.cc.

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

float HcalDetDiagPedestalData::ds_rms
private

Definition at line 130 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 127 of file HcalDetDiagPedestalMonitor.cc.

Referenced by get_reference(), and set_reference().

float HcalDetDiagPedestalData::ref_rms
private

Definition at line 128 of file HcalDetDiagPedestalMonitor.cc.

Referenced by get_reference(), and set_reference().

int HcalDetDiagPedestalData::status
private