CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

HcalDetDiagLEDData Class Reference

List of all members.

Public Member Functions

void add_statistics (double *data, int nTS)
void change_status (int val)
bool get_average_led (double *ave, double *rms)
bool get_average_time (double *ave, double *rms)
int get_overflow ()
bool get_reference (double *val, double *rms)
int get_statistics ()
int get_status ()
int get_undeflow ()
 HcalDetDiagLEDData ()
void reset ()
void set_reference (float val, float rms)

Private Member Functions

double GetEnergy (double *data, int n)
double GetTime (double *data, int n=10)

Private Attributes

bool IsRefetence
double n
int overflow
float ref_led
float ref_rms
int status
int undeflow
double Xe
double Xt
double XXe
double XXt

Detailed Description

Definition at line 28 of file HcalDetDiagLEDMonitor.cc.


Constructor & Destructor Documentation

HcalDetDiagLEDData::HcalDetDiagLEDData ( ) [inline]

Definition at line 30 of file HcalDetDiagLEDMonitor.cc.

References IsRefetence, reset(), and status.

                       { 
             IsRefetence=false;
             status=0;
             reset();
          }

Member Function Documentation

void HcalDetDiagLEDData::add_statistics ( double *  data,
int  nTS 
) [inline]

Definition at line 40 of file HcalDetDiagLEDMonitor.cc.

References GetEnergy(), GetTime(), n, overflow, matplotRender::t, undeflow, Xe, Xt, XXe, and XXt.

Referenced by HcalDetDiagLEDMonitor::analyze().

                                              {
             double e=GetEnergy(data,nTS);
             double t=GetTime(data,nTS);
             if(e<20) undeflow++; else if(e>10000) overflow++; else{
                n++; Xe+=e; XXe+=e*e; Xt+=t; XXt+=t*t;
             }     
          }
void HcalDetDiagLEDData::change_status ( int  val) [inline]

Definition at line 51 of file HcalDetDiagLEDMonitor.cc.

References status.

Referenced by HcalDetDiagLEDMonitor::CheckStatus().

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

Definition at line 61 of file HcalDetDiagLEDMonitor.cc.

References n, mathSSE::sqrt(), Xe, and XXe.

Referenced by HcalDetDiagLEDMonitor::fillHistos(), and HcalDetDiagLEDMonitor::SaveReference().

                                                  {
             if(n>0){ *ave=Xe/n; *rms=sqrt(XXe/n-(Xe*Xe)/(n*n));} else return false;
             return true; 
          }
bool HcalDetDiagLEDData::get_average_time ( double *  ave,
double *  rms 
) [inline]

Definition at line 65 of file HcalDetDiagLEDMonitor.cc.

References n, mathSSE::sqrt(), Xt, and XXt.

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

                                                   {
             if(n>0){ *ave=Xt/n; *rms=sqrt(XXt/n-(Xt*Xt)/(n*n));} else return false;
             return true; 
          }
int HcalDetDiagLEDData::get_overflow ( ) [inline]

Definition at line 72 of file HcalDetDiagLEDMonitor.cc.

References overflow.

Referenced by HcalDetDiagLEDMonitor::CheckStatus().

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

Definition at line 57 of file HcalDetDiagLEDMonitor.cc.

References IsRefetence, ref_led, and ref_rms.

                                                {
             *val=ref_led; *rms=ref_rms;
             return IsRefetence;
          }       
int HcalDetDiagLEDData::get_statistics ( ) [inline]

Definition at line 69 of file HcalDetDiagLEDMonitor.cc.

References n.

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

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

Definition at line 54 of file HcalDetDiagLEDMonitor.cc.

References status.

Referenced by HcalDetDiagLEDMonitor::SaveReference().

                      {
             return status;
          }       
int HcalDetDiagLEDData::get_undeflow ( ) [inline]

Definition at line 75 of file HcalDetDiagLEDMonitor.cc.

References undeflow.

