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);
154 double totalCharge = 0;
155 double totalEnergy = 0;
156 double correctedtotalCharge = 0;
157 double nElectrons = 0;
159 for (
auto const&
hit : hits) {
163 clockData, detProp,
hit->PeakTime());
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)
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.
double ElectronsFromADCArea(double area, unsigned short plane) const
constexpr double kGeVToElectrons
23.6eV per ion pair, 1e9 eV/GeV
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 LifetimeCorrection(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, double time, double T0=0) const
Collection of Physical constants used in LArSoft.
QTextStream & endl(QTextStream &s)