LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
recob::ChargedSpacePointCollectionCreator Class Reference

Creates a collection of space points with associated charge. More...

#include "ChargedSpacePointCreator.h"

Public Member Functions

void put ()
 Puts all data products into the event, leaving the creator empty(). More...
 
Constructors
 ChargedSpacePointCollectionCreator (art::Event &event, std::string const &instanceName={})
 Constructor binding this object to a specific art event. More...
 
template<typename Producer >
 ChargedSpacePointCollectionCreator (art::Event &event, Producer const &producer, std::string const &instanceName={}, std::enable_if_t< details::is_art_module_v< Producer >> *=nullptr)
 Constructor binding this object to a specific art event. More...
 
Insertion and finish operations
void add (recob::SpacePoint const &spacePoint, recob::PointCharge const &charge)
 Inserts the specified space point and associated data into the collection. More...
 
void add (recob::SpacePoint &&spacePoint, recob::PointCharge &&charge)
 Inserts the specified space point and associated data into the collection. More...
 
void addAll (std::vector< recob::SpacePoint > &&spacePoints, std::vector< recob::PointCharge > &&charges)
 Inserts all the space points and associated data from the vectors into the collection. More...
 
void addAll (std::vector< recob::SpacePoint > const &spacePoints, std::vector< recob::PointCharge > const &charges)
 Inserts all the space points and associated data from the vectors into the collection. More...
 
Queries and operations
bool empty () const
 Returns whether there are currently no space points in the collection. More...
 
std::size_t size () const
 Returns the number of space points currently in the collection. More...
 
void clear ()
 Removes all data from the collection, making it empty(). More...
 
bool spent () const
 Returns whether put() has already been called. More...
 
bool canMakePointers () const
 Returns whether art pointer making is enabled. More...
 
Complimentary unchecked element access
recob::SpacePoint const & spacePoint (std::size_t i) const
 Returns the specified space point; undefined behaviour if not there. More...
 
recob::SpacePoint const & lastSpacePoint () const
 Returns the last inserted space point; undefined behaviour if empty(). More...
 
art::Ptr< recob::SpacePointspacePointPtr (std::size_t i) const
 Returns an art pointer to the specified space point (no check done!). More...
 
art::Ptr< recob::SpacePointlastSpacePointPtr () const
 Returns an art pointer to the last inserted space point (no check!). More...
 
recob::PointCharge const & charge (std::size_t i) const
 Returns the last inserted charge; undefined behaviour if empty(). More...
 
recob::PointCharge const & lastCharge () const
 Returns the last inserted charge; undefined behaviour if empty(). More...
 
art::Ptr< recob::PointChargechargePtr (std::size_t i) const
 Returns an art pointer to the specified charge (no check done!). More...
 
art::Ptr< recob::PointChargelastChargePtr () const
 Returns an art pointer to the inserted charge (no check!). More...
 

Static Public Member Functions

Static constructor interface

These methods take care of initialization that needs to take place on construction of the module.

static void produces (art::ProducerBase &producer, std::string const &instanceName={})
 Declares the data products being produced. More...
 

Private Member Functions

std::size_t lastIndex () const
 Returns the index of the last element (undefined if empty). More...
 

Private Attributes

art::EventfEvent
 The event this object is bound to. More...
 
std::string fInstanceName
 Instance name of all the data products. More...
 
std::unique_ptr< std::vector< recob::SpacePoint > > fSpacePoints
 Space point data. More...
 
std::unique_ptr< art::PtrMaker< recob::SpacePoint > > fSpacePointPtrMaker
 Space point pointer maker. More...
 
std::unique_ptr< std::vector< recob::PointCharge > > fCharges
 Charge data. More...
 
std::unique_ptr< art::PtrMaker< recob::PointCharge > > fChargePtrMaker
 Charge pointer maker. More...
 

Detailed Description

Creates a collection of space points with associated charge.

This class facilitates the creation of data products satisfying the requirements the proxy::ChargedSpacePoints proxy relies on. It will keep track of space points and reconstructed charge, and will put them into the event at the end.

