PtrMakerProducer_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: PtrMakerProducer
3 // Plugin Type: producer (art v2_05_00)
4 // File: PtrMakerProducer_module.cc
5 //
6 // Generated at Tue Nov 22 22:44:53 2016 by Saba Sehrish using cetskelgen
7 // from cetlib version v1_21_00.
8 ////////////////////////////////////////////////////////////////////////
9 
16 #include "fhiclcpp/ParameterSet.h"
17 
19 
20 #include <iostream>
21 #include <memory>
22 
23 namespace lartest {
24  class PtrMakerProducer;
25 }
26 
28 
30 public:
31  typedef std::vector<int> intvector_t;
33 
34  explicit PtrMakerProducer(fhicl::ParameterSet const & p);
35 
36  // The compiler-generated destructor is fine for non-base
37  // classes without bare pointers or other resource use.
38 
39  // Plugins should not be copied or assigned.
40  PtrMakerProducer(PtrMakerProducer const &) = delete;
42  PtrMakerProducer & operator = (PtrMakerProducer const &) = delete;
44 
45  // Required functions.
46  void produce(art::Event & e) override;
47 
48 private:
49 
50  // Declare member data here.
52 
53 };
54 
55 
57  : EDProducer{p}, fInputLabel( p.get<std::string>("input_label") )
58  {
59  produces<intPtrvector_t>();
60  }
61 
63 {
64  std::cerr << "PtrMakerProducer::produce is running!\n";
66  e.getByLabel(fInputLabel, 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);
72  }
73  e.put(std::move(intptrs));
74 }
75 
std::string string
Definition: nybbler.cc:12
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
PtrMakerProducer & operator=(PtrMakerProducer const &)=delete
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
art::PtrVector< int > intPtrvector_t
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
void produce(art::Event &e) override
PtrMakerProducer(fhicl::ParameterSet const &p)
ProductID id() const
Definition: Handle.h:212