82 auto spptCollection = std::make_unique<std::vector<recob::SpacePoint>>();
83 auto spptAssociatedHits = std::make_unique<std::vector<std::vector<art::Ptr<recob::Hit>>>>();
86 art::Handle<std::vector<recob::Hit>> hitHandle_U;
88 std::vector<art::Ptr<recob::Hit>> hitVec_U;
89 art::fill_ptr_vector(hitVec_U, hitHandle_U);
91 art::Handle<std::vector<recob::Hit>> hitHandle_V;
93 std::vector<art::Ptr<recob::Hit>> hitVec_V;
94 art::fill_ptr_vector(hitVec_V, hitHandle_V);
96 art::Handle<std::vector<recob::Hit>> hitHandle_Y;
98 std::vector<art::Ptr<recob::Hit>> hitVec_Y;
99 art::fill_ptr_vector(hitVec_Y, hitHandle_Y);
101 MF_LOG_DEBUG(
"TTSpacePointFinder") <<
"Got handles to hits:\n"
102 << hitVec_U.size() <<
" u hits, " << hitVec_V.size()
103 <<
" v hits, " << hitVec_Y.size() <<
" y hits.";
106 art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(
evt);
108 detProp, hitVec_U, hitVec_V, hitVec_Y, spptCollection, spptAssociatedHits);
110 mf::LogInfo(
"TTSpacePointFinder")
111 <<
"Finished spacepoint alg. Created " << spptCollection->size() <<
" spacepoints.";
114 if (spptCollection->size() != spptAssociatedHits->size()) {
115 mf::LogError(
"TTSpacePointFinder")
116 <<
"ERROR in space point alg.\n"
117 <<
"Spacepoint and associated hit collections have different sizes!\n"
118 << spptCollection->size() <<
" != " << spptAssociatedHits->size()
119 <<
"\nWill return with no space points put on event.";
124 std::unique_ptr<art::Assns<recob::SpacePoint, recob::Hit>> spptAssns(
125 new art::Assns<recob::SpacePoint, recob::Hit>);
126 for (
unsigned int isppt = 0; isppt < spptCollection->size(); isppt++) {
131 evt.put(std::move(spptCollection));
132 evt.put(std::move(spptAssns));
std::string fHitModuleLabel
std::string fYHitsInstanceLabel
Input V hits instance name.
std::string fVHitsInstanceLabel
Input U hits instance name.
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::string fUHitsInstanceLabel
Input hit module name.
void createSpacePoints(detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit >> &hitVec_U, std::vector< art::Ptr< recob::Hit >> &hitVec_V, std::vector< art::Ptr< recob::Hit >> &hitVec_Y, std::unique_ptr< std::vector< recob::SpacePoint >> &spptCollection, std::unique_ptr< std::vector< std::vector< art::Ptr< recob::Hit >>>> &spptAssociatedHits)
SpacePointAlg_TimeSort fSpptAlg
Input Y hits instance name.