10 #include "art/Framework/Core/EDProducer.h"
11 #include "art/Framework/Core/ModuleMacros.h"
12 #include "art/Framework/Principal/Event.h"
13 #include "art/Framework/Principal/Handle.h"
14 #include "canvas/Persistency/Common/Ptr.h"
15 #include "canvas/Persistency/Common/PtrVector.h"
16 #include "fhiclcpp/ParameterSet.h"
18 #include "art/Persistency/Common/PtrMaker.h"
46 void produce(art::Event &
e)
override;
56 PtrMakerProducer::PtrMakerProducer(fhicl::ParameterSet
const &
p)
57 : EDProducer{p}, fInputLabel(
p.get<std::string>(
"input_label") )
59 produces<intPtrvector_t>();
64 std::cerr <<
"PtrMakerProducer::produce is running!\n";
65 art::Handle<std::vector<int>>
h;
67 art::PtrMaker<int> make_intptr(e, h.id());
68 auto intptrs = std::make_unique<intPtrvector_t>();
69 for (
size_t i = 0; i < h->size(); ++i ) {
70 auto p = make_intptr(i);
71 intptrs->push_back(
p);
73 e.put(std::move(intptrs));
std::vector< int > intvector_t
BEGIN_PROLOG could also be cerr
PtrMakerProducer & operator=(PtrMakerProducer const &)=delete
art::PtrVector< int > intPtrvector_t
void produce(art::Event &e) override
PtrMakerProducer(fhicl::ParameterSet const &p)