55 async<art::InEvent>();
57 produces<double>(
"doubleLabel");
58 produces<IntProduct>(
"IntProductLabel");
59 produces<IntProduct>(
"SpottyProductLabel");
60 produces<std::string>(
"stringLabel");
61 produces<std::vector<double>>(
"doubleCollectionLabel");
62 produces<std::vector<art::Ptr<double>>>(
"doubleVectorPtrLabel");
63 produces<art::PtrVector<double>>(
"doublePtrVectorLabel");
64 produces<ProductWithPtrs>(
"ProductWithPtrsLabel");
65 produces<mv_t>(
"mapVectorLabel");
66 produces<std::vector<art::Ptr<mvv_t>>>(
"intVectorPtrLabel");
67 produces<double, art::InSubRun>(
"DoubleSRLabel");
68 produces<double, art::InRun>(
"DoubleRLabel");
84 if (e.
event() % 100) {
90 s <<
"string value: " << std::setfill(
'0') << std::setw(7) <<
eventCounter_ 92 e.
put(std::make_unique<std::string>(s.str()),
"stringLabel");
101 auto coll = std::make_unique<std::vector<double>>();
103 for (
size_t i = 1;
i < 11; ++
i) {
104 coll->push_back(
i + 10 * (eventCounter_ - 1));
106 e.
put(move(coll),
"doubleCollectionLabel");
107 auto vpd = std::make_unique<std::vector<art::Ptr<double>>>();
109 auto pvd = std::make_unique<art::PtrVector<double>>();
112 e.
getProductID<std::vector<double>>(
"doubleCollectionLabel")};
119 auto pwp = std::make_unique<ProductWithPtrs>(
120 #ifndef ART_NO_MIX_PTRVECTOR 124 e.
put(move(vpd),
"doubleVectorPtrLabel");
125 e.
put(std::move(pvd),
"doublePtrVectorLabel");
126 e.
put(move(pwp),
"ProductWithPtrsLabel");
129 auto mv = std::make_unique<mv_t>();
130 static size_t constexpr mv_size{5};
131 mv->reserve(mv_size);
132 for (
size_t i = 0;
i < mv_size; ++
i) {
134 static_cast<mvm_t>(1 +
i * 2 + 10 * (eventCounter_ - 1)))] =
135 (eventCounter_ - 1) * mv_size +
i + 1;
139 auto mvvp = std::make_unique<std::vector<art::Ptr<mvv_t>>>();
140 mvvp->reserve(mv_size);
142 mvvp->emplace_back(mvID, 10 * (eventCounter_ - 1) + 7, e.
productGetter(mvID));
143 mvvp->emplace_back(mvID, 10 * (eventCounter_ - 1) + 1, e.
productGetter(mvID));
144 mvvp->emplace_back(mvID, 10 * (eventCounter_ - 1) + 3, e.
productGetter(mvID));
145 mvvp->emplace_back(mvID, 10 * (eventCounter_ - 1) + 9, e.
productGetter(mvID));
146 mvvp->emplace_back(mvID, 10 * (eventCounter_ - 1) + 5, e.
productGetter(mvID));
148 e.
put(move(mvvp),
"intVectorPtrLabel");
149 e.
put(move(mv),
"mapVectorLabel");
std::atomic< size_t > eventCounter_
EventNumber_t event() const
std::atomic< size_t > subrunCounter_
MixProducer(Parameters const &p, art::ProcessingFrame const &)
ProductID getProductID(std::string const &instance_name="") const
std::pair< key_type, mapped_type > value_type
std::atomic< size_t > runCounter_
void endSubRun(art::SubRun &sr, art::ProcessingFrame const &) override
#define DEFINE_ART_MODULE(klass)
void produce(art::Event &e, art::ProcessingFrame const &) override
SharedProducer(fhicl::ParameterSet const &pset)
EDProductGetter const * productGetter(ProductID const pid) const
void endRun(art::Run &r, art::ProcessingFrame const &) override
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)