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

Creates some dummy space points and charge. More...

Inheritance diagram for lar::test::ChargedSpacePointProxyInputMaker:
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

 ChargedSpacePointProxyInputMaker (Parameters const &config)
 
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

unsigned int nPoints
 Number of points to generate. 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 some dummy space points and charge.

The produced space points and charges have completely dummy content. They are implicitly associated and the amount of charge is as much as the ID of the space point.

Configuration parameters

Definition at line 49 of file ChargedSpacePointProxyInputMaker_module.cc.

Member Typedef Documentation

Definition at line 64 of file ChargedSpacePointProxyInputMaker_module.cc.

Constructor & Destructor Documentation

lar::test::ChargedSpacePointProxyInputMaker::ChargedSpacePointProxyInputMaker ( Parameters const &  config)
explicit

Definition at line 84 of file ChargedSpacePointProxyInputMaker_module.cc.

86  , nPoints(config().nPoints())
87 {
88 
89  // declare production of recob::SpacePoint and recob::PointCharge collections:
91 
92 } // ChargedSpacePointProxyInputMaker::ChargedSpacePointProxyInputMaker()
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
static void produces(art::ProducesCollector &producesCollector, std::string const &instanceName={})
Declares the data products being produced.
static Config * config
Definition: config.cpp:1054
ProducesCollector & producesCollector() noexcept

Member Function Documentation

void lar::test::ChargedSpacePointProxyInputMaker::produce ( art::Event event)
overridevirtual

Implements art::EDProducer.

Definition at line 95 of file ChargedSpacePointProxyInputMaker_module.cc.

95  {
96 
98 
99  BOOST_TEST(spacePoints.empty());
100 
101  const double err[6U] = { 1.0, 0.0, 1.0, 0.0, 0.0, 1.0 };
102 
103  for (unsigned int iPoint = 0; iPoint < nPoints; ++iPoint) {
104  BOOST_TEST(spacePoints.size() == (std::size_t) iPoint);
105 
106  double const pos[3U]
107  = { double(iPoint), double(2.0 * iPoint), double(4.0 * iPoint) };
108 
109  spacePoints.add(
110  { pos, err, 1.0 /* chisq */, int(iPoint) /* id */ }, // space point
111  { recob::PointCharge::Charge_t(iPoint) } // charge
112  );
113 
114  mf::LogVerbatim("ChargedSpacePointProxyInputMaker")
115  << "[#" << iPoint << "] point: " << spacePoints.lastSpacePoint()
116  << " (ptr: " << spacePoints.lastSpacePointPtr()
117  << "); charge: " << spacePoints.lastCharge()
118  << " (ptr: " << spacePoints.lastChargePtr() << ")";
119 
120  } // for (iPoint)
121  BOOST_TEST(spacePoints.size() == (std::size_t) nPoints);
122 
123  mf::LogInfo("ChargedSpacePointProxyInputMaker")
124  << "Produced " << spacePoints.size() << " points and charges.";
125 
126  spacePoints.put();
127  BOOST_TEST(spacePoints.empty());
128 
129 } // lar::test::ChargedSpacePointProxyInputMaker::produce()
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
float Charge_t
Type for the amount of reconstructed charge.
Definition: PointCharge.h:35
void err(const char *fmt,...)
Definition: message.cpp:226
static ChargedSpacePointCollectionCreator forPtrs(art::Event &event, std::string const &instanceName={})
Static function binding a new object to a specific art event.

Member Data Documentation

unsigned int lar::test::ChargedSpacePointProxyInputMaker::nPoints
private

Number of points to generate.

Definition at line 71 of file ChargedSpacePointProxyInputMaker_module.cc.


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