CMS 3D CMS Logo

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::AutoCorrMat ( )
inline

Definition at line 15 of file AutoCorrMat.h.

15  {
16  for(int i=0;i<12;i++){
17  Mat[i]=0.0;
18  N[i]=0.0;
19  }
20  }

References mps_fire::i, Mat, and N.

◆ ~AutoCorrMat()

AutoCorrMat::~AutoCorrMat ( )
inline

Definition at line 22 of file AutoCorrMat.h.

22 {}

Member Function Documentation

◆ add()

void AutoCorrMat::add ( int *  adc)
inline

Definition at line 37 of file AutoCorrMat.h.

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  }

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

Referenced by Chamber_AutoCorrMat::add(), and counter.Counter::register().

◆ mat()

float* AutoCorrMat::mat ( )
inline

Definition at line 64 of file AutoCorrMat.h.

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  }

References mps_fire::i, Mat, N, tMat, and createJobs::tmp.

Referenced by Chamber_AutoCorrMat::autocorrmat().

◆ zero()

void AutoCorrMat::zero ( )
inline

Definition at line 24 of file AutoCorrMat.h.

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  }

References evar, evt, mps_fire::i, Mat, mymean, N, and variance.

Referenced by Chamber_AutoCorrMat::zero().

Member Data Documentation

◆ evar

int AutoCorrMat::evar[12]
private

Definition at line 79 of file AutoCorrMat.h.

Referenced by add(), and zero().

◆ evt

int AutoCorrMat::evt
private

Definition at line 78 of file AutoCorrMat.h.

Referenced by add(), and zero().

◆ Mat

float AutoCorrMat::Mat[12]
private

Definition at line 73 of file AutoCorrMat.h.

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

◆ mymean

float AutoCorrMat::mymean[12]
private

Definition at line 76 of file AutoCorrMat.h.

Referenced by add(), and zero().

◆ N

float AutoCorrMat::N[12]
private

Definition at line 74 of file AutoCorrMat.h.

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

◆ tMat

float AutoCorrMat::tMat[12]
private

Definition at line 75 of file AutoCorrMat.h.

Referenced by mat().

◆ variance

float AutoCorrMat::variance[12]
private

Definition at line 77 of file AutoCorrMat.h.

Referenced by add(), average.Average::uncertainty(), and zero().

ecalMGPA::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:11
mps_fire.i
i
Definition: mps_fire.py:355
AutoCorrMat::N
float N[12]
Definition: AutoCorrMat.h:74
AutoCorrMat::mymean
float mymean[12]
Definition: AutoCorrMat.h:76
AutoCorrMat::tMat
float tMat[12]
Definition: AutoCorrMat.h:75
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
AutoCorrMat::Mat
float Mat[12]
Definition: AutoCorrMat.h:73
AutoCorrMat::evt
int evt
Definition: AutoCorrMat.h:78
AutoCorrMat::variance
float variance[12]
Definition: AutoCorrMat.h:77
AutoCorrMat::evar
int evar[12]
Definition: AutoCorrMat.h:79