Requirements of the data products

The requirements guaranteed by the output of this collection creator satisfy the proxy::ChargedSpacePoints proxy requirements. They are:

  • space points and charges stored in two separate data products
  • space points and charge in the same order, so that charge at position i is associated to space point at the same position i
  • one-to-one correspondence between each space point and its charge
  • association is implicit in the requirements above: no art::Assns data product is produced

Usage

The usage pattern is made of two main parts:

declaration of the data products, at producer construction time

production of the data products, event by event

The second part happens within the context of the producer's produce() (or filter(), or equivalent) method, and it can be split into three stages:

construction of the collection creator, binding it to the current event

filling of the creator, usually in a loop

explicit transfer of the data products into the event

Declaration of the data products

In the same fashion as data products must be declared to art with a produces() call, the collection creator will have to perform an equivalent step. This is achieved by calling the staticproduces()` method (see its documentation for an example).

Construction of a collection creator object

Collection creator objects are bound to a specific event and therefore can't be data members of the producer class. In the produces() method, we'll have:

void MyProducer::produce(art::Event& event) {
// ...
} // MyProducer::produce()

If art pointers to the data products are needed (e.g. to create associations), then the producer must be specified in the constructor:

void MyProducer::produce(art::Event& event) {
recob::ChargedSpacePointCollectionCreator spacePoints(event, *this);
produces<art::Assns<recob::SpacePoint, recob::Hit>>();
// ...
} // MyProducer::produce()

In both cases, an instance name can be specified which will be used for all the managed data products (space points and reconstructed charge).

Populating the collections

The core of the usage of this object is feeding the objects to the data product collections. This is done using the add() member function. If the data objects already exist, they can be moved in instead of being copied. For example:

void MyProducer::produce(art::Event& event) {
auto hitAssns
= std::make_unique<art::Assns<recob::SpacePoint, recob::Hit>>();
// some processing
for (auto const& hitSet: hitSets) {
fSpacePointChargeAlgo->run(hitSet, spacePoint, charge);
// add the new space point and charge to the collection
spacePoints.add(std::move(spacePoint), std::move(charge));
// associate this space point with all the hits in the source set
auto const& spacePointPtr = spacePoints.lastSpacePointPtr();
for (art::Ptr<recob::Hit> const& hitPtr: hitSet)
hitAssns.addSingle(spacePointPtr, hitPtr);
} // for
// ...
} // MyProducer::produce()

If your algorithm is creating a subcollection of space points and charges which are in the same order, a shortcut to a loop of add() is addAll():

void MyProducer::produce(art::Event& event) {
// some processing
for (auto const& track: tracks) {
std::vector<recob::SpacePoint> trackSpacePoints;
std::vector<recob::PointCharge> trackCharges;
fSpacePointChargeAlgo->run(track, trackSpacePoints, trackCharges);
spacePoints.addAll
(std::move(trackSpacePoints), std::move(trackCharges));
} // for
// ...
} // MyProducer::produce()

Operations on the collection

While the collection creator object is designed to be just a single-use, single-pattern helper, there are a few operations that it allows:

  • query: the current number of space points (size()), whether there are any (empty()), and whether put() has been already called (spent(); see below)
  • deletion: it is possible to remove all the data so far collected; this may be useful in case of error, where the data product should be set in as default-constructed (which unfortunately in the case of space points might be, albeit unlikely, a legal outcome)
  • if at construction time a producer is specified, art pointers can be created with lastSpacePointPtr(), lastChargePtr(), spacePointPtr() and chargePtr() to the elements of the future data products

Insertion of the data products into the event

Again as in the standard producer pattern, where Event::put() needs to be called to finally move the data into art, the collection creator will need to be told to do the same:

void MyProducer::produce(art::Event& event) {
auto hitAssns
= std::make_unique<art::Assns<recob::SpacePoint, recob::Hit>>();
// ... filling here ...
spacePoints.put();
event.put(std::move(hitAssns)); // other data products go the usual way
} // MyProducer::produce()

The instance name used in put() had been set at construction time.

After put() is called, the object has served its purpose and can't be used any further. In this state, spent() method will return true.

Definition at line 239 of file ChargedSpacePointCreator.h.

Constructor & Destructor Documentation

recob::ChargedSpacePointCollectionCreator::ChargedSpacePointCollectionCreator ( art::Event event,
std::string const &  instanceName = {} 
)

Constructor binding this object to a specific art event.

Parameters
eventthe art event to bind to
instanceName_(default: empty)_ instance name for all data products

When the object is constructed with this constructor, the creation of art pointers will not be enabled (canMakePointers() will return false).

Definition at line 24 of file ChargedSpacePointCreator.cpp.

References add().

25  : fEvent(event)
26  , fInstanceName(instanceName)
27  , fSpacePoints(std::make_unique<std::vector<recob::SpacePoint>>())
28  , fCharges(std::make_unique<std::vector<recob::PointCharge>>())
29  {}
art::Event & fEvent
The event this object is bound to.
std::unique_ptr< std::vector< recob::SpacePoint > > fSpacePoints
Space point data.
std::string fInstanceName
Instance name of all the data products.
std::unique_ptr< std::vector< recob::PointCharge > > fCharges
Charge data.
template<typename Producer >
recob::ChargedSpacePointCollectionCreator::ChargedSpacePointCollectionCreator ( art::Event event,
Producer const &  producer,
std::string const &  instanceName = {},
std::enable_if_t< details::is_art_module_v< Producer >> *  = nullptr 
)

Constructor binding this object to a specific art event.

Template Parameters
Producerthe type of producer required
Parameters
eventthe art event to bind to
producerpointer to the producer
instanceName_(default: empty)_ instance name for all data products

This constructor enables the creation of art pointers.

Definition at line 489 of file ChargedSpacePointCreator.h.

References fChargePtrMaker, fEvent, fInstanceName, and fSpacePointPtrMaker.

495  : ChargedSpacePointCollectionCreator(event, instanceName)
496 {
497 
498  fSpacePointPtrMaker = std::make_unique<art::PtrMaker<recob::SpacePoint>>
499  (fEvent, producer, fInstanceName);
500  fChargePtrMaker = std::make_unique<art::PtrMaker<recob::PointCharge>>
501  (fEvent, producer, fInstanceName);
502 
503 } // ChargedSpacePointCollectionCreator(Producer)
art::Event & fEvent
The event this object is bound to.
std::string fInstanceName
Instance name of all the data products.
std::unique_ptr< art::PtrMaker< recob::SpacePoint > > fSpacePointPtrMaker
Space point pointer maker.
ChargedSpacePointCollectionCreator(art::Event &event, std::string const &instanceName={})
Constructor binding this object to a specific art event.
std::unique_ptr< art::PtrMaker< recob::PointCharge > > fChargePtrMaker
Charge pointer maker.

Member Function Documentation

void recob::ChargedSpacePointCollectionCreator::add ( recob::SpacePoint const &  spacePoint,
recob::PointCharge const &  charge 
)

Inserts the specified space point and associated data into the collection.

Parameters
spacePointthe space point to be copied into the collection
chargethe charge to be copied into the collection

The data is pushed as the new last element of the collection.

Data is copied or moved depending on which variant of this method is used.

Definition at line 34 of file ChargedSpacePointCreator.cpp.

Referenced by reco3d::SpacePointSolver::AddSpacePoint(), and ChargedSpacePointCollectionCreator().

35 {
36  // if these assertion fail, add() is being called after put()
37  assert(fSpacePoints);
38  assert(fCharges);
39 
40  fSpacePoints->push_back(spacePoint);
41  fCharges->push_back(charge);
42 
43  assert(fSpacePoints->size() == fCharges->size());
44 
45 } // recob::ChargedSpacePointCollectionCreator::add(copy)
recob::PointCharge const & charge(std::size_t i) const
Returns the last inserted charge; undefined behaviour if empty().
std::unique_ptr< std::vector< recob::SpacePoint > > fSpacePoints
Space point data.
std::unique_ptr< std::vector< recob::PointCharge > > fCharges
Charge data.
recob::SpacePoint const & spacePoint(std::size_t i) const
Returns the specified space point; undefined behaviour if not there.
void recob::ChargedSpacePointCollectionCreator::add ( recob::SpacePoint &&  spacePoint,
recob::PointCharge &&  charge 
)

Inserts the specified space point and associated data into the collection.

Parameters
spacePointthe space point to be copied into the collection
chargethe charge to be copied into the collection

The data is pushed as the new last element of the collection.

Data is copied or moved depending on which variant of this method is used.

Definition at line 50 of file ChargedSpacePointCreator.cpp.

51 {
52  // if these assertion fail, add() is being called after put()
53  assert(fSpacePoints);
54  assert(fCharges);
55 
56  fSpacePoints->push_back(std::move(spacePoint));
57  fCharges->push_back(std::move(charge));
58 
59  assert(fSpacePoints->size() == fCharges->size());
60 
61 } // recob::ChargedSpacePointCollectionCreator::add()
std::unique_ptr< std::vector< recob::SpacePoint > > fSpacePoints
Space point data.
std::unique_ptr< std::vector< recob::PointCharge > > fCharges
Charge data.
void recob::ChargedSpacePointCollectionCreator::addAll ( std::vector< recob::SpacePoint > &&  spacePoints,
std::vector< recob::PointCharge > &&  charges 
)

Inserts all the space points and associated data from the vectors into the collection.

Parameters
spacePointsthe space point to be copied into the collection
chargesthe charges to be copied into the collection
Exceptions
cet::exception(category ChargedSpacePointCollectionCreator) if the input collections are inconsistent

The data is pushed as the new last element of the collection.

Data is copied or moved depending on which variant of this method is used.

No exception safety is offered here.

Definition at line 65 of file ChargedSpacePointCreator.cpp.

References empty(), fCharges, and fSpacePoints.

69 {
70  // if these assertion fail, addAll() is being called after put()
71  assert(fSpacePoints);
72  assert(fCharges);
73 
74  if (spacePoints.size() != charges.size()) {
75  throw cet::exception("ChargedSpacePointCollectionCreator")
76  << "Input collections of inconsistent size:"
77  << " " << spacePoints.size() << " (space points)"
78  << "and " << charges.size() << " (charges)"
79  << "\n";
80  }
81  if (empty()) {
82  *fSpacePoints = std::move(spacePoints);
83  *fCharges = std::move(charges);
84  }
85  else {
86  fSpacePoints->reserve(fSpacePoints->size() + spacePoints.size());
87  for (auto&& obj: spacePoints) fSpacePoints->push_back(std::move(obj));
88  spacePoints.clear();
89 
90  fCharges->reserve(fCharges->size() + charges.size());
91  for (auto&& obj: charges) fCharges->push_back(std::move(obj));
92  charges.clear();
93  }
94 
95  assert(fSpacePoints->size() == fCharges->size());
96 
97 } // recob::ChargedSpacePointCollectionCreator::addAll()
std::unique_ptr< std::vector< recob::SpacePoint > > fSpacePoints
Space point data.
bool empty() const
Returns whether there are currently no space points in the collection.
std::unique_ptr< std::vector< recob::PointCharge > > fCharges
Charge data.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void recob::ChargedSpacePointCollectionCreator::addAll ( std::vector< recob::SpacePoint > const &  spacePoints,
std::vector< recob::PointCharge > const &  charges 
)

Inserts all the space points and associated data from the vectors into the collection.

Parameters
spacePointsthe space point to be copied into the collection
chargesthe charges to be copied into the collection
Exceptions
cet::exception(category ChargedSpacePointCollectionCreator) if the input collections are inconsistent

The data is pushed as the new last element of the collection.

Data is copied or moved depending on which variant of this method is used.

No exception safety is offered here.

Definition at line 101 of file ChargedSpacePointCreator.cpp.

References fCharges, and fSpacePoints.

105 {
106  // if these assertion fail, addAll() is being called after put()
107  assert(fSpacePoints);
108  assert(fCharges);
109 
110 
111  if (spacePoints.size() != charges.size()) {
112  throw cet::exception("ChargedSpacePointCollectionCreator")
113  << "Input collections of inconsistent size:"
114  << " " << spacePoints.size() << " (space points)"
115  << "and " << charges.size() << " (charges)"
116  << "\n";
117  }
118  fSpacePoints->reserve(fSpacePoints->size() + spacePoints.size());
119  std::copy
120  (spacePoints.begin(), spacePoints.end(), std::back_inserter(*fSpacePoints));
121 
122  fCharges->reserve(fCharges->size() + charges.size());
123  std::copy(charges.begin(), charges.end(), std::back_inserter(*fCharges));
124 
125  assert(fSpacePoints->size() == fCharges->size());
126 
127 } // recob::ChargedSpacePointCollectionCreator::addAll()
std::unique_ptr< std::vector< recob::SpacePoint > > fSpacePoints
Space point data.
std::unique_ptr< std::vector< recob::PointCharge > > fCharges
Charge data.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool recob::ChargedSpacePointCollectionCreator::canMakePointers ( ) const
inline

Returns whether art pointer making is enabled.

Definition at line 362 of file ChargedSpacePointCreator.h.

362 { return bool(fSpacePointPtrMaker); }
std::unique_ptr< art::PtrMaker< recob::SpacePoint > > fSpacePointPtrMaker
Space point pointer maker.
recob::PointCharge const& recob::ChargedSpacePointCollectionCreator::charge ( std::size_t  i) const
inline

Returns the last inserted charge; undefined behaviour if empty().

Definition at line 389 of file ChargedSpacePointCreator.h.

390  { return fCharges->operator[](i); }
std::unique_ptr< std::vector< recob::PointCharge > > fCharges
Charge data.
art::Ptr< recob::PointCharge > recob::ChargedSpacePointCollectionCreator::chargePtr ( std::size_t  i) const

Returns an art pointer to the specified charge (no check done!).

Definition at line 166 of file ChargedSpacePointCreator.cpp.

References fChargePtrMaker, and produces().

Referenced by spacePointPtr().

167 {
168  return fChargePtrMaker? (*fChargePtrMaker)(i): art::Ptr<recob::PointCharge>{};
169 } // recob::ChargedSpacePointCollectionCreator::chargePtr()
Definition: fwd.h:25
std::unique_ptr< art::PtrMaker< recob::PointCharge > > fChargePtrMaker
Charge pointer maker.
void recob::ChargedSpacePointCollectionCreator::clear ( )

Removes all data from the collection, making it empty().

Definition at line 143 of file ChargedSpacePointCreator.cpp.

References empty(), fCharges, fSpacePoints, and spacePointPtr().

143  {
144 
145  if (fSpacePoints) fSpacePoints->clear();
146  if (fCharges) fCharges->clear();
147 
148  assert(empty());
149 
150 } // recob::ChargedSpacePointCollectionCreator::clear()
std::unique_ptr< std::vector< recob::SpacePoint > > fSpacePoints
Space point data.
bool empty() const
Returns whether there are currently no space points in the collection.
std::unique_ptr< std::vector< recob::PointCharge > > fCharges
Charge data.
bool recob::ChargedSpacePointCollectionCreator::empty ( ) const
inline

Returns whether there are currently no space points in the collection.

Definition at line 350 of file ChargedSpacePointCreator.h.

Referenced by addAll(), clear(), and put().

350 { return spent() || fSpacePoints->empty(); }
std::unique_ptr< std::vector< recob::SpacePoint > > fSpacePoints
Space point data.
bool spent() const
Returns whether put() has already been called.
recob::PointCharge const& recob::ChargedSpacePointCollectionCreator::lastCharge ( ) const
inline

Returns the last inserted charge; undefined behaviour if empty().

Definition at line 393 of file ChargedSpacePointCreator.h.

394  { return charge(lastIndex()); }
recob::PointCharge const & charge(std::size_t i) const
Returns the last inserted charge; undefined behaviour if empty().
std::size_t lastIndex() const
Returns the index of the last element (undefined if empty).
art::Ptr<recob::PointCharge> recob::ChargedSpacePointCollectionCreator::lastChargePtr ( ) const
inline

Returns an art pointer to the inserted charge (no check!).

Definition at line 400 of file ChargedSpacePointCreator.h.

401  { return chargePtr(lastIndex()); }
std::size_t lastIndex() const
Returns the index of the last element (undefined if empty).
art::Ptr< recob::PointCharge > chargePtr(std::size_t i) const
Returns an art pointer to the specified charge (no check done!).
std::size_t recob::ChargedSpacePointCollectionCreator::lastIndex ( ) const
inlineprivate

Returns the index of the last element (undefined if empty).

Definition at line 453 of file ChargedSpacePointCreator.h.

453 { return size() - 1U; }
std::size_t size() const
Returns the number of space points currently in the collection.
recob::SpacePoint const& recob::ChargedSpacePointCollectionCreator::lastSpacePoint ( ) const
inline

Returns the last inserted space point; undefined behaviour if empty().

Definition at line 377 of file ChargedSpacePointCreator.h.

378  { return spacePoint(lastIndex()); }
std::size_t lastIndex() const
Returns the index of the last element (undefined if empty).
recob::SpacePoint const & spacePoint(std::size_t i) const
Returns the specified space point; undefined behaviour if not there.
art::Ptr<recob::SpacePoint> recob::ChargedSpacePointCollectionCreator::lastSpacePointPtr ( ) const
inline

Returns an art pointer to the last inserted space point (no check!).

Definition at line 384 of file ChargedSpacePointCreator.h.

Referenced by reco3d::SpacePointSolver::FillSystemToSpacePointsAndAssns().

385  { return spacePointPtr(lastIndex()); }
art::Ptr< recob::SpacePoint > spacePointPtr(std::size_t i) const
Returns an art pointer to the specified space point (no check done!).
std::size_t lastIndex() const
Returns the index of the last element (undefined if empty).
void recob::ChargedSpacePointCollectionCreator::produces ( art::ProducerBase producer,
std::string const &  instanceName = {} 
)
static

Declares the data products being produced.

Parameters
producerthe module producing the data products
instanceName_(default: empty)_ name of instance of all data products

Call this method in the constructor of producer, e.g.:

MyProducer::MyProducer(Parameters const& config) {
(*this, config().instanceName());
} // MyProducer::MyProducer()

Definition at line 174 of file ChargedSpacePointCreator.cpp.

References art::ProductRegistryHelper::produces().

Referenced by chargePtr(), and reco3d::SpacePointSolver::SpacePointSolver().

175 {
176 
177  producer.produces<std::vector<recob::SpacePoint>>(instanceName);
178  producer.produces<std::vector<recob::PointCharge>>(instanceName);
179 
180 } // recob::ChargedSpacePointCollectionCreator::produces()
void produces(std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
void recob::ChargedSpacePointCollectionCreator::put ( )

Puts all data products into the event, leaving the creator empty().

The accumulated data is moved into the event.

This is the last valid action of the object. After this, only empty(), spent() and the art pointer makers (if enabled) are guaranteed to work.

Definition at line 132 of file ChargedSpacePointCreator.cpp.

References empty(), fCharges, fEvent, fInstanceName, fSpacePoints, art::Event::put(), and spent().

Referenced by reco3d::SpacePointSolver::produce().

132  {
133 
134  fEvent.put(std::move(fSpacePoints), fInstanceName);
135  fEvent.put(std::move(fCharges), fInstanceName);
136 
137  assert(spent());
138  assert(empty());
139 } // recob::ChargedSpacePointCollectionCreator::put()
art::Event & fEvent
The event this object is bound to.
std::unique_ptr< std::vector< recob::SpacePoint > > fSpacePoints
Space point data.
std::string fInstanceName
Instance name of all the data products.
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
bool spent() const
Returns whether put() has already been called.
bool empty() const
Returns whether there are currently no space points in the collection.
std::unique_ptr< std::vector< recob::PointCharge > > fCharges
Charge data.
std::size_t recob::ChargedSpacePointCollectionCreator::size ( ) const
inline

Returns the number of space points currently in the collection.

Definition at line 353 of file ChargedSpacePointCreator.h.

References clear().

353 { return spent()? 0U: fSpacePoints->size(); }
std::unique_ptr< std::vector< recob::SpacePoint > > fSpacePoints
Space point data.
bool spent() const
Returns whether put() has already been called.
recob::SpacePoint const& recob::ChargedSpacePointCollectionCreator::spacePoint ( std::size_t  i) const
inline

Returns the specified space point; undefined behaviour if not there.

Definition at line 373 of file ChargedSpacePointCreator.h.

374  { return fSpacePoints->operator[](i); }
std::unique_ptr< std::vector< recob::SpacePoint > > fSpacePoints
Space point data.
art::Ptr< recob::SpacePoint > recob::ChargedSpacePointCollectionCreator::spacePointPtr ( std::size_t  i) const

Returns an art pointer to the specified space point (no check done!).

Definition at line 156 of file ChargedSpacePointCreator.cpp.

References chargePtr(), and fSpacePointPtrMaker.

Referenced by clear().

157 {
158  return fSpacePointPtrMaker
159  ? (*fSpacePointPtrMaker)(i): art::Ptr<recob::SpacePoint>{};
160 } // recob::ChargedSpacePointCollectionCreator::spacePointPtr()
std::unique_ptr< art::PtrMaker< recob::SpacePoint > > fSpacePointPtrMaker
Space point pointer maker.
bool recob::ChargedSpacePointCollectionCreator::spent ( ) const
inline

Returns whether put() has already been called.

Definition at line 359 of file ChargedSpacePointCreator.h.

Referenced by put().

359 { return !fSpacePoints; }
std::unique_ptr< std::vector< recob::SpacePoint > > fSpacePoints
Space point data.

Member Data Documentation

std::unique_ptr<art::PtrMaker<recob::PointCharge> > recob::ChargedSpacePointCollectionCreator::fChargePtrMaker
private

Charge pointer maker.

Definition at line 450 of file ChargedSpacePointCreator.h.

Referenced by ChargedSpacePointCollectionCreator(), and chargePtr().

std::unique_ptr<std::vector<recob::PointCharge> > recob::ChargedSpacePointCollectionCreator::fCharges
private

Charge data.

Definition at line 448 of file ChargedSpacePointCreator.h.

Referenced by addAll(), clear(), and put().

art::Event& recob::ChargedSpacePointCollectionCreator::fEvent
private

The event this object is bound to.

Definition at line 439 of file ChargedSpacePointCreator.h.

Referenced by ChargedSpacePointCollectionCreator(), and put().

std::string recob::ChargedSpacePointCollectionCreator::fInstanceName
private

Instance name of all the data products.

Definition at line 441 of file ChargedSpacePointCreator.h.

Referenced by ChargedSpacePointCollectionCreator(), and put().

std::unique_ptr<art::PtrMaker<recob::SpacePoint> > recob::ChargedSpacePointCollectionCreator::fSpacePointPtrMaker
private

Space point pointer maker.

Definition at line 446 of file ChargedSpacePointCreator.h.

Referenced by ChargedSpacePointCollectionCreator(), and spacePointPtr().

std::unique_ptr<std::vector<recob::SpacePoint> > recob::ChargedSpacePointCollectionCreator::fSpacePoints
private

Space point data.

Definition at line 444 of file ChargedSpacePointCreator.h.

Referenced by addAll(), clear(), and put().


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