PtrVectorProducer_module.cc
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // Produces an PtrVector instance.
4 //
5 // ======================================================================
6 
13 #include "fhiclcpp/ParameterSet.h"
14 
15 #include <iostream>
16 #include <memory>
17 #include <vector>
18 
19 namespace arttest {
20  class PtrVectorProducer;
21 }
22 
24 
25 // ----------------------------------------------------------------------
26 
28 public:
29  using intvector_t = std::vector<int>;
31 
33  : EDProducer{p}, input_label_(p.get<std::string>("input_label"))
34  {
35  produces<product_t>();
36  }
37 
38 private:
39  void produce(art::Event& e) override;
40 
42 
43 }; // PtrVectorProducer
44 
45 // ----------------------------------------------------------------------
46 
47 void
49 {
50  std::cerr << "PtrVectorProducer::produce is running!\n";
51 
54 
55  std::unique_ptr<product_t> prod(new product_t);
56  for (int k = 0; k != 8; ++k) {
57  art::Ptr<int> p(h, 7 - k);
58  prod->push_back(p);
59  }
60  prod->sort();
61 
62  e.put(std::move(prod));
63 }
64 
65 // ----------------------------------------------------------------------
66 
68 
69 // ======================================================================
std::string string
Definition: nybbler.cc:12
EDProducer()=default
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:435
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:68
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:441
PtrVectorProducer(fhicl::ParameterSet const &p)
p
Definition: test.py:228
void produce(art::Event &e) override
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Definition: DataViewImpl.h:692
Definition: fwd.h:26
h
training ###############################
Definition: train_cnn.py:186