60 auto pfpHandle =
evt.getValidHandle<std::vector<recob::PFParticle>>(
fPFPtag);
61 auto clsHandle =
evt.getValidHandle<std::vector<recob::Cluster>>(
fPFPtag);
63 art::FindManyP<recob::Cluster> pfp_cls(pfpHandle,
evt,
fPFPtag);
64 art::FindManyP<recob::Hit> cls_hit(clsHandle,
evt,
fPFPtag);
66 auto sphitassn = std::make_unique<art::Assns<recob::SpacePoint, recob::Hit>>();
67 auto spts = std::make_unique<std::vector<recob::SpacePoint>>();
69 auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(
evt);
71 art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(
evt, clockData);
73 art::PtrVector<recob::Hit> hits;
74 for (
unsigned short ipfp = 0; ipfp < pfpHandle->size(); ++ipfp) {
76 std::vector<art::Ptr<recob::Cluster>> clsList;
77 pfp_cls.get(ipfp, clsList);
80 for (
unsigned short icl = 0; icl < clsList.size(); ++icl) {
81 std::vector<art::Ptr<recob::Hit>> hitList;
82 unsigned int clsIndex = clsList[icl]->ID() - 1;
83 cls_hit.get(clsIndex, hitList);
84 std::cout <<
" cls index " << clsIndex <<
" hits size " << hitList.size() <<
" "
85 << (int)clsList[icl]->StartWire() <<
":" << (int)clsList[icl]->
StartTick()
86 <<
" EndWire " << (int)clsList[icl]->EndWire() <<
":"
87 << (int)clsList[icl]->EndTick() <<
"\n";
88 hits.reserve(hits.size() + hitList.size());
89 hits.insert(hits.end(), hitList.begin(), hitList.end());
92 std::vector<recob::SpacePoint> new_spts;
94 if (new_spts.empty())
continue;
96 int nspt = spts->size();
97 spts->insert(spts->end(), new_spts.begin(), new_spts.end());
99 art::PtrVector<recob::SpacePoint> sptvec;
100 for (
unsigned int ispt = nspt; ispt < spts->size(); ++ispt) {
107 evt.put(std::move(spts));
108 evt.put(std::move(sphitassn));
const art::PtrVector< recob::Hit > & getAssociatedHits(const recob::SpacePoint &spt) const
void makeSpacePoints(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const art::PtrVector< recob::Hit > &hits, std::vector< recob::SpacePoint > &spts) const
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.
BEGIN_PROLOG could also be cout