ToyProductProducer_module.cc
Go to the documentation of this file.
1 //--------------------------------------------------------------------
2 //
3 // Produces an ToyProductProducer instance.
4 //
5 //--------------------------------------------------------------------
6 
12 
14 
15 namespace fhicl {
16  class ParameterSet;
17 }
18 
19 using art::RangeSet;
20 
21 namespace arttest {
22 
24  public:
25  struct Config {
26  };
28 
29  explicit ToyProductProducer(Parameters const& ps) : EDProducer{ps}
30  {
31  produces<StringProduct, art::InRun>();
32  produces<StringProduct, art::InRun>("bgnRun");
33  produces<StringProduct, art::InRun>("endRun");
34 
35  produces<StringProduct, art::InSubRun>();
36  produces<StringProduct, art::InSubRun>("bgnSubRun");
37  produces<StringProduct, art::InSubRun>("endSubRun");
38 
39  produces<StringProduct>();
40  }
41 
42  private:
43  void
44  beginRun(art::Run& r) override
45  {
46  r.put(std::make_unique<StringProduct>("empty"), art::fullRun());
47  r.put(
48  std::make_unique<StringProduct>("beginRun"), "bgnRun", art::fullRun());
49  }
50 
51  void
53  {
54  sr.put(std::make_unique<StringProduct>("emptyAgain"), art::fullSubRun());
55  sr.put(std::make_unique<StringProduct>("beginSubRun"),
56  "bgnSubRun",
57  art::fullSubRun());
58  }
59 
60  void
61  produce(art::Event& e) override
62  {
63  e.put(std::make_unique<StringProduct>("event"));
64  }
65 
66  void
68  {
69  sr.put(std::make_unique<StringProduct>("endSubRun"),
70  "endSubRun",
71  art::fullSubRun());
72  }
73 
74  void
75  endRun(art::Run& r) override
76  {
77  r.put(
78  std::make_unique<StringProduct>("endRun"), "endRun", art::fullRun());
79  }
80 
81  }; // ToyProductProducer
82 
83 } // namespace arttest
84 
void endSubRun(art::SubRun &sr) override
constexpr auto fullRun()
static const double ps
Definition: Units.h:103
void beginRun(art::Run &r) override
Definition: Run.h:21
ToyProductProducer(Parameters const &ps)
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:68
parameter set interface
void endRun(art::Run &r) override
void beginSubRun(art::SubRun &sr) override
void produce(art::Event &e) override
constexpr auto fullSubRun()
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Definition: DataViewImpl.h:692
static const double sr
Definition: Units.h:167