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::test::ChargedSpacePointProxyInputMaker Class Reference

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

Inheritance diagram for lar::test::ChargedSpacePointProxyInputMaker:

Classes

struct  Config
 

Public Types

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

Public Member Functions

 ChargedSpacePointProxyInputMaker (Parameters const &config)
 
virtual void produce (art::Event &event) override
 

Private Attributes

unsigned int nPoints
 Number of points to generate. More...
 

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.

85  : EDProducer{config}
86  , nPoints(config().nPoints())
87 {
88 
89  // declare production of recob::SpacePoint and recob::PointCharge collections:
91 
92 } // ChargedSpacePointProxyInputMaker::ChargedSpacePointProxyInputMaker()
static void produces(art::ProducesCollector &producesCollector, std::string const &instanceName={})
Declares the data products being produced.

Member Function Documentation

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

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()
EResult err(const char *call)
float Charge_t
Type for the amount of reconstructed charge.
Definition: PointCharge.h:35
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: