113 std::vector<float> meanVec;
115 meanVec.resize(dataVec.size(), 0);
116 std::vector<float>::iterator meanVecItr = meanVec.begin();
120 float runningSum(0.);
122 for(
size_t idx = 0; idx < halfStructure - 1; idx++) runningSum += dataVec[idx];
125 for(RawDigitVector::iterator dataItr = dataVec.begin(); dataItr != dataVec.end(); dataItr++)
129 size_t count = std::min(2 * halfStructure, std::min(startOffset + halfStructure, halfStructure + stopOffset));
131 if (startOffset > halfStructure) runningSum -= *(dataItr - halfStructure - 1);
132 if (stopOffset >= halfStructure) runningSum += *(dataItr + halfStructure - 1);
134 float adaptVal = runningSum / float(count) - truncMean;
136 *meanVecItr++ = adaptVal;
140 for(
size_t idx = 0; idx < dataVec.size(); idx++)
141 dataVec[idx] = dataVec[idx] - std::round(meanVec[idx]);
void getMeanAndRms(const RawDigitVector &rawWaveform, float &aveVal, float &rmsVal, int &numBins) const
size_t fStructuringElement
Structuring element to use with Top Hat filter.
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
RawDigitCharacterizationAlg fCharacterizationAlg
std::size_t count(Cont const &cont)