10 #include "art/Framework/Core/EDProducer.h"
11 #include "art/Framework/Core/ModuleMacros.h"
12 #include "art/Framework/Principal/Event.h"
13 #include "fhiclcpp/ParameterSet.h"
14 #include "art/Persistency/Common/PtrMaker.h"
35 void produce(art::Event &
e)
override;
44 : EDProducer{p}, nvalues(
p.get<
int>(
"nvalues") )
46 produces<intvector_t>();
47 produces<intPtrvector_t>();
52 std::cerr <<
"PtrMakerProducer 2 is running!\n";
53 int value_ = e.id().event();
54 std::unique_ptr<intvector_t> intvector(
new intvector_t);
55 auto intptrs = std::make_unique<intPtrvector_t>();
56 art::PtrMaker<int> make_intptr(e);
58 for(
int i = 0; i !=
nvalues; ++i ) {
59 intvector->push_back(value_ * i);
60 auto p = make_intptr(i);
61 intptrs->push_back(
p);
63 e.put(std::move(intvector));
64 e.put(std::move(intptrs));
PtrMakerProducer2(fhicl::ParameterSet const &p)
void produce(art::Event &e) override
art::PtrVector< int > intPtrvector_t
BEGIN_PROLOG could also be cerr
std::vector< int > intvector_t
PtrMakerProducer2 & operator=(PtrMakerProducer2 const &)=delete