73 <<
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Shower Reco Energy Tool ~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 82 const art::FindManyP<recob::Cluster>& fmc =
85 std::vector<art::Ptr<recob::Cluster>> clusters = fmc.at(pfparticle.
key());
88 const art::FindManyP<recob::Hit>& fmhc =
92 std::map<geo::PlaneID::PlaneID_t, std::vector<art::Ptr<recob::Hit>>> planeHits;
95 for (
auto const&
cluster : clusters) {
98 std::vector<art::Ptr<recob::Hit>> hits = fmhc.at(
cluster.key());
103 planeHits[plane].insert(planeHits[plane].
end(), hits.begin(), hits.end());
108 unsigned int bestPlaneNumHits = 0;
112 std::vector<double> energyError(
fGeom->
Nplanes(), -999.);
114 auto const clockData =
119 for (
auto const& [plane, hits] : planeHits) {
121 unsigned int planeNumHits = hits.size();
126 if (Energy > 0) energyVec.at(plane) = Energy;
128 if (planeNumHits > bestPlaneNumHits) {
130 bestPlaneNumHits = planeNumHits;
136 if (bestPlane < fGeom->Nplanes()) {
139 int bestPlaneVal(bestPlane);
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
unsigned int PlaneID_t
Type for the ID number.
Set of hits with a 2D structure.
Cluster finding and building.
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
key_type key() const noexcept
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
static int max(int a, int b)
2D representation of charge deposited in the TDC/wire plane
QTextStream & endl(QTextStream &s)