CMS 3D CMS Logo

AutoCorrMat Class Reference

#include <OnlineDB/CSCCondDB/interface/AutoCorrMat.h>

List of all members.

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]


Detailed Description

Definition at line 11 of file AutoCorrMat.h.


Constructor & Destructor Documentation

AutoCorrMat::AutoCorrMat (  )  [inline]

Definition at line 15 of file AutoCorrMat.h.

References i, Mat, and N.

00015                {
00016     for(int i=0;i<12;i++){
00017       Mat[i]=0.0;
00018       N[i]=0.0;
00019     }
00020   }

AutoCorrMat::~AutoCorrMat (  )  [inline]

Definition at line 22 of file AutoCorrMat.h.

00022 {}


Member Function Documentation

void AutoCorrMat::add ( int adc  )  [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]

Definition at line 64 of file AutoCorrMat.h.

References i, Mat, N, tMat, and tmp.

Referenced by Chamber_AutoCorrMat::autocorrmat().

00064               {
00065     float *tmp;
00066     for(int i=0;i<12;i++)tMat[i]=Mat[i]/N[i];
00067     tmp=tMat;
00068     return tmp; 
00069   }

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   }


Member Data Documentation

int AutoCorrMat::evar[12] [private]

Definition at line 79 of file AutoCorrMat.h.

Referenced by add(), and zero().

int AutoCorrMat::evt [private]

Definition at line 78 of file AutoCorrMat.h.

Referenced by add(), and zero().

float AutoCorrMat::Mat[12] [private]

Definition at line 73 of file AutoCorrMat.h.

Referenced by add(), AutoCorrMat(), mat(), and zero().

float AutoCorrMat::mymean[12] [private]

Definition at line 76 of file AutoCorrMat.h.

Referenced by add(), and zero().

float AutoCorrMat::N[12] [private]

Definition at line 74 of file AutoCorrMat.h.

Referenced by add(), AutoCorrMat(), mat(), and zero().

float AutoCorrMat::tMat[12] [private]

Definition at line 75 of file AutoCorrMat.h.

Referenced by mat().

float AutoCorrMat::variance[12] [private]

Definition at line 77 of file AutoCorrMat.h.

Referenced by add(), and zero().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:14:50 2009 for CMSSW by  doxygen 1.5.4