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:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 EndPointModule (fhicl::ParameterSet const &pset)
 
- Public Member Functions inherited from art::EDProducer
 EDProducer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDProducer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Producer
virtual ~Producer () noexcept
 
 Producer (fhicl::ParameterSet const &)
 
 Producer (Producer const &)=delete
 
 Producer (Producer &&)=delete
 
Produceroperator= (Producer const &)=delete
 
Produceroperator= (Producer &&)=delete
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Member Functions

void produce (art::Event &evt)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from art::EDProducer
using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
- Public Types inherited from art::detail::Producer
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 
- Static Public Member Functions inherited from art::EDProducer
static void commitEvent (EventPrincipal &ep, Event &e)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

module to find 2D end points

Definition at line 42 of file EndPointModule_module.cc.

Constructor & Destructor Documentation

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

Definition at line 65 of file EndPointModule_module.cc.

66  : EDProducer{pset}
67  , fEPAlg(pset.get< fhicl::ParameterSet >("EndPointAlg"))
68  {
69  fDBScanModuleLabel = pset.get<std::string>("DBScanModuleLabel");
70 
71  produces< std::vector<recob::EndPoint2D> >();
72  produces< art::Assns<recob::EndPoint2D, recob::Hit> >();
73  }
std::string string
Definition: nybbler.cc:12
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
EndPointAlg fEPAlg
object that contains the end point finding algorithm

Member Function Documentation

void cluster::EndPointModule::produce ( art::Event evt)
privatevirtual

Implements art::EDProducer.

Definition at line 77 of file EndPointModule_module.cc.

78  {
79 
80  art::Handle< std::vector<recob::Cluster> > clusterListHandle;
81  evt.getByLabel(fDBScanModuleLabel,clusterListHandle);
82  //Point to a collection of vertices to output.
83 
84  //.......................................
86  for(unsigned int ii = 0; ii < clusterListHandle->size(); ++ii)
87  {
88  art::Ptr<recob::Cluster> cluster(clusterListHandle, ii);
89  clusIn.push_back(cluster);
90  }
91 
92  // make a std::vector<recob::Cluster> for the output of the
93  // Hough Transform
94  std::vector<recob::EndPoint2D> vtxOut;
95  std::vector< art::PtrVector<recob::Hit> > vtxHitsOut;
96  size_t numvtx = fEPAlg.EndPoint(clusIn, vtxOut, vtxHitsOut, evt, fDBScanModuleLabel);
97 
98  MF_LOG_DEBUG("Vertex") << "found " << numvtx << "vertices with VertexService";
99 
100  //Point to a collection of vertices to output.
101  std::unique_ptr<std::vector<recob::EndPoint2D> > vtxcol(new std::vector<recob::EndPoint2D>(vtxOut));
102  std::unique_ptr< art::Assns<recob::EndPoint2D, recob::Hit> > assn(new art::Assns<recob::EndPoint2D, recob::Hit>);
103 
104  for(size_t v = 0; v < vtxcol->size(); ++v)
105  util::CreateAssn(*this, evt, *(vtxcol.get()), vtxHitsOut[v], *(assn.get()), v);
106 
107  evt.put(std::move(vtxcol));
108  evt.put(std::move(assn));
109  }
Cluster finding and building.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:435
def move(depos, offset)
Definition: depos.py:107
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
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
#define MF_LOG_DEBUG(id)
EndPointAlg fEPAlg
object that contains the end point finding algorithm

Member Data Documentation

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

Definition at line 52 of file EndPointModule_module.cc.

EndPointAlg cluster::EndPointModule::fEPAlg
private

object that contains the end point finding algorithm

Definition at line 54 of file EndPointModule_module.cc.


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