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
HcalDetDiagLaserData Class Reference

Public Member Functions

void add_statistics (double *data, int nTS)
 
void change_status (int val)
 
bool get_average_amp (double *ave, double *rms)
 
bool get_average_amp1 (double *ave, double *rms)
 
bool get_average_time (double *ave, double *rms)
 
bool get_average_time1 (double *ave, double *rms)
 
int get_overflow ()
 
int get_overflow1 ()
 
bool get_reference (double *val, double *rms, double *time, double *time_rms)
 
int get_statistics ()
 
int get_statistics1 ()
 
int get_status ()
 
int get_undeflow ()
 
int get_undeflow1 ()
 
double GetEnergy (double *data, int n)
 
double GetTime (double *data, int n=10)
 
 HcalDetDiagLaserData ()
 
void reset ()
 
void reset1 ()
 
void set_data (float val, float rms, float time, float time_rms)
 
void set_reference (float val, float rms, float time, float time_rms)
 
void set_statistics (int stat)
 
void set_statistics1 (int stat)
 

Public Attributes

float ds_amp
 
float ds_rms
 
float ds_time
 
float ds_time_rms
 
bool IsRefetence
 
double n
 
double n1
 
float nBadEnergy
 
float nBadTime
 
float nChecks
 
int overflow
 
int overflow1
 
float ref_amp
 
float ref_rms
 
float ref_time
 
float ref_time_rms
 
int status
 
int undeflow
 
int undeflow1
 
double Xe
 
double Xe1
 
double Xt
 
double Xt1
 
double XXe
 
double XXe1
 
double XXt
 
double XXt1
 

Detailed Description

Definition at line 113 of file HcalDetDiagLaserMonitor.cc.

Constructor & Destructor Documentation

HcalDetDiagLaserData::HcalDetDiagLaserData ( )
inline

Member Function Documentation

void HcalDetDiagLaserData::add_statistics ( double *  data,
int  nTS 
)
inline

Definition at line 137 of file HcalDetDiagLaserMonitor.cc.

References alignCSCRings::e, GetEnergy(), GetTime(), n, n1, overflow, overflow1, tree::t, undeflow, undeflow1, Xe, Xe1, Xt, Xt1, XXe, XXe1, XXt, and XXt1.

Referenced by HcalDetDiagLaserMonitor::analyze().

137  {
138  double e=GetEnergy(data,nTS);
139  double t=GetTime(data,nTS);
140  if(e<20){ undeflow++;undeflow1++; }else if(e>10000){ overflow++;overflow1++; }else{
141  n++; Xe+=e; XXe+=e*e; Xt+=t; XXt+=t*t;
142  n1++; Xe1+=e; XXe1+=e*e; Xt1+=t; XXt1+=t*t;
143  }
144  }
tuple t
Definition: tree.py:139
double GetEnergy(double *data, int n)
double GetTime(double *data, int n=10)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void HcalDetDiagLaserData::change_status ( int  val)
inline

Definition at line 154 of file HcalDetDiagLaserMonitor.cc.

References status.

154  {
155  status|=val;
156  }
bool HcalDetDiagLaserData::get_average_amp ( double *  ave,
double *  rms 
)
inline

Definition at line 165 of file HcalDetDiagLaserMonitor.cc.

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

Referenced by HcalDetDiagLaserMonitor::fillHistos(), and HcalDetDiagLaserMonitor::get_ave_subdet().

165  {
166  if(ds_time>-10){ *ave=ds_amp; *rms=ds_rms; return true; }
167  if(n>0){ *ave=Xe/n; *rms=sqrt(XXe/n-(Xe*Xe)/(n*n));} else return false;
168  return true;
169  }
T sqrt(T t)
Definition: SSEVec.h:48
bool HcalDetDiagLaserData::get_average_amp1 ( double *  ave,
double *  rms 
)
inline

Definition at line 190 of file HcalDetDiagLaserMonitor.cc.

References ds_amp, ds_rms, ds_time, n1, mathSSE::sqrt(), Xe1, and XXe1.

Referenced by HcalDetDiagLaserMonitor::SaveReference().

190  {
191  if(ds_time>-10){ *ave=ds_amp; *rms=ds_rms; return true; }
192  if(n1>0){ *ave=Xe1/n1; *rms=sqrt(XXe1/n1-(Xe1*Xe1)/(n1*n1));} else return false;
193  return true;
194  }
T sqrt(T t)
Definition: SSEVec.h:48
bool HcalDetDiagLaserData::get_average_time ( double *  ave,
double *  rms 
)
inline

