62 <<
"The number of planes does not match the size of the fcl parametes passed: Num Planes: " 80 const art::FindManyP<recob::Cluster>& fmc =
83 std::vector<art::Ptr<recob::Cluster>> clusters = fmc.at(pfparticle.
key());
86 const art::FindManyP<recob::Hit>& fmhc =
90 std::map<geo::PlaneID::PlaneID_t, std::vector<art::Ptr<recob::Hit>>> planeHits;
93 for (
auto const&
cluster : clusters) {
96 std::vector<art::Ptr<recob::Hit>> hits = fmhc.at(
cluster.key());
101 planeHits[plane].insert(planeHits[plane].
end(), hits.begin(), hits.end());
106 unsigned int bestPlaneNumHits = 0;
109 std::vector<double> energyVec(
fNumPlanes, -999.);
110 std::vector<double> energyError(
fNumPlanes, -999.);
112 auto const clockData =
117 for (
auto const& [plane, hits] : planeHits) {
119 unsigned int planeNumHits = hits.size();
124 if (Energy > 0) energyVec.at(plane) = Energy;
126 if (planeNumHits > bestPlaneNumHits) {
128 bestPlaneNumHits = planeNumHits;
134 if (bestPlane < fGeom->Nplanes()) {
137 int bestPlaneVal(bestPlane);
153 double totalCharge = 0, totalEnergy = 0;
155 for (
auto const&
hit : hits) {
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.
void SetElement(T &dataproduct, const std::string &Name, bool checktag=false)
double ElectronLifetime() const
Set of hits with a 2D structure.
const art::FindManyP< T1 > & GetFindManyP(const art::ValidHandle< std::vector< T2 > > &handle, const art::Event &evt, const art::InputTag &moduleTag)
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)
Detector simulation of raw signals on wires.
Contains all timing reference information for the detector.
2D representation of charge deposited in the TDC/wire plane
auto const & get(AssnsNode< L, R, D > const &r)
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
cet::coded_exception< error, detail::translate > exception