CMS 3D CMS Logo

Public Member Functions | Private Attributes

AutoCorrMat Class Reference

#include <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.

               {
    for(int i=0;i<12;i++){
      Mat[i]=0.0;
      N[i]=0.0;
    }
  }
AutoCorrMat::~AutoCorrMat ( ) [inline]

Definition at line 22 of file AutoCorrMat.h.

{}

Member Function Documentation

void AutoCorrMat::add ( int *  adc) [inline]

Definition at line 37 of file AutoCorrMat.h.

References evar, evt, i, Mat, mymean, N, mathSSE::sqrt(), and variance.

Referenced by Chamber_AutoCorrMat::add().

                    {
    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}};
    double ped=(adc[0]+adc[1])/2.;
    evt++;      

    for(int i=3;i<8;i++){
      if(fabs(adc[i]-ped)<25.){
        evar[i]++;
        mymean[i]   += adc[i]-ped;
        variance[i] += (adc[i]-ped)*(adc[i]-ped);
      }
    }
    
    for(int i=0;i<12;i++){
      
      //Add values within 3 sigma of mean only
      float threeSigma0 = 3. * sqrt(variance[pairs[i][0]]/evar[pairs[i][0]]);
      float threeSigma1 = 3. * sqrt(variance[pairs[i][1]]/evar[pairs[i][1]]);
      
     if (fabs(adc[pairs[i][0]]-ped)<threeSigma0 && fabs(adc[pairs[i][1]]-ped)<threeSigma1){
        N[i]=N[i]+1;
        Mat[i]=Mat[i]+(adc[pairs[i][0]]-ped)*(adc[pairs[i][1]]-ped);
      }
      //end 3 sigma 
    }
  }
float* AutoCorrMat::mat ( ) [inline]

Definition at line 64 of file AutoCorrMat.h.

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

Referenced by Chamber_AutoCorrMat::autocorrmat().

              {
    float *tmp;
    for(int i=0;i<12;i++)tMat[i]=Mat[i]/N[i];
    tmp=tMat;
    return tmp; 
  }
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().

             {
   for(int i=0;i<12;i++){
     Mat[i]=0.0;
     N[i]=0.0;
    }
   for (int i=3;i<12;i++){
     evar[i]=1; 
     variance[i]=10.0;
     mymean[i]=3.2;
   }
   evt=0;
  }

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