Definition at line 170 of file HcalDetDiagLaserMonitor.cc.

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

Referenced by HcalDetDiagLaserMonitor::fillHistos(), and HcalDetDiagLaserMonitor::get_ave_subdet().

170  {
171  if(ds_time>-10){ *ave=ds_time; *rms=ds_time_rms; return true; }
172  if(n>0){ *ave=Xt/n; *rms=sqrt(XXt/n-(Xt*Xt)/(n*n));} else return false;
173  return true;
174  }
T sqrt(T t)
Definition: SSEVec.h:48
bool HcalDetDiagLaserData::get_average_time1 ( double *  ave,
double *  rms 
)
inline

Definition at line 195 of file HcalDetDiagLaserMonitor.cc.

References ds_time, ds_time_rms, n1, mathSSE::sqrt(), Xt1, and XXt1.

Referenced by HcalDetDiagLaserMonitor::SaveReference().

195  {
196  if(ds_time>-10){ *ave=ds_time; *rms=ds_time_rms; return true; }
197  if(n1>0){ *ave=Xt1/n1; *rms=sqrt(XXt1/n1-(Xt1*Xt1)/(n1*n1));} else return false;
198  return true;
199  }
T sqrt(T t)
Definition: SSEVec.h:48
int HcalDetDiagLaserData::get_overflow ( )
inline

Definition at line 184 of file HcalDetDiagLaserMonitor.cc.

References overflow.

184  {
185  return overflow;
186  }
int HcalDetDiagLaserData::get_overflow1 ( )
inline

Definition at line 203 of file HcalDetDiagLaserMonitor.cc.

References overflow1.

203  {
204  return overflow1;
205  }
bool HcalDetDiagLaserData::get_reference ( double *  val,
double *  rms,
double *  time,
double *  time_rms 
)
inline
int HcalDetDiagLaserData::get_statistics ( )
inline

Definition at line 175 of file HcalDetDiagLaserMonitor.cc.

References n.

175  {
176  return (int)n;
177  }
int HcalDetDiagLaserData::get_statistics1 ( )
inline

Definition at line 200 of file HcalDetDiagLaserMonitor.cc.

References n1.

Referenced by HcalDetDiagLaserMonitor::SaveReference().

200  {
201  return (int)n1;
202  }
int HcalDetDiagLaserData::get_status ( )
inline

Definition at line 157 of file HcalDetDiagLaserMonitor.cc.

References status.

Referenced by HcalDetDiagLaserMonitor::SaveReference().

157  {
158  return status;
159  }
int HcalDetDiagLaserData::get_undeflow ( )
inline

Definition at line 187 of file HcalDetDiagLaserMonitor.cc.

References undeflow.

187  {
188  return undeflow;
189  }
int HcalDetDiagLaserData::get_undeflow1 ( )
inline

Definition at line 206 of file HcalDetDiagLaserMonitor.cc.

References undeflow1.

206  {
207  return undeflow1;
208  }
double HcalDetDiagLaserData::GetEnergy ( double *  data,
int  n 
)
inline

Definition at line 209 of file HcalDetDiagLaserMonitor.cc.

References j, and n.

Referenced by add_statistics().

209  {
210  int MaxI=0; double Energy,MaxE=0;
211  for(int j=0;j<n;++j) if(MaxE<data[j]){ MaxE=data[j]; MaxI=j; }
212  Energy=data[MaxI];
213  if(MaxI>0) Energy+=data[MaxI-1];
214  if(MaxI>1) Energy+=data[MaxI-2];
215  if(MaxI<(n-1)) Energy+=data[MaxI+1];
216  if(MaxI<(n-2)) Energy+=data[MaxI+2];
217  return Energy;
218  }
int j
Definition: DBlmapReader.cc:9
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
double HcalDetDiagLaserData::GetTime ( double *  data,
int  n = 10 
)
inline

Definition at line 219 of file HcalDetDiagLaserMonitor.cc.

References j, and n.

Referenced by add_statistics().

