CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Attributes

HcalDetDiagPedestalData Class Reference

List of all members.

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

                                          {
             if(val<128){ adc[val&0x7F]++; n++;}else overflow++;    
          }
void HcalDetDiagPedestalData::change_status ( int  val) [inline]

Definition at line 82 of file HcalDetDiagPedestalMonitor.cc.

References status.

Referenced by HcalDetDiagPedestalMonitor::CheckStatus().

                                {
             status|=val;
          }       
bool HcalDetDiagPedestalData::get_average ( double *  ave,
double *  rms 
) [inline]

Definition at line 92 of file HcalDetDiagPedestalMonitor.cc.

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

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

                                              {
             if(ds_ped>-100){ *ave=ds_ped;  *rms=ds_rms;  return true;}
             double Sum=0,nSum=0; 
             int from,to,max=adc[0],maxi=0;
             for(int i=1;i<128;i++) if(adc[i]>max){ max=adc[i]; maxi=i;} 
             from=0; to=maxi+6; if(to>127) to=127;
             for(int i=from;i<=to;i++){
                Sum+=i*adc[i];
                nSum+=adc[i];
             } 
             if(nSum>0) *ave=Sum/nSum; else return false;
             Sum=0;
             for(int i=from;i<=to;i++) Sum+=adc[i]*(i-*ave)*(i-*ave);
             *rms=sqrt(Sum/nSum);
             return true; 
          }
int HcalDetDiagPedestalData::get_overflow ( ) [inline]

Definition at line 114 of file HcalDetDiagPedestalMonitor.cc.

References overflow.

Referenced by HcalDetDiagPedestalMonitor::CheckStatus().

                        {
             return overflow;
          }   
bool HcalDetDiagPedestalData::get_reference ( double *  val,
double *  rms 
) [inline]

Definition at line 88 of file HcalDetDiagPedestalMonitor.cc.

References IsReference, ref_ped, and ref_rms.

Referenced by HcalDetDiagPedestalMonitor::CheckStatus().

                                                {
             *val=ref_ped; *rms=ref_rms;
             return IsReference;
          }       
int HcalDetDiagPedestalData::get_statistics ( ) [inline]

Definition at line 108 of file HcalDetDiagPedestalMonitor.cc.

References n.

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

                          {
             return n;
          } 
int HcalDetDiagPedestalData::get_status ( ) [inline]

Definition at line 85 of file HcalDetDiagPedestalMonitor.cc.

References status.

Referenced by HcalDetDiagPedestalMonitor::SaveReference().

                      {
             return status;
          }       
void HcalDetDiagPedestalData::reset ( void  ) [inline]

Definition at line 68 of file HcalDetDiagPedestalMonitor.cc.

References adc, i, and overflow.

Referenced by HcalDetDiagPedestalData().

                 {
             for(int i=0;i<128;i++) adc[i]=0; 
             overflow=0;
          }       
void HcalDetDiagPedestalData::set_data ( float  val,
float  rms 
) [inline]

Definition at line 79 of file HcalDetDiagPedestalMonitor.cc.

References ds_ped, ds_rms, and plotscripts::rms().

Referenced by HcalDetDiagPedestalMonitor::LoadDataset().

                                       {
             ds_ped=val; ds_rms=rms;
          }       
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, and testRegression::stat.

Referenced by HcalDetDiagPedestalMonitor::LoadDataset().

                                  {
             n=stat;
          } 

Member Data Documentation

int HcalDetDiagPedestalData::adc[128] [private]

Definition at line 123 of file HcalDetDiagPedestalMonitor.cc.

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

Definition at line 128 of file HcalDetDiagPedestalMonitor.cc.

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

Definition at line 129 of file HcalDetDiagPedestalMonitor.cc.

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

Definition at line 124 of file HcalDetDiagPedestalMonitor.cc.

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

Definition at line 126 of file HcalDetDiagPedestalMonitor.cc.

Referenced by get_reference(), and set_reference().

Definition at line 127 of file HcalDetDiagPedestalMonitor.cc.

Referenced by get_reference(), and set_reference().