82 std::vector<float> locWaveform;
84 locWaveform.resize(opDetWaveform.size());
87 std::transform(opDetWaveform.begin(),opDetWaveform.end(),locWaveform.begin(),[
baseline](
const auto& val){
return baseline - val;});
89 std::pair<std::vector<float>::iterator,std::vector<float>::iterator> minMaxItr = std::minmax_element(locWaveform.begin(),locWaveform.end());
94 bool notSaturated(
true);
96 float maxAdc = *minMaxItr.second;
97 float minAdc = *minMaxItr.first;
101 float unSatAdc = 0.5 * (maxAdc - minAdc) + minAdc;
102 std::vector<float>::iterator unSatItr = std::find_if(minMaxItr.second,locWaveform.end(),[unSatAdc](
const auto& elem){
return elem < unSatAdc;});
111 std::vector<float> tempVec = locWaveform;
112 recob::Wire::RegionsOfInterest_t::datarange_t rangeData(
size_t(0),std::move(tempVec));
115 fHitFinderTool->MergeHitCandidates(rangeData, hitCandidateVec, mergedCandidateHitVec);
128 hitCandidate.
hitSigma = std::min(40,numSatChans);
129 hitCandidate.
hitHeight = maxAdc - minAdc;
131 std::cout <<
"***>> Saturated PMT, numSatChans: " << numSatChans <<
", range: " << maxAdc-minAdc << std::endl;
133 hitCandidateVec.push_back(hitCandidate);
134 mergedCandidateHitVec.push_back(hitCandidateVec);
143 for(
const auto& mergedCands : mergedCandidateHitVec)
145 for(
const auto& candidateHit : mergedCands)
147 float peakMean = candidateHit.hitCenter;
148 float peakSigma = candidateHit.hitSigma;
149 float amplitude = candidateHit.hitHeight;
150 float peakArea = amplitude * peakSigma * 2.5066;
151 float nPhotoElec = peakArea /
fSPEArea;
153 float peakTimeAbs = peakMean;
155 float fastTotal = 0.;
157 opHitVec.emplace_back(chNumber, peakMean, peakTimeAbs, frame, 2.35 * peakSigma, peakArea, amplitude, nPhotoElec, fastTotal);
float getBaseline(const raw::OpDetWaveform &) const
std::unique_ptr< reco_tool::ICandidateHitFinder > fHitFinderTool
For finding candidate hits.
double distance(geo::Point_t const &point, CathodeDesc_t const &cathode)
Returns the distance of a point from the cathode.
BEGIN_PROLOG could also be cout