#include <OnlineDB/CSCCondDB/interface/AutoCorrMat.h>
Public Member Functions | |
void | add (int *adc) |
AutoCorrMat () | |
float * | mat () |
void | zero () |
~AutoCorrMat () | |
Private Attributes | |
int | evar [12] |
int | evt |
float | Mat [12] |
float | mymean [12] |
float | N [12] |
float | tMat [12] |
float | variance [12] |
Definition at line 11 of file AutoCorrMat.h.
AutoCorrMat::AutoCorrMat | ( | ) | [inline] |
AutoCorrMat::~AutoCorrMat | ( | ) | [inline] |
Definition at line 37 of file AutoCorrMat.h.
References ecalMGPA::adc(), evar, evt, i, Mat, mymean, N, mergeAndRegister_online::pairs, funct::sqrt(), and variance.
Referenced by Chamber_AutoCorrMat::add().
00037 { 00038 int pairs[12][2]={{3,3},{3,4},{4,4},{3,5},{4,5},{5,5},{4,6},{5,6},{6,6},{5,7},{6,7},{7,7}}; 00039 double ped=(adc[0]+adc[1])/2.; 00040 evt++; 00041 00042 for(int i=3;i<8;i++){ 00043 if(fabs(adc[i]-ped)<25.){ 00044 evar[i]++; 00045 mymean[i] += adc[i]-ped; 00046 variance[i] += (adc[i]-ped)*(adc[i]-ped); 00047 } 00048 } 00049 00050 for(int i=0;i<12;i++){ 00051 00052 //Add values within 3 sigma of mean only 00053 float threeSigma0 = 3. * sqrt(variance[pairs[i][0]]/evar[pairs[i][0]]); 00054 float threeSigma1 = 3. * sqrt(variance[pairs[i][1]]/evar[pairs[i][1]]); 00055 00056 if (fabs(adc[pairs[i][0]]-ped)<threeSigma0 && fabs(adc[pairs[i][1]]-ped)<threeSigma1){ 00057 N[i]=N[i]+1; 00058 Mat[i]=Mat[i]+(adc[pairs[i][0]]-ped)*(adc[pairs[i][1]]-ped); 00059 } 00060 //end 3 sigma 00061 } 00062 }
float* AutoCorrMat::mat | ( | ) | [inline] |
void AutoCorrMat::zero | ( | ) | [inline] |
Definition at line 24 of file AutoCorrMat.h.
References evar, evt, i, Mat, mymean, N, and variance.
Referenced by Chamber_AutoCorrMat::zero().
00024 { 00025 for(int i=0;i<12;i++){ 00026 Mat[i]=0.0; 00027 N[i]=0.0; 00028 } 00029 for (int i=3;i<12;i++){ 00030 evar[i]=1; 00031 variance[i]=10.0; 00032 mymean[i]=3.2; 00033 } 00034 evt=0; 00035 }
int AutoCorrMat::evar[12] [private] |
int AutoCorrMat::evt [private] |
float AutoCorrMat::Mat[12] [private] |
float AutoCorrMat::mymean[12] [private] |
float AutoCorrMat::N[12] [private] |
float AutoCorrMat::tMat[12] [private] |
float AutoCorrMat::variance[12] [private] |