13 #ifndef LARDATA_ARTDATAHELPER_CHARGEDSPACEPOINTCREATOR_H
14 #define LARDATA_ARTDATAHELPER_CHARGEDSPACEPOINTCREATOR_H
21 #include "art/Persistency/Common/PtrMaker.h"
22 #include "canvas/Persistency/Common/Ptr.h"
27 #include <type_traits>
30 namespace art {
class Event;
class ProducesCollector; }
244 (art::Event& event, std::string
const& instanceName = {});
256 std::string
const& instanceName = {});
300 std::vector<recob::SpacePoint>&& spacePoints,
301 std::vector<recob::PointCharge>&& charges
304 std::vector<recob::SpacePoint>
const& spacePoints,
305 std::vector<recob::PointCharge>
const& charges
362 art::Ptr<recob::SpacePoint>
spacePointPtr(std::size_t i)
const;
378 art::Ptr<recob::PointCharge>
chargePtr(std::size_t i)
const;
413 (art::ProducesCollector& producesCollector, std::string
const& instanceName = {});
429 std::unique_ptr<std::vector<recob::PointCharge>>
fCharges;
443 #endif // LARDATA_ARTDATAHELPER_CHARGEDSPACEPOINTCREATOR_H
std::size_t size() const
Returns the number of space points currently in the collection.
art::Ptr< recob::SpacePoint > spacePointPtr(std::size_t i) const
Returns an art pointer to the specified space point (no check done!).
art::Event & fEvent
The event this object is bound to.
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::SpacePoint > lastSpacePointPtr() const
Returns an art pointer to the last inserted space point (no check!).
std::unique_ptr< std::vector< recob::SpacePoint > > fSpacePoints
Space point data.
static void produces(art::ProducesCollector &producesCollector, std::string const &instanceName={})
Declares the data products being produced.
std::string fInstanceName
Instance name of all the data products.
std::unique_ptr< art::PtrMaker< recob::SpacePoint > > fSpacePointPtrMaker
Space point pointer maker.
Information about charge reconstructed in the active volume.
art::Ptr< recob::PointCharge > lastChargePtr() const
Returns an art pointer to the inserted charge (no check!).
ChargedSpacePointCollectionCreator(art::Event &event, std::string const &instanceName={})
Constructor binding this object to a specific art event.
bool spent() const
Returns whether put() has already been called.
recob::PointCharge const & lastCharge() const
Returns the last inserted charge; undefined behaviour if empty().
bool empty() const
Returns whether there are currently no space points in the collection.
recob::SpacePoint const & lastSpacePoint() const
Returns the last inserted space point; undefined behaviour if empty().
static ChargedSpacePointCollectionCreator forPtrs(art::Event &event, std::string const &instanceName={})
Static function binding a new object to a specific art event.
Creates a collection of space points with associated charge.
art::Ptr< recob::PointCharge > chargePtr(std::size_t i) const
Returns an art pointer to the specified charge (no check done!).
std::unique_ptr< std::vector< recob::PointCharge > > fCharges
Charge data.
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.
bool canMakePointers() const
Returns whether art pointer making is enabled.
recob::SpacePoint const & spacePoint(std::size_t i) const
Returns the specified space point; undefined behaviour if not there.
void put()
Puts all data products into the event, leaving the creator empty().
void clear()
Removes all data from the collection, making it empty().
void add(recob::SpacePoint const &spacePoint, recob::PointCharge const &charge)
Inserts the specified space point and associated data into the collection.
std::unique_ptr< art::PtrMaker< recob::PointCharge > > fChargePtrMaker
Charge pointer maker.
Charge reconstructed in the active volume.