2398 HitInfo(): charge(0), multiplicity(0), width(0), start(0),
end(0), time(0.), nhit(0) {}
2401 std::map<unsigned, HitInfo> hit_map_u;
2402 std::map<unsigned, HitInfo> hit_map_v;
2403 std::map<unsigned, HitInfo> hit_map_y;
2405 for (
const art::Ptr<recob::Hit>
hit: hits) {
2406 if (
hit->WireID().Plane == 0) {
2408 if (!use_integral && hit_map_u[
hit->Channel()].start ==
hit->StartTick() && hit_map_u[
hit->Channel()].end ==
hit->EndTick()) {
2411 hit_map_u[
hit->Channel()].charge += (use_integral) ?
hit->Integral() :
hit->SummedADC();
2412 hit_map_u[
hit->Channel()].multiplicity = std::max(hit_map_u[
hit->Channel()].multiplicity, (int)
hit->Multiplicity());
2413 hit_map_u[
hit->Channel()].start = hit_map_u[
hit->Channel()].nhit ? std::min(hit_map_u[
hit->Channel()].start,
hit->StartTick()) :
hit->StartTick();
2414 hit_map_u[
hit->Channel()].end = hit_map_u[
hit->Channel()].nhit ? std::max(hit_map_u[
hit->Channel()].end,
hit->EndTick()) :
hit->EndTick();
2415 hit_map_u[
hit->Channel()].width = (hit_map_u[
hit->Channel()].end - hit_map_u[
hit->Channel()].start);
2416 hit_map_u[
hit->Channel()].time = (
hit->PeakTime() + hit_map_u[
hit->Channel()].time * hit_map_u[
hit->Channel()].nhit) / (hit_map_u[
hit->Channel()].nhit + 1);
2417 hit_map_u[
hit->Channel()].nhit ++;
2418 hit_map_u[
hit->Channel()].wire =
hit->WireID().Wire;
2420 else if (
hit->WireID().Plane == 1) {
2422 if (!use_integral && hit_map_v[
hit->Channel()].start ==
hit->StartTick() && hit_map_v[
hit->Channel()].end ==
hit->EndTick()) {
2425 hit_map_v[
hit->Channel()].charge += (use_integral) ?
hit->Integral() :
hit->SummedADC();
2426 hit_map_v[
hit->Channel()].multiplicity = std::max(hit_map_v[
hit->Channel()].multiplicity, (int)
hit->Multiplicity());
2427 hit_map_v[
hit->Channel()].start = hit_map_v[
hit->Channel()].nhit ? std::min(hit_map_v[
hit->Channel()].start,
hit->StartTick()) :
hit->StartTick();
2428 hit_map_v[
hit->Channel()].end = hit_map_v[
hit->Channel()].nhit ? std::max(hit_map_v[
hit->Channel()].end,
hit->EndTick()) :
hit->EndTick();
2429 hit_map_v[
hit->Channel()].width = (hit_map_v[
hit->Channel()].end - hit_map_v[
hit->Channel()].start);
2430 hit_map_v[
hit->Channel()].time = (
hit->PeakTime() + hit_map_v[
hit->Channel()].time * hit_map_v[
hit->Channel()].nhit) / (hit_map_v[
hit->Channel()].nhit + 1);
2431 hit_map_v[
hit->Channel()].nhit ++;
2432 hit_map_v[
hit->Channel()].wire =
hit->WireID().Wire;
2436 if (!use_integral && hit_map_y[
hit->Channel()].start ==
hit->StartTick() && hit_map_y[
hit->Channel()].end ==
hit->EndTick()) {
2439 hit_map_y[
hit->Channel()].charge += (use_integral) ?
hit->Integral() :
hit->SummedADC();
2440 hit_map_y[
hit->Channel()].multiplicity = std::max(hit_map_y[
hit->Channel()].multiplicity, (int)
hit->Multiplicity());
2441 hit_map_y[
hit->Channel()].start = hit_map_y[
hit->Channel()].nhit ? std::min(hit_map_y[
hit->Channel()].start,
hit->StartTick()) :
hit->StartTick();
2442 hit_map_y[
hit->Channel()].end = hit_map_y[
hit->Channel()].nhit ? std::max(hit_map_y[
hit->Channel()].end,
hit->EndTick()) :
hit->EndTick();
2443 hit_map_y[
hit->Channel()].width = (hit_map_y[
hit->Channel()].end - hit_map_y[
hit->Channel()].start);
2444 hit_map_y[
hit->Channel()].time = (
hit->PeakTime() + hit_map_y[
hit->Channel()].time * hit_map_y[
hit->Channel()].nhit) / (hit_map_y[
hit->Channel()].nhit + 1);
2445 hit_map_y[
hit->Channel()].nhit ++;
2446 hit_map_y[
hit->Channel()].wire =
hit->WireID().Wire;
2450 for (
auto const &pair: hit_map_u) {
2451 channel_u.push_back(pair.first);
2452 charge_u.push_back(pair.second.charge);
2453 multiplicity_u.push_back(pair.second.multiplicity);
2454 width_u.push_back(pair.second.width);
2455 time_u.push_back(pair.second.time);
2456 nhit_u.push_back(pair.second.nhit);
2457 wire_u.push_back(pair.second.wire);
2459 for (
auto const &pair: hit_map_v) {
2460 channel_v.push_back(pair.first);
2461 charge_v.push_back(pair.second.charge);
2462 multiplicity_v.push_back(pair.second.multiplicity);
2463 width_v.push_back(pair.second.width);
2464 time_v.push_back(pair.second.time);
2465 nhit_v.push_back(pair.second.nhit);
2466 wire_v.push_back(pair.second.wire);
2468 for (
auto const &pair: hit_map_y) {
2469 channel_y.push_back(pair.first);
2470 charge_y.push_back(pair.second.charge);
2471 multiplicity_y.push_back(pair.second.multiplicity);
2472 width_y.push_back(pair.second.width);
2473 time_y.push_back(pair.second.time);
2474 nhit_y.push_back(pair.second.nhit);
2475 wire_y.push_back(pair.second.wire);
auto end(FixedBins< T, C > const &) noexcept