All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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:

Classes

struct  Config
 Module configuration data. More...
 

Public Types

using Parameters = art::EDProducer::Table< Config >
 Standard art alias for module configuration table. More...
 

Public Member Functions

 RemoveIsolatedSpacePoints (Parameters const &config)
 Constructor; see the class documentation for the configuration. More...
 
virtual void produce (art::Event &event) override
 

Private Attributes

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

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 71 of file RemoveIsolatedSpacePoints_module.cc.

Member Typedef Documentation

Standard art alias for module configuration table.

Definition at line 94 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 120 of file RemoveIsolatedSpacePoints_module.cc.

121  : EDProducer{config}
122  , spacePointsLabel(config().spacePoints())
123  , isolAlg(config().isolation())
124 {
125  consumes<std::vector<recob::SpacePoint>>(spacePointsLabel);
126  produces<std::vector<recob::SpacePoint>>();
127 } // lar::example::RemoveIsolatedSpacePoints::RemoveIsolatedSpacePoints()
art::InputTag spacePointsLabel
label of the input data product
SpacePointIsolationAlg isolAlg
instance of the algorithm

Member Function Documentation

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

Definition at line 131 of file RemoveIsolatedSpacePoints_module.cc.

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

Member Data Documentation

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

instance of the algorithm

Definition at line 106 of file RemoveIsolatedSpacePoints_module.cc.

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

label of the input data product

Definition at line 104 of file RemoveIsolatedSpacePoints_module.cc.


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