219  {
220  int MaxI=-100; double Time=-9999,SumT=0,MaxT=-10;
221  for(int j=0;j<n;++j) if(MaxT<data[j]){ MaxT=data[j]; MaxI=j; }
222  if (MaxI>=0) // dummy protection so that compiler doesn't think MaxI=-100
223  {
224  Time=MaxI*data[MaxI];
225  SumT=data[MaxI];
226  if(MaxI>0){ Time+=(MaxI-1)*data[MaxI-1]; SumT+=data[MaxI-1]; }
227  if(MaxI<(n-1)){ Time+=(MaxI+1)*data[MaxI+1]; SumT+=data[MaxI+1]; }
228  Time=Time/SumT;
229  }
230  return Time;
231  }
int j
Definition: DBlmapReader.cc:9
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void HcalDetDiagLaserData::reset ( void  )
inline
void HcalDetDiagLaserData::reset1 ( )
inline
void HcalDetDiagLaserData::set_data ( float  val,
float  rms,
float  time,
float  time_rms 
)
inline
void HcalDetDiagLaserData::set_reference ( float  val,
float  rms,
float  time,
float  time_rms 
)
inline
void HcalDetDiagLaserData::set_statistics ( int  stat)
inline

Definition at line 178 of file HcalDetDiagLaserMonitor.cc.

References n.

Referenced by HcalDetDiagLaserMonitor::LoadDataset().

178  {
179  n=stat;
180  }
void HcalDetDiagLaserData::set_statistics1 ( int  stat)
inline

Definition at line 181 of file HcalDetDiagLaserMonitor.cc.

References n1.

Referenced by HcalDetDiagLaserMonitor::LoadDataset().

181  {
182  n1=stat;
183  }

Member Data Documentation

float HcalDetDiagLaserData::ds_amp
float HcalDetDiagLaserData::ds_rms
float HcalDetDiagLaserData::ds_time
float HcalDetDiagLaserData::ds_time_rms
bool HcalDetDiagLaserData::IsRefetence

Definition at line 238 of file HcalDetDiagLaserMonitor.cc.

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

double HcalDetDiagLaserData::n
double HcalDetDiagLaserData::n1
float HcalDetDiagLaserData::nBadEnergy
float HcalDetDiagLaserData::nBadTime
float HcalDetDiagLaserData::nChecks
int HcalDetDiagLaserData::overflow
int HcalDetDiagLaserData::overflow1

Definition at line 234 of file HcalDetDiagLaserMonitor.cc.

Referenced by add_statistics(), get_overflow1(), and reset1().

float HcalDetDiagLaserData::ref_amp

Definition at line 239 of file HcalDetDiagLaserMonitor.cc.

Referenced by get_reference(), and set_reference().

float HcalDetDiagLaserData::ref_rms

Definition at line 240 of file HcalDetDiagLaserMonitor.cc.

Referenced by get_reference(), and set_reference().

float HcalDetDiagLaserData::ref_time

Definition at line 241 of file HcalDetDiagLaserMonitor.cc.

Referenced by get_reference(), and set_reference().

float HcalDetDiagLaserData::ref_time_rms

Definition at line 242 of file HcalDetDiagLaserMonitor.cc.

Referenced by get_reference(), and set_reference().

int HcalDetDiagLaserData::status
int HcalDetDiagLaserData::undeflow

Definition at line 233 of file HcalDetDiagLaserMonitor.cc.

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

int HcalDetDiagLaserData::undeflow1

Definition at line 235 of file HcalDetDiagLaserMonitor.cc.

Referenced by add_statistics(), get_undeflow1(), and reset1().

double HcalDetDiagLaserData::Xe

Definition at line 236 of file HcalDetDiagLaserMonitor.cc.

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

double HcalDetDiagLaserData::Xe1

Definition at line 237 of file HcalDetDiagLaserMonitor.cc.

Referenced by add_statistics(), get_average_amp1(), and reset1().

double HcalDetDiagLaserData::Xt

Definition at line 236 of file HcalDetDiagLaserMonitor.cc.

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

double HcalDetDiagLaserData::Xt1

Definition at line 237 of file HcalDetDiagLaserMonitor.cc.

Referenced by add_statistics(), get_average_time1(), and reset1().

double HcalDetDiagLaserData::XXe

Definition at line 236 of file HcalDetDiagLaserMonitor.cc.

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

double HcalDetDiagLaserData::XXe1

Definition at line 237 of file HcalDetDiagLaserMonitor.cc.

Referenced by add_statistics(), get_average_amp1(), and reset1().

double HcalDetDiagLaserData::XXt

Definition at line 236 of file HcalDetDiagLaserMonitor.cc.

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

double HcalDetDiagLaserData::XXt1

Definition at line 237 of file HcalDetDiagLaserMonitor.cc.

Referenced by add_statistics(), get_average_time1(), and reset1().