83 produces<dune::EnergyRecoOutput>();
84 produces<art::Assns<dune::EnergyRecoOutput, recob::Track>>();
85 produces<art::Assns<dune::EnergyRecoOutput, recob::Shower>>();
92 std::unique_ptr<dune::EnergyRecoOutput> energyRecoOutput;
93 auto assnstrk = std::make_unique<art::Assns<dune::EnergyRecoOutput, recob::Track>>();
94 auto assnsshw = std::make_unique<art::Assns<dune::EnergyRecoOutput, recob::Shower>>();
111 if (longestTrack.
isAvailable()) assnstrk->addSingle(EnergyRecoOutputPtr, longestTrack);
112 if (highestChargeShower.
isAvailable()) assnsshw->addSingle(EnergyRecoOutputPtr, highestChargeShower);
124 if (0 == tracks.size())
127 double longestLength(std::numeric_limits<double>::lowest());
128 for (
unsigned int iTrack = 0; iTrack < tracks.size(); ++iTrack)
130 const double length(tracks[iTrack]->
Length());
131 if (length-longestLength > std::numeric_limits<double>::epsilon())
133 longestLength = length;
134 pTrack = tracks[iTrack];
148 if (0 == showers.size())
151 double maxCharge(std::numeric_limits<double>::lowest());
152 for (
unsigned int iShower = 0; iShower < showers.size(); ++iShower)
157 if (showerCharge-maxCharge > std::numeric_limits<double>::epsilon())
159 maxCharge = showerCharge;
160 pShower = showers[iShower];
170 #endif // EnergyReco_H
float Length(const PFPStruct &pfp)
Utility containing helpful functions for end users to access information about Hits.
ProductID getProductID(std::string const &instance_name="") const
NeutrinoEnergyRecoAlg class.
EDProducer(fhicl::ParameterSet const &pset)
std::string fTrackToHitLabel
art::Ptr< recob::Shower > GetHighestChargeShower(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const art::Event &event)
void produce(art::Event &evt) override
art framework interface to geometry description
static std::vector< art::Ptr< recob::Track > > GetTracks(const art::Event &evt, const std::string &label)
Get the tracks from the event. This function shouldn't be used as the basis of an analysis...
#define DEFINE_ART_MODULE(klass)
Utility containing helpful functions for end users to access information about Showers.
EDProductGetter const * productGetter(ProductID const pid) const
art::Ptr< recob::Track > GetLongestTrack(const art::Event &event)
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Utility containing helpful functions for end users to access products from events.
NeutrinoEnergyRecoAlg fNeutrinoEnergyRecoAlg
static double LifetimeCorrectedTotalHitCharge(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit > > &hits)
get the total hit charge, corrected for lifetime
Header file for the neutrino energy reconstruction algorithm. A heavily refactored version of Nick Gr...
Declaration of signal hit object.
static std::vector< art::Ptr< recob::Hit > > GetHits(const art::Ptr< recob::Shower > &pShower, const art::Event &evt, const std::string &label)
Get the hits associated with the shower.
Contains all timing reference information for the detector.
std::string fShowerToHitLabel
Provides recob::Track data product.
Declaration of basic channel signal object.
static std::vector< art::Ptr< recob::Shower > > GetShowers(const art::Event &evt, const std::string &label)
Get the showers from the event. This function shouldn't be used as the basis of an analysis...
EnergyReco(fhicl::ParameterSet const &pset)
auto const & get(AssnsNode< L, R, D > const &r)
std::string fHitToSpacePointLabel
Event finding and building.
dune::EnergyRecoOutput CalculateNeutrinoEnergy(const art::Ptr< recob::Track > &pMuonTrack, const art::Event &event)
Calculates neutrino energy using a muon track (the muon track may be ignored if it isn't of a suitabl...
static std::vector< art::Ptr< recob::Hit > > GetHitsOnPlane(const std::vector< art::Ptr< recob::Hit >> &hits, const geo::PlaneID::PlaneID_t planeID)
Get all hits on a specific plane.