23 #include "art/Framework/Core/EDProducer.h"
24 #include "art/Framework/Core/ModuleMacros.h"
25 #include "art/Framework/Principal/Event.h"
26 #include "art/Framework/Principal/Handle.h"
27 #include "canvas/Persistency/Common/Assns.h"
28 #include "canvas/Persistency/Common/Ptr.h"
29 #include "canvas/Persistency/Common/PtrVector.h"
30 #include "messagefacility/MessageLogger/MessageLogger.h"
31 #include "fhiclcpp/ParameterSet.h"
69 , fEPAlg(pset.get< fhicl::ParameterSet >(
"EndPointAlg"))
71 fDBScanModuleLabel = pset.get<std::string>(
"DBScanModuleLabel");
73 produces< std::vector<recob::EndPoint2D> >();
74 produces< art::Assns<recob::EndPoint2D, recob::Hit> >();
82 art::Handle< std::vector<recob::Cluster> > clusterListHandle;
87 art::PtrVector<recob::Cluster> clusIn;
88 for(
unsigned int ii = 0; ii < clusterListHandle->size(); ++ii)
90 art::Ptr<recob::Cluster>
cluster(clusterListHandle, ii);
91 clusIn.push_back(cluster);
96 std::vector<recob::EndPoint2D> vtxOut;
97 std::vector< art::PtrVector<recob::Hit> > vtxHitsOut;
100 MF_LOG_DEBUG(
"Vertex") <<
"found " << numvtx <<
"vertices with VertexService";
103 std::unique_ptr<std::vector<recob::EndPoint2D> > vtxcol(
new std::vector<recob::EndPoint2D>(vtxOut));
104 std::unique_ptr< art::Assns<recob::EndPoint2D, recob::Hit> > assn(
new art::Assns<recob::EndPoint2D, recob::Hit>);
106 for(
size_t v = 0; v < vtxcol->size(); ++v)
107 util::CreateAssn(*
this, evt, *(vtxcol.get()), vtxHitsOut[v], *(assn.get()), v);
109 evt.put(std::move(vtxcol));
110 evt.put(std::move(assn));
124 DEFINE_ART_MODULE(EndPointModule)
algorithm to find 2D endpoints
Declaration of signal hit object.
void produce(art::Event &evt)
size_t EndPoint(const art::PtrVector< recob::Cluster > &clusIn, std::vector< recob::EndPoint2D > &vtxcol, std::vector< art::PtrVector< recob::Hit > > &vtxHitsOut, art::Event const &evt, std::string const &label) const
std::string fDBScanModuleLabel
Declaration of cluster object.
Algorithm to find 2D end points.
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.
EndPointAlg fEPAlg
object that contains the end point finding algorithm
module to find 2D end points
EndPointModule(fhicl::ParameterSet const &pset)