Referenced by HcalDetDiagLEDMonitor::CheckStatus().

                        {
             return undeflow;
          }   
double HcalDetDiagLEDData::GetEnergy ( double *  data,
int  n 
) [inline, private]

Definition at line 79 of file HcalDetDiagLEDMonitor.cc.

References j, and n.

Referenced by add_statistics().

                                       {
             int MaxI=0; double Energy,MaxE=0;
             for(int j=0;j<n;++j) if(MaxE<data[j]){ MaxE=data[j]; MaxI=j; }
             Energy=data[MaxI];
             if(MaxI>0) Energy+=data[MaxI-1];
             if(MaxI>1) Energy+=data[MaxI-2];
             if(MaxI<(n-1)) Energy+=data[MaxI+1];
             if(MaxI<(n-2)) Energy+=data[MaxI+2];
             return Energy;
          }
double HcalDetDiagLEDData::GetTime ( double *  data,
int  n = 10 
) [inline, private]

Definition at line 89 of file HcalDetDiagLEDMonitor.cc.

References j, and n.

Referenced by add_statistics().

                                        {
             int MaxI=0; double Time=-9999,SumT=0,MaxT=-10;
             for(int j=0;j<n;++j) if(MaxT<data[j]){ MaxT=data[j]; MaxI=j; }
             Time=MaxI*data[MaxI];
             SumT=data[MaxI];
             if(MaxI>0){ Time+=(MaxI-1)*data[MaxI-1]; SumT+=data[MaxI-1]; }
             if(MaxI<(n-1)){ Time+=(MaxI+1)*data[MaxI+1]; SumT+=data[MaxI+1]; }
             Time=Time/SumT;
             return Time;
   }      
void HcalDetDiagLEDData::reset ( void  ) [inline]

Definition at line 35 of file HcalDetDiagLEDMonitor.cc.

References n, overflow, undeflow, Xe, Xt, XXe, and XXt.

Referenced by HcalDetDiagLEDData().

                 {
             Xe=XXe=Xt=XXt=n=0;
             overflow=0;
             undeflow=0;
          }
void HcalDetDiagLEDData::set_reference ( float  val,
float  rms 
) [inline]

Definition at line 47 of file HcalDetDiagLEDMonitor.cc.

References IsRefetence, ref_led, ref_rms, and plotscripts::rms().

Referenced by HcalDetDiagLEDMonitor::LoadReference().

                                            {
             ref_led=val; ref_rms=rms;
             IsRefetence=true;
          }       

Member Data Documentation

Definition at line 102 of file HcalDetDiagLEDMonitor.cc.

Referenced by get_reference(), HcalDetDiagLEDData(), and set_reference().

double HcalDetDiagLEDData::n [private]

Definition at line 99 of file HcalDetDiagLEDMonitor.cc.

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

float HcalDetDiagLEDData::ref_led [private]

Definition at line 103 of file HcalDetDiagLEDMonitor.cc.

Referenced by get_reference(), and set_reference().

float HcalDetDiagLEDData::ref_rms [private]

Definition at line 104 of file HcalDetDiagLEDMonitor.cc.

Referenced by get_reference(), and set_reference().

Definition at line 105 of file HcalDetDiagLEDMonitor.cc.

Referenced by change_status(), get_status(), and HcalDetDiagLEDData().

Definition at line 100 of file HcalDetDiagLEDMonitor.cc.

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

double HcalDetDiagLEDData::Xe [private]

Definition at line 101 of file HcalDetDiagLEDMonitor.cc.

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

double HcalDetDiagLEDData::Xt [private]

Definition at line 101 of file HcalDetDiagLEDMonitor.cc.

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

double HcalDetDiagLEDData::XXe [private]

Definition at line 101 of file HcalDetDiagLEDMonitor.cc.

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

double HcalDetDiagLEDData::XXt [private]

Definition at line 101 of file HcalDetDiagLEDMonitor.cc.

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