CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
AutoCorrMat Class Reference

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

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.

15  {
16  for(int i=0;i<12;i++){
17  Mat[i]=0.0;
18  N[i]=0.0;
19  }
20  }
int i
Definition: DBlmapReader.cc:9
float N[12]
Definition: AutoCorrMat.h:74
float Mat[12]
Definition: AutoCorrMat.h:73
AutoCorrMat::~AutoCorrMat ( )
inline

Definition at line 22 of file AutoCorrMat.h.

22 {}

Member Function Documentation

void AutoCorrMat::add ( int *  adc)
inline

Definition at line 37 of file AutoCorrMat.h.

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

Referenced by Chamber_AutoCorrMat::add().

37  {
38  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}};
39  double ped=(adc[0]+adc[1])/2.;
40  evt++;
41 
42  for(int i=3;i<8;i++){
43  if(fabs(adc[i]-ped)<25.){
44  evar[i]++;
45  mymean[i] += adc[i]-ped;
46  variance[i] += (adc[i]-ped)*(adc[i]-ped);
47  }
48  }
49 
50  for(int i=0;i<12;i++){
51 
52  //Add values within 3 sigma of mean only
53  float threeSigma0 = 3. * sqrt(variance[pairs[i][0]]/evar[pairs[i][0]]);
54  float threeSigma1 = 3. * sqrt(variance[pairs[i][1]]/evar[pairs[i][1]]);
55 
56  if (fabs(adc[pairs[i][0]]-ped)<threeSigma0 && fabs(adc[pairs[i][1]]-ped)<threeSigma1){
57  N[i]=N[i]+1;
58  Mat[i]=Mat[i]+(adc[pairs[i][0]]-ped)*(adc[pairs[i][1]]-ped);
59  }
60  //end 3 sigma
61  }
62  }
int adc(sample_type sample)
get the ADC sample (12 bits)
float mymean[12]
Definition: AutoCorrMat.h:76
int i
Definition: DBlmapReader.cc:9
int evar[12]
Definition: AutoCorrMat.h:79
float N[12]
Definition: AutoCorrMat.h:74
T sqrt(T t)
Definition: SSEVec.h:48
float variance[12]
Definition: AutoCorrMat.h:77
float Mat[12]
Definition: AutoCorrMat.h:73
list pairs
sort tag files by run number
float* AutoCorrMat::mat ( )
inline

Definition at line 64 of file AutoCorrMat.h.

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

Referenced by Chamber_AutoCorrMat::autocorrmat().

64  {
65  float *tmp;
66  for(int i=0;i<12;i++)tMat[i]=Mat[i]/N[i];
67  tmp=tMat;
68  return tmp;
69  }
float tMat[12]
Definition: AutoCorrMat.h:75
int i
Definition: DBlmapReader.cc:9
float N[12]
Definition: AutoCorrMat.h:74
float Mat[12]
Definition: AutoCorrMat.h:73
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
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().

24  {
25  for(int i=0;i<12;i++){
26  Mat[i]=0.0;
27  N[i]=0.0;
28  }
29  for (int i=3;i<12;i++){
30  evar[i]=1;
31  variance[i]=10.0;
32  mymean[i]=3.2;
33  }
34  evt=0;
35  }
float mymean[12]
Definition: AutoCorrMat.h:76
int i
Definition: DBlmapReader.cc:9
int evar[12]
Definition: AutoCorrMat.h:79
float N[12]
Definition: AutoCorrMat.h:74
float variance[12]
Definition: AutoCorrMat.h:77
float Mat[12]
Definition: AutoCorrMat.h:73

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