PtrmvProducer_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: PtrmvProducer
3 // Module Type: producer
4 // File: PtrmvProducer_module.cc
5 //
6 // Generated at Tue May 31 08:00:52 2011 by Chris Green using artmod
7 // from art v0_07_07.
8 ////////////////////////////////////////////////////////////////////////
9 
15 
16 #include "cetlib/map_vector.h"
17 
18 #include <string>
19 
20 namespace arttest {
21  class PtrmvProducer;
22 }
23 
24 namespace {
25  using mv_t = cet::map_vector<std::string>;
26  using mvp_t = mv_t::value_type;
27 }
28 
30 public:
31  struct Config {
32  };
34  explicit PtrmvProducer(Parameters const&);
35 
36 private:
37  void produce(art::Event& e) override;
38 };
39 
41 {
42  produces<mv_t>();
43  produces<art::Ptr<std::string>>();
44  produces<art::PtrVector<std::string>>();
45  produces<art::Ptr<mvp_t>>();
46  produces<art::PtrVector<mvp_t>>();
47 }
48 
49 void
51 {
52  auto mv = std::make_unique<mv_t>();
53  mv->reserve(4);
54  (*mv)[cet::map_vector_key(0)] = "ONE";
55  (*mv)[cet::map_vector_key(3)] = "TWO";
56  (*mv)[cet::map_vector_key(5)] = "THREE";
57  (*mv)[cet::map_vector_key(7)] = "FOUR";
58 
59  art::ProductID const mvID{e.put(std::move(mv))};
60 
61  e.put(
62  std::make_unique<art::Ptr<std::string>>(mvID, 3, e.productGetter(mvID)));
63 
64  auto pv = std::make_unique<art::PtrVector<std::string>>();
65  pv->reserve(4);
66  pv->push_back(art::Ptr<std::string>{mvID, 5, e.productGetter(mvID)});
67  pv->push_back(art::Ptr<std::string>{mvID, 0, e.productGetter(mvID)});
68  pv->push_back(art::Ptr<std::string>{mvID, 7, e.productGetter(mvID)});
69  pv->push_back(art::Ptr<std::string>{mvID, 3, e.productGetter(mvID)});
70 
71  e.put(std::move(pv));
72  e.put(std::make_unique<art::Ptr<mvp_t>>(mvID, 3, e.productGetter(mvID)));
73 
74  auto pvp = std::make_unique<art::PtrVector<mvp_t>>();
75  pvp->reserve(4);
76  pvp->push_back(art::Ptr<mvp_t>{mvID, 5, e.productGetter(mvID)});
77  pvp->push_back(art::Ptr<mvp_t>{mvID, 0, e.productGetter(mvID)});
78  pvp->push_back(art::Ptr<mvp_t>{mvID, 7, e.productGetter(mvID)});
79  pvp->push_back(art::Ptr<mvp_t>{mvID, 3, e.productGetter(mvID)});
80 
81  e.put(std::move(pvp));
82 }
83 
static const double ps
Definition: Units.h:103
EDProducer()=default
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:68
EDProductGetter const * productGetter(ProductID const pid) const
void produce(art::Event &e) override
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Definition: DataViewImpl.h:692
PtrmvProducer(Parameters const &)
Definition: fwd.h:26