75 <<
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Shower Reco Energy Tool ~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 87 std::vector<art::Ptr<recob::Cluster>> clusters = fmc.at(pfparticle.
key());
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;
114 std::vector<double> energyError(
fGeom->
Nplanes(), -999.);
116 auto const 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);
155 double totalCharge = 0;
156 double totalEnergy = 0;
157 double correctedtotalCharge = 0;
158 double nElectrons = 0;
164 clockData, detProp,
hit->PeakTime());
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.
Cluster finding and building.
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
double ElectronsFromADCArea(double area, unsigned short plane) const
constexpr double kGeVToElectrons
23.6eV per ion pair, 1e9 eV/GeV
key_type key() const noexcept
Declaration of cluster object.
Detector simulation of raw signals on wires.
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
decltype(auto) get(T &&obj)
ADL-aware version of std::to_string.
Contains all timing reference information for the detector.
unsigned int Nplanes(TPCID const &tpcid=tpc_zero) const
Returns the total number of planes in the specified TPC.
2D representation of charge deposited in the TDC/wire plane
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.
const art::FindManyP< T1 > & GetFindManyP(const art::ValidHandle< std::vector< T2 >> &handle, const art::Event &evt, const art::InputTag &moduleTag)