202 const Waveform& waveform = dataRange.data();
205 fWaveformTool->triangleSmooth(rawDerivativeVec, derivativeVec);
237 for (
auto& hc : hitCandidateVec) {
239 if (startCand >= 0) hc.startTick =
std::max(hc.startTick,
size_t(startCand));
246 for (
auto& hitCandidate : hitCandidateVec) {
247 size_t centerIdx = hitCandidate.hitCenter;
249 hitCandidate.hitHeight = waveform.at(centerIdx);
256 size_t plane = wids[0].Plane;
257 size_t cryo = wids[0].Cryostat;
258 size_t tpc = wids[0].TPC;
259 size_t wire = wids[0].Wire;
265 Form(
"Event%04zu/c%1zuT%1zuP%1zu/Wire_%05zu", eventCount, cryo, tpc, plane, wire));
267 size_t waveformSize = waveform.size();
268 size_t waveStart = dataRange.begin_index();
271 dir.make<TProfile>(Form(
"HWfm_%03zu_roiStart-%05zu",
fChannelCnt, waveStart),
278 TProfile* derivHist =
279 dir.make<TProfile>(Form(
"HDer_%03zu_roiStart-%05zu",
fChannelCnt, waveStart),
286 TProfile* erosionHist =
287 dir.make<TProfile>(Form(
"HEro_%03zu_roiStart-%05zu",
fChannelCnt, waveStart),
294 TProfile* dilationHist =
295 dir.make<TProfile>(Form(
"HDil_%03zu_roiStart-%05zu",
fChannelCnt, waveStart),
302 TProfile* candHitHist =
303 dir.make<TProfile>(Form(
"HCan_%03zu_roiStart-%05zu",
fChannelCnt, waveStart),
310 TProfile* maxDerivHist =
311 dir.make<TProfile>(Form(
"HMax_%03zu_roiStart-%05zu",
fChannelCnt, waveStart),
318 TProfile* strtStopHist =
319 dir.make<TProfile>(Form(
"HSSS_%03zu_roiStart-%05zu",
fChannelCnt, waveStart),
328 for (
size_t idx = 0; idx < waveform.size(); idx++) {
329 waveHist->Fill(roiStartTick + idx, waveform.at(idx));
330 derivHist->Fill(roiStartTick + idx, derivativeVec.at(idx));
331 erosionHist->Fill(roiStartTick + idx, erosionVec.at(idx));
332 dilationHist->Fill(roiStartTick + idx, dilationVec.at(idx));
336 for (
const auto& hitCandidate : hitCandidateVec) {
337 candHitHist->Fill(hitCandidate.hitCenter, hitCandidate.hitHeight);
338 maxDerivHist->Fill(hitCandidate.maxTick, hitCandidate.maxDerivative);
339 maxDerivHist->Fill(hitCandidate.minTick, hitCandidate.minDerivative);
340 strtStopHist->Fill(hitCandidate.startTick, waveform.at(hitCandidate.startTick));
341 strtStopHist->Fill(hitCandidate.stopTick, waveform.at(hitCandidate.stopTick));
350 for (
const auto& hitCandidate : hitCandidateVec) {
351 fDStopStartHist->Fill(hitCandidate.stopTick - hitCandidate.startTick, 1.);
358 std::max_element(dilationVec.begin(), dilationVec.end());
360 std::max_element(erosionVec.begin(), erosionVec.end());
364 if (
std::abs(*maxDilationItr) > 0.) dilEroRat = *maxErosionItr / *maxDilationItr;
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)