13 #ifndef LARDATA_ARTDATAHELPER_CHARGEDSPACEPOINTCREATOR_H 14 #define LARDATA_ARTDATAHELPER_CHARGEDSPACEPOINTCREATOR_H 29 #include <type_traits> 37 template <
typename T,
typename =
void>
270 template <
typename Producer>
273 std::string
const& instanceName = {},
274 std::enable_if_t<details::is_art_module_v<Producer>>* = nullptr
319 std::vector<recob::SpacePoint>&& spacePoints,
320 std::vector<recob::PointCharge>&& charges
323 std::vector<recob::SpacePoint>
const& spacePoints,
324 std::vector<recob::PointCharge>
const& charges
350 bool empty()
const {
return spent() || fSpacePoints->empty(); }
353 std::size_t
size()
const {
return spent()? 0U: fSpacePoints->size(); }
359 bool spent()
const {
return !fSpacePoints; }
374 {
return fSpacePoints->operator[](i); }
378 {
return spacePoint(lastIndex()); }
385 {
return spacePointPtr(lastIndex()); }
390 {
return fCharges->operator[](i); }
394 {
return charge(lastIndex()); }
401 {
return chargePtr(lastIndex()); }
448 std::unique_ptr<std::vector<recob::PointCharge>>
fCharges;
468 template <
typename T>
471 template <
typename T,
typename >
474 template <
typename T>
476 <T,
std::enable_if_t<always_true_v<typename T::ModuleType>>>
477 :
public std::true_type
488 template <
typename Producer>
491 Producer
const& producer,
492 std::string
const& instanceName ,
493 std::enable_if_t<details::is_art_module_v<Producer>>*
508 #endif // LARDATA_ARTDATAHELPER_CHARGEDSPACEPOINTCREATOR_H std::size_t size() const
Returns the number of space points currently in the collection.
Reconstruction base classes.
constexpr bool is_art_module_v
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.
std::unique_ptr< art::PtrMaker< recob::SpacePoint > > fSpacePointPtrMaker
Space point pointer maker.
Information about charge reconstructed in the active volume.
constexpr bool always_true_v
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().
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.
Event finding and building.
std::unique_ptr< art::PtrMaker< recob::PointCharge > > fChargePtrMaker
Charge pointer maker.
Charge reconstructed in the active volume.