79 auto const pfpHandle = Event.getValidHandle<std::vector<recob::PFParticle>>(
fPFParticleLabel);
82 auto const clusHandle = Event.getValidHandle<std::vector<recob::Cluster>>(
fPFParticleLabel);
84 const art::FindManyP<recob::Cluster>& fmc =
87 std::vector<art::Ptr<recob::Cluster>> clusters = fmc.at(pfparticle.key());
90 const art::FindManyP<recob::Hit>& fmhc =
94 std::map<geo::PlaneID::PlaneID_t, std::vector<art::Ptr<recob::Hit>>> planeHits;
97 for (
auto const&
cluster : clusters) {
100 std::vector<art::Ptr<recob::Hit>> hits = fmhc.at(
cluster.key());
105 planeHits[plane].insert(planeHits[plane].
end(), hits.begin(), hits.end());
110 unsigned int bestPlaneNumHits = 0;
113 std::vector<double> energyVec(
fNumPlanes, -999.);
114 std::vector<double> energyError(
fNumPlanes, -999.);
116 auto const clockData =
117 art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(Event);
119 art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(Event, clockData);
121 for (
auto const& [plane, hits] : planeHits) {
123 unsigned int planeNumHits = hits.size();
128 if (Energy > 0) energyVec.at(plane) =
Energy;
130 if (planeNumHits > bestPlaneNumHits) {
132 bestPlaneNumHits = planeNumHits;
138 if (bestPlane < fGeom->Nplanes()) {
141 int bestPlaneVal(bestPlane);
unsigned int PlaneID_t
Type for the ID number.
Set of hits with a 2D structure.
auto end(FixedBins< T, C > const &) noexcept
2D representation of charge deposited in the TDC/wire plane