33 #include "StSvtHybridPixels.hh"
34 #include "StSvtHybridStat2.hh"
43 mNumberOfCapacitors = 128;
53 for (
int i = 0; i < mNumberOfCapacitors; i++) {
59 m0->push_back(m0PerCapacitor);
60 m1->push_back(m1PerCapacitor);
61 m2->push_back(m2PerCapacitor);
65 StSvtHybridStat2::~StSvtHybridStat2()
80 float StSvtHybridStat2::getMean(
int anode,
int time,
int capacitor)
87 int index = m0PerCapacitor->getPixelIndex(anode,time);
88 int n = (int)m0PerCapacitor->At(index);
89 int sum = (int)m1PerCapacitor->At(index);
94 mean = (float)sum/(
float)n;
101 float StSvtHybridStat2::getRMS(
int anode,
int time,
int capacitor)
109 int index = m0PerCapacitor->getPixelIndex(anode,time);
110 int n = (int)m0PerCapacitor->At(index);
111 int sum = (int)m1PerCapacitor->At(index);
112 int sumSQ = (int)m2PerCapacitor->At(index);
118 mean = (float)sum/(
float)n;
119 meanSQ = (float)sumSQ/(
float)n;
124 float rms = ::sqrt(meanSQ - mean*mean);
129 void StSvtHybridStat2::fillMom(
int x,
int anode,
int time,
int capacitor)
138 int index = m0PerCapacitor->getPixelIndex(anode,time);
140 previousValue = (int)m0PerCapacitor->At(index);
141 m0PerCapacitor->AddAt(1+previousValue,index);
143 previousValue = (int)m1PerCapacitor->At(index);
144 m1PerCapacitor->AddAt(x+previousValue,index);
146 previousValue = (int)m2PerCapacitor->At(index);
147 m2PerCapacitor->AddAt(x*x+previousValue,index);
150 void StSvtHybridStat2::reset()