79 art::Handle<std::vector<recob::Track>> trackHandle;
81 std::vector<recob::Track>
const& trackVector(*trackHandle);
84 art::Handle<std::vector<recob::Hit>> hitHandle;
86 std::vector<recob::Hit>
const& hitVector(*hitHandle);
89 art::Handle<art::Assns<recob::Track, recob::Hit>> assnTrackHitHandle;
91 std::vector<std::vector<size_t>> hit_indices_per_track =
95 std::unique_ptr<std::vector<anab::Calorimetry>> caloPtr(
new std::vector<anab::Calorimetry>);
96 std::vector<anab::Calorimetry>& caloVector(*caloPtr);
101 std::vector<size_t> assnTrackCaloVector;
102 std::unique_ptr<art::Assns<recob::Track, anab::Calorimetry>> assnTrackCaloPtr(
103 new art::Assns<recob::Track, anab::Calorimetry>);
105 auto const clock_data = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(
e);
106 auto const det_prop =
107 art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(
e, clock_data);
113 hit_indices_per_track,
116 lar::extractProviders<geo::Geometry, detinfo::LArPropertiesService>());
119 for (
size_t calo_iter = 0; calo_iter < assnTrackCaloVector.size(); calo_iter++) {
120 if (assnTrackCaloVector[calo_iter] == std::numeric_limits<size_t>::max())
continue;
121 art::Ptr<recob::Track> trk_ptr(trackHandle, assnTrackCaloVector[calo_iter]);
125 e.put(std::move(caloPtr));
126 e.put(std::move(assnTrackCaloPtr));
std::string fHitModuleLabel
void ExtractCalorimetry(detinfo::DetectorClocksData const &clock_data, detinfo::DetectorPropertiesData const &det_prop, std::vector< recob::Track > const &, std::vector< recob::Hit > const &, std::vector< std::vector< size_t >> const &, std::vector< anab::Calorimetry > &, std::vector< size_t > &, Providers_t providers)
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
std::vector< std::vector< size_t > > GetAssociatedVectorManyI(art::Handle< art::Assns< T, U > > h, art::Handle< std::vector< T > > index_p)
TrackCalorimetryAlg fTrackCaloAlg
std::string fTrackModuleLabel