172 Waveform waveformDeriv(waveform.size());
178 else std::copy(waveform.begin(),waveform.end(),waveformDeriv.begin());
195 fWaveformTool.getTruncatedMean(aveWaveformDeriv, truncMean, nTrunc, range);
196 fWaveformTool.getTruncatedRMS(aveWaveformDeriv, nSig, fullRMS, truncRMS, nTrunc);
199 float truncRMSFloor = std::max(truncRMS,
float(0.25));
202 findROICandidates(aveWaveformDeriv.begin(),aveWaveformDeriv.end(),channel,0,truncRMSFloor,roiVec);
204 TProfile* roiHist(0);
213 size_t wire = wids[0].Wire;
221 TProfile* waveformHist = dir.make<TProfile>(Form(
"Wfm_%03zu_c%05zu",cnt,wire),
"Waveform", waveform.size(), 0, waveform.size(), -500., 500.);
222 TProfile* derivativeHist = dir.make<TProfile>(Form(
"Der_%03zu_c%05zu",cnt,wire),
"Derivative", waveformDeriv.size(), 0, waveformDeriv.size(), -500., 500.);
223 TProfile* aveDerivHist = dir.make<TProfile>(Form(
"Ave_%03zu_c%05zu",cnt,wire),
"AveDeriv", aveWaveformDeriv.size(), 0, aveWaveformDeriv.size(), -500., 500.);
225 roiHist = dir.make<TProfile>(Form(
"ROI_%03zu_c%05zu",cnt,wire),
"ROI", waveform.size(), 0, waveform.size(), -500., 500.);
227 for(
size_t binIdx = 0; binIdx < waveform.size(); binIdx++)
229 waveformHist->Fill(binIdx, waveform.at(binIdx));
230 derivativeHist->Fill(binIdx, waveformDeriv.at(binIdx));
235 for(
const auto& val : aveWaveformDeriv) aveDerivHist->Fill(binIdx++, val);
239 std::cout <<
"Caught exception trying to make new hists, plane,cnt,wire: " <<
fPlane <<
", " << cnt <<
", " << wire << std::endl;
243 if (roiVec.empty())
return;
248 for(
auto& roi : roiVec)
252 roiHist->Fill(
int(nMultiplier * roi.first), std::max(3.*truncRMS,1.));
253 roiHist->Fill(
int(nMultiplier * roi.second), std::max(3.*truncRMS,1.));
257 roi.first = std::max(
int(nMultiplier * roi.first -
fPreROIPad),0);
263 if(roiVec.size() > 1)
269 size_t startRoi = roiVec.front().first;
270 size_t stopRoi = startRoi;
272 for(
auto& roi : roiVec)
274 if (roi.first <= stopRoi +
fMaxTicksGap) stopRoi = roi.second;
279 startRoi = roi.first;
280 stopRoi = roi.second;
The data type to uniquely identify a Plane.
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
SigType_t SignalType(geo::PlaneID const &pid) const
Returns the type of signal on the channels of specified TPC plane.
enum geo::_plane_sigtype SigType_t
BEGIN_PROLOG could also be cout
Signal from collection planes.