10 #ifndef ICARUSCODE_UTILITIES_DATAPRODUCTPOINTERMAP_H
11 #define ICARUSCODE_UTILITIES_DATAPRODUCTPOINTERMAP_H
18 #include "art/Framework/Principal/Event.h"
19 #include "art/Persistency/Common/PtrMaker.h"
20 #include "canvas/Persistency/Common/Ptr.h"
25 #include <type_traits>
41 template <
typename Handle>
106 template <
typename Handle>
108 (art::Event
const& event, Handle
const& handle);
119 template <
typename Handle>
121 -> DataProductPointerMap_t<ArtHandleData_t<Handle>>
123 using Data_t = ArtHandleData_t<Handle>;
124 using Map_t = DataProductPointerMap_t<Data_t>;
127 std::is_same_v<std::vector<Data_t>,
typename Handle::element_type>,
128 "mapDataProductPointers() requires handles to STL vectors of data"
132 art::PtrMaker<Data_t> makePtr { event, handle.id() };
134 map[&item] = makePtr(i);
141 #endif // ICARUSCODE_UTILITIES_DATAPRODUCTPOINTERMAP_H
Definition of util::enumerate().
std::map< T const *, art::Ptr< T >> DataProductPointerMap_t
auto enumerate(Iterables &&...iterables)
Range-for loop helper tracking the number of iteration.
typename Handle::element_type::value_type ArtHandleData_t
Type of data in a art handle to vector data product.
DataProductPointerMap_t< ArtHandleData_t< Handle > > mapDataProductPointers(art::Event const &event, Handle const &handle)
Creates a map from address of data product element to art pointer to it.
details::DataProductPointerMap_t< T > DataProductPointerMap_t
Type of map for data product pointers to art pointers.