AssnProducer2_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: AssnProducer2
3 // Plugin Type: producer (art v2_05_00)
4 // File: AssnProducer2_module.cc
5 //
6 // Generated at Tue Dec 13 14:04:05 2016 by Saba Sehrish using cetskelgen
7 // from cetlib version v1_21_00.
8 ////////////////////////////////////////////////////////////////////////
9 
14 #include "fhiclcpp/ParameterSet.h"
17 
18 namespace lartest {
19  class AssnProducer2;
20 }
21 
23 
25 public:
26  explicit AssnProducer2(fhicl::ParameterSet const & p);
27  // The compiler-generated destructor is fine for non-base
28  // classes without bare pointers or other resource use.
29 
30  // Plugins should not be copied or assigned.
31  AssnProducer2(AssnProducer2 const &) = delete;
32  AssnProducer2(AssnProducer2 &&) = delete;
33  AssnProducer2 & operator = (AssnProducer2 const &) = delete;
35 
36  // Required functions.
37  void produce(art::Event & e) override;
38 
39 private:
41  // Declare member data here.
42 
43 };
44 
45 
47  : EDProducer{p}
48  , fInputLabel(p.get<std::string>("input_label"))
49 {
50  produces<art::Assns<int, std::string>>();
51 }
52 
54 {
56  e.getByLabel(fInputLabel, ih);
58  e.getByLabel(fInputLabel, sh);
59 
60  art::PtrMaker<int> make_intptr(e, ih.id());
61  art::PtrMaker<std::string> make_strptr(e, sh.id());
62 
63  auto assns = std::make_unique<art::Assns<int, std::string>>();
64  for (size_t i=0; i < 3; ++i) {
65  auto p1 = make_intptr(i);
66  for(size_t j=0; j < 2; ++j) {
67  auto p2 = make_strptr(i*2+j);
68  assns -> addSingle(p1, p2);
69  }
70  }
71  e.put(std::move(assns));
72 }
73 
std::string string
Definition: nybbler.cc:12
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
AssnProducer2(fhicl::ParameterSet const &p)
void produce(art::Event &e) override
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:67
def move(depos, offset)
Definition: depos.py:107
p
Definition: test.py:223
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
ProductID id() const
Definition: Handle.h:212
AssnProducer2 & operator=(AssnProducer2 const &)=delete