All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
cluster::EndPointModule Class Reference

module to find 2D end points More...

Inheritance diagram for cluster::EndPointModule:

Public Member Functions

 EndPointModule (fhicl::ParameterSet const &pset)
 

Private Member Functions

void produce (art::Event &evt)
 

Private Attributes

std::string fDBScanModuleLabel
 
EndPointAlg fEPAlg
 object that contains the end point finding algorithm More...
 

Detailed Description

module to find 2D end points

Definition at line 44 of file EndPointModule_module.cc.

Constructor & Destructor Documentation

cluster::EndPointModule::EndPointModule ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 67 of file EndPointModule_module.cc.

68  : EDProducer{pset}
69  , fEPAlg(pset.get< fhicl::ParameterSet >("EndPointAlg"))
70  {
71  fDBScanModuleLabel = pset.get<std::string>("DBScanModuleLabel");
72 
73  produces< std::vector<recob::EndPoint2D> >();
74  produces< art::Assns<recob::EndPoint2D, recob::Hit> >();
75  }
EndPointAlg fEPAlg
object that contains the end point finding algorithm

Member Function Documentation

void cluster::EndPointModule::produce ( art::Event &  evt)
private

Definition at line 79 of file EndPointModule_module.cc.

80  {
81 
82  art::Handle< std::vector<recob::Cluster> > clusterListHandle;
83  evt.getByLabel(fDBScanModuleLabel,clusterListHandle);
84  //Point to a collection of vertices to output.
85 
86  //.......................................
87  art::PtrVector<recob::Cluster> clusIn;
88  for(unsigned int ii = 0; ii < clusterListHandle->size(); ++ii)
89  {
90  art::Ptr<recob::Cluster> cluster(clusterListHandle, ii);
91  clusIn.push_back(cluster);
92  }
93 
94  // make a std::vector<recob::Cluster> for the output of the
95  // Hough Transform
96  std::vector<recob::EndPoint2D> vtxOut;
97  std::vector< art::PtrVector<recob::Hit> > vtxHitsOut;
98  size_t numvtx = fEPAlg.EndPoint(clusIn, vtxOut, vtxHitsOut, evt, fDBScanModuleLabel);
99 
100  MF_LOG_DEBUG("Vertex") << "found " << numvtx << "vertices with VertexService";
101 
102  //Point to a collection of vertices to output.
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>);
105 
106  for(size_t v = 0; v < vtxcol->size(); ++v)
107  util::CreateAssn(*this, evt, *(vtxcol.get()), vtxHitsOut[v], *(assn.get()), v);
108 
109  evt.put(std::move(vtxcol));
110  evt.put(std::move(assn));
111  }
process_name cluster
Definition: cheaterreco.fcl:51
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
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
TCEvent evt
Definition: DataStructs.cxx:8

Member Data Documentation

std::string cluster::EndPointModule::fDBScanModuleLabel
private

Definition at line 54 of file EndPointModule_module.cc.

EndPointAlg cluster::EndPointModule::fEPAlg
private

object that contains the end point finding algorithm

Definition at line 56 of file EndPointModule_module.cc.


The documentation for this class was generated from the following file: