13 #ifndef LARDATA_ARTDATAHELPER_CHARGEDSPACEPOINTCREATOR_H 14 #define LARDATA_ARTDATAHELPER_CHARGEDSPACEPOINTCREATOR_H 27 #include <type_traits> 30 namespace art {
class Event;
class ProducesCollector; }
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
331 bool empty()
const {
return spent() || fSpacePoints->empty(); }
334 std::size_t
size()
const {
return spent()? 0U: fSpacePoints->size(); }
340 bool spent()
const {
return !fSpacePoints; }
355 {
return fSpacePoints->operator[](i); }
359 {
return spacePoint(lastIndex()); }
366 {
return spacePointPtr(lastIndex()); }
371 {
return fCharges->operator[](i); }
375 {
return charge(lastIndex()); }
382 {
return chargePtr(lastIndex()); }
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.
Reconstruction base classes.
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.
std::string fInstanceName
Instance name of all the data products.
Coord add(Coord c1, Coord c2)
std::unique_ptr< art::PtrMaker< recob::SpacePoint > > fSpacePointPtrMaker
Space point pointer maker.
Information about charge reconstructed in the active volume.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
art::Ptr< recob::PointCharge > lastChargePtr() const
Returns an art pointer to the inserted charge (no check!).
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().
Creates a collection of space points with associated charge.
std::unique_ptr< std::vector< recob::PointCharge > > fCharges
Charge data.
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.
vector< vector< double > > clear
Event finding and building.
std::unique_ptr< art::PtrMaker< recob::PointCharge > > fChargePtrMaker
Charge pointer maker.
Charge reconstructed in the active volume.