76 <<
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Shower Reco Energy Tool ~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 88 std::vector<art::Ptr<recob::Cluster>> clusters = fmc.at(pfparticle.
key());
95 std::map<geo::PlaneID::PlaneID_t, std::vector<art::Ptr<recob::Hit>>> planeHits;
98 for (
auto const&
cluster : clusters) {
101 std::vector<art::Ptr<recob::Hit>>
hits = fmhc.at(
cluster.key());
106 planeHits[plane].insert(planeHits[plane].
end(), hits.begin(), hits.end());
111 unsigned int bestPlaneNumHits = 0;
117 auto const clockData =
122 for (
auto const& [plane,
hits] : planeHits) {
124 unsigned int planeNumHits =
hits.size();
129 if (Energy > 0) energyVec.at(plane) = Energy;
131 if (planeNumHits > bestPlaneNumHits) {
133 bestPlaneNumHits = planeNumHits;
142 int bestPlaneVal(bestPlane);
156 double totalCharge = 0;
157 double totalEnergy = 0;
158 double correctedtotalCharge = 0;
159 double nElectrons = 0;
165 clockData, detProp,
hit->PeakTime());
unsigned int PlaneID_t
Type for the ID number.
void SetElement(T &dataproduct, const std::string &Name, bool checktag=false)
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
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
Interface for a class providing readout channel mapping to geometry.
key_type key() const noexcept
Declaration of cluster object.
Detector simulation of raw signals on wires.
unsigned int Nplanes(TPCID const &tpcid=details::tpc_zero) const
Returns the total number of planes in the specified TPC.
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.
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)