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::tests::SpacePointMaker Class Reference

Creates a collection of space points. More...

Inheritance diagram for lar::example::tests::SpacePointMaker:

Classes

struct  Config
 

Public Types

using Parameters = art::EDProducer::Table< Config >
 

Public Member Functions

 SpacePointMaker (Parameters const &config)
 Constructor; see the class documentation for the configuration. More...
 
virtual void produce (art::Event &event) override
 Create and add the points on each event (although they are the same) More...
 

Private Attributes

double spacing
 step size [cm] More...
 

Detailed Description

Creates a collection of space points.

A collection of space points is added to the event. The points are spaced by the value of the spacing configuration parameter, in a cubic grid. Each TPC is independently filled, so that the TPC centre hosts a space point.

The space points are not associated to anything.

Configuration parameters

Definition at line 50 of file SpacePointMaker_module.cc.

Member Typedef Documentation

Definition at line 66 of file SpacePointMaker_module.cc.

Constructor & Destructor Documentation

lar::example::tests::SpacePointMaker::SpacePointMaker ( Parameters const &  config)
explicit

Constructor; see the class documentation for the configuration.

Definition at line 93 of file SpacePointMaker_module.cc.

94  : EDProducer{config}
95  , spacing(config().spacing())
96 {
97  produces<std::vector<recob::SpacePoint>>();
98 } // lar::example::tests::SpacePointMaker::SpacePointMaker()

Member Function Documentation

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

Create and add the points on each event (although they are the same)

Definition at line 102 of file SpacePointMaker_module.cc.

102  {
103 
104  //
105  // set up
106  //
107 
108  // container for the data product
109  auto spacePoints = std::make_unique<std::vector<recob::SpacePoint>>();
110 
111  // acquire the geometry information
112  auto const* geom = lar::providerFrom<geo::Geometry>();
113 
114  //
115  // creation of the points
116  //
117 
118  // fill each TPC independently
119  for (auto const& TPC: geom->IterateTPCs()) {
120 
121  FillSpacePointGrid(*spacePoints, TPC, spacing);
122 
123  } // for TPC
124 
125  //
126  // result storage
127  //
128  mf::LogInfo("SpacePointMaker")
129  << "Created " << spacePoints->size() << " space points using spacing "
130  << spacing << " cm";
131 
132  event.put(std::move(spacePoints));
133 
134 } // lar::example::tests::SpacePointMaker::produce()
BEGIN_PROLOG TPC
unsigned int FillSpacePointGrid(std::vector< recob::SpacePoint > &spacePoints, geo::BoxBoundedGeo const &box, double stepSize)
Creates space points distributed in a grid.

Member Data Documentation

double lar::example::tests::SpacePointMaker::spacing
private

step size [cm]

Definition at line 76 of file SpacePointMaker_module.cc.


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