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

Classes

struct  Config
 

Public Types

using Parameters = art::EDProducer::Table< Config >
 
- 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

 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...
 
- 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

double spacing
 step size [cm] 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

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 49 of file SpacePointMaker_module.cc.

Member Typedef Documentation

Definition at line 65 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 92 of file SpacePointMaker_module.cc.

94  , spacing(config().spacing())
95 {
96  produces<std::vector<recob::SpacePoint>>();
97 } // lar::example::tests::SpacePointMaker::SpacePointMaker()
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
static Config * config
Definition: config.cpp:1054

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)

Implements art::EDProducer.

Definition at line 101 of file SpacePointMaker_module.cc.

101  {
102 
103  //
104  // set up
105  //
106 
107  // container for the data product
108  auto spacePoints = std::make_unique<std::vector<recob::SpacePoint>>();
109 
110  // acquire the geometry information
111  auto const* geom = lar::providerFrom<geo::Geometry>();
112 
113  //
114  // creation of the points
115  //
116 
117  // fill each TPC independently
118  for (auto const& TPC: geom->IterateTPCs()) {
119 
120  FillSpacePointGrid(*spacePoints, TPC, spacing);
121 
122  } // for TPC
123 
124  //
125  // result storage
126  //
127  mf::LogInfo("SpacePointMaker")
128  << "Created " << spacePoints->size() << " space points using spacing "
129  << spacing << " cm";
130 
131  event.put(std::move(spacePoints));
132 
133 } // lar::example::tests::SpacePointMaker::produce()
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
def move(depos, offset)
Definition: depos.py:107
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 75 of file SpacePointMaker_module.cc.


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