TH1DataProducer_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: TH1DataProducer
3 // Module Type: producer
4 // File: TH1DataProducer_module.cc
5 //
6 // Generated at Mon Aug 19 18:01:04 2013 by Chris Green using artmod
7 // from cetpkgsupport v1_02_00.
8 ////////////////////////////////////////////////////////////////////////
9 
18 #include "fhiclcpp/ParameterSet.h"
19 
20 #include <memory>
21 
22 namespace arttest {
23  class TH1DataProducer;
24 }
25 
27 public:
28  explicit TH1DataProducer(fhicl::ParameterSet const& p);
29 
30 private:
31  void beginRun(art::Run& r) override;
32  void endRun(art::Run& r) override;
33  void produce(art::Event& e) override;
34 
35  std::unique_ptr<arttest::TH1Data> data_{std::make_unique<arttest::TH1Data>()};
36 };
37 
39  : EDProducer{ps}
40 {
41  data_->data = TH1D("name", "title", 101, -.5, 100.5);
42  produces<arttest::TH1Data, art::InRun>();
43 }
44 
45 void
47 {
48  data_->data.Fill(e.event() % 100, 1.);
49 }
50 
51 void
53 {
54  // Implementation of optional member function here.
55 }
56 
57 void
59 {
60  r.put(std::move(data_), art::runFragment());
61  // Implementation of optional member function here.
62 }
63 
EventNumber_t event() const
Definition: DataViewImpl.cc:96
void beginRun(art::Run &r) override
static const double ps
Definition: Units.h:103
EDProducer()=default
void produce(art::Event &e) override
Definition: Run.h:21
TH1DataProducer(fhicl::ParameterSet const &p)
constexpr auto runFragment()
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:68
void endRun(art::Run &r) override
p
Definition: test.py:228
std::unique_ptr< arttest::TH1Data > data_
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Definition: DataViewImpl.h:692