21 #include "art/Framework/Core/EDProducer.h"
22 #include "art/Framework/Core/ModuleMacros.h"
23 #include "art/Framework/Principal/Event.h"
24 #include "art/Framework/Principal/Handle.h"
25 #include "canvas/Utilities/InputTag.h"
26 #include "messagefacility/MessageLogger/MessageLogger.h"
27 #include "fhiclcpp/types/Atom.h"
28 #include "fhiclcpp/types/Table.h"
83 Comment(
"the space points to be filtered")
86 fhicl::Table<SpacePointIsolationAlg::Config>
isolation{
88 Comment(
"settings for the isolation algorithm")
100 virtual void produce(art::Event& event)
override;
122 , spacePointsLabel(config().spacePoints())
123 , isolAlg(config().isolation())
125 consumes<std::vector<recob::SpacePoint>>(spacePointsLabel);
126 produces<std::vector<recob::SpacePoint>>();
136 auto spacePointHandle
142 auto const* geom = lar::providerFrom<geo::Geometry>();
150 auto const& spacePoints = *spacePointHandle;
151 std::vector<size_t> socialPointIndices
152 =
isolAlg.removeIsolatedPoints(spacePoints);
157 auto socialSpacePoints = std::make_unique<std::vector<recob::SpacePoint>>();
159 socialSpacePoints->reserve(socialPointIndices.size());
160 for (
size_t index: socialPointIndices)
161 socialSpacePoints->push_back(spacePoints[index]);
163 mf::LogInfo(
"RemoveIsolatedSpacePoints")
164 <<
"Found " << socialSpacePoints->size() <<
"/" << spacePoints.size()
167 event.put(std::move(socialSpacePoints));
Utilities related to art service access.
fhicl::Table< SpacePointIsolationAlg::Config > isolation
art::InputTag spacePointsLabel
label of the input data product
Module configuration data.
art module: removes isolated space points.
Algorithm(s) dealing with space point isolation in space.
Algorithm to detect isolated space points.
SpacePointIsolationAlg isolAlg
instance of the algorithm
RemoveIsolatedSpacePoints(Parameters const &config)
Constructor; see the class documentation for the configuration.
BEGIN_PROLOG vertical distance to the surface Name
fhicl::Atom< art::InputTag > spacePoints
virtual void produce(art::Event &event) override
art::EDProducer::Table< Config > Parameters
Standard art alias for module configuration table.
art framework interface to geometry description