Classes | Public Types | Public Member Functions | Private Attributes | List of all members
lar::example::RemoveIsolatedSpacePoints Class Reference

art module: removes isolated space points. More...

Inheritance diagram for lar::example::RemoveIsolatedSpacePoints:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Classes

struct  Config
 Module configuration data. More...
 

Public Types

using Parameters = art::EDProducer::Table< Config >
 Standard art alias for module configuration table. More...
 
- 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 >
 

Public Member Functions

 RemoveIsolatedSpacePoints (Parameters const &config)
 Constructor; see the class documentation for the configuration. More...
 
virtual void produce (art::Event &event) override
 
- 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 Attributes

art::InputTag spacePointsLabel
 label of the input data product More...
 
SpacePointIsolationAlg isolAlg
 instance of the algorithm More...
 

Additional Inherited Members

- 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

art module: removes isolated space points.

See also
RemoveIsolatedSpacePoints example overview

A new collection of space points is added to the event, that contains only the space points that are not isolated.

Isolation is determined by the SpacePointIsolationAlg algorithm.

The space points are not associated to anything.

Input

A collection of recob::SpacePoint is required.

Output

A collection of recob::SpacePoint is produced, containing copies of the non-isolated inpt points.

Configuration parameters

Definition at line 70 of file RemoveIsolatedSpacePoints_module.cc.

Member Typedef Documentation

Standard art alias for module configuration table.

Definition at line 93 of file RemoveIsolatedSpacePoints_module.cc.

Constructor & Destructor Documentation

lar::example::RemoveIsolatedSpacePoints::RemoveIsolatedSpacePoints ( Parameters const &  config)
explicit

Constructor; see the class documentation for the configuration.

Definition at line 119 of file RemoveIsolatedSpacePoints_module.cc.

120  : EDProducer{config}
121  , spacePointsLabel(config().spacePoints())
122  , isolAlg(config().isolation())
123 {
124  consumes<std::vector<recob::SpacePoint>>(spacePointsLabel);
125  produces<std::vector<recob::SpacePoint>>();
126 } // lar::example::RemoveIsolatedSpacePoints::RemoveIsolatedSpacePoints()
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
art::InputTag spacePointsLabel
label of the input data product
static Config * config
Definition: config.cpp:1054
SpacePointIsolationAlg isolAlg
instance of the algorithm

Member Function Documentation

void lar::example::RemoveIsolatedSpacePoints::produce ( art::Event event)
overridevirtual

Implements art::EDProducer.

Definition at line 130 of file RemoveIsolatedSpacePoints_module.cc.

130  {
131 
132  //
133  // read the input
134  //
135  auto spacePointHandle
136  = event.getValidHandle<std::vector<recob::SpacePoint>>(spacePointsLabel);
137 
138  //
139  // set up the algorithm
140  //
141  auto const* geom = lar::providerFrom<geo::Geometry>();
142  isolAlg.setup(*geom);
143 
144  //
145  // run the algorithm
146  //
147 
148  // the return value is a list of indices of non-isolated space points
149  auto const& spacePoints = *spacePointHandle;
150  std::vector<size_t> socialPointIndices
151  = isolAlg.removeIsolatedPoints(spacePoints);
152 
153  //
154  // extract and save the results
155  //
156  auto socialSpacePoints = std::make_unique<std::vector<recob::SpacePoint>>();
157 
158  socialSpacePoints->reserve(socialPointIndices.size()); // preallocate
159  for (size_t index: socialPointIndices)
160  socialSpacePoints->push_back(spacePoints[index]);
161 
162  mf::LogInfo("RemoveIsolatedSpacePoints")
163  << "Found " << socialSpacePoints->size() << "/" << spacePoints.size()
164  << " isolated space points in '" << spacePointsLabel.encode() << "'";
165 
166  event.put(std::move(socialSpacePoints));
167 
168 } // lar::example::RemoveIsolatedSpacePoints::produce()
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
void setup(geo::GeometryCore const &geometry)
Sets up the algorithm.
art::InputTag spacePointsLabel
label of the input data product
std::string encode() const
Definition: InputTag.cc:97
def move(depos, offset)
Definition: depos.py:107
SpacePointIsolationAlg isolAlg
instance of the algorithm
std::vector< size_t > removeIsolatedPoints(PointIter begin, PointIter end) const
Returns the set of reconstructed 3D points that are not isolated.

Member Data Documentation

SpacePointIsolationAlg lar::example::RemoveIsolatedSpacePoints::isolAlg
private

instance of the algorithm

Definition at line 105 of file RemoveIsolatedSpacePoints_module.cc.

art::InputTag lar::example::RemoveIsolatedSpacePoints::spacePointsLabel
private

label of the input data product

Definition at line 103 of file RemoveIsolatedSpacePoints_module.cc.


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