HMSubRunProdProducer_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: HMSubRunProdProducer
3 // Module Type: producer
4 // File: HMSubRunProdProducer_module.cc
5 //
6 // Generated at Tue Apr 15 13:28:20 2014 by Christopher Green using artmod
7 // from cetpkgsupport v1_05_03.
8 ////////////////////////////////////////////////////////////////////////
9 
18 #include "fhiclcpp/ParameterSet.h"
19 
20 #include <memory>
21 
22 using namespace std::string_literals;
23 
24 namespace arttest {
25  class HMSubRunProdProducer;
26 }
27 
29 public:
31 
32 private:
33  void produce(art::Event&) override{};
34  void endSubRun(art::SubRun& sr) override;
35 };
36 
38  fhicl::ParameterSet const& ps)
39  : EDProducer{ps}
40 {
41  for (unsigned short i = 0; i < N_BLOCKS; ++i) {
42  produces<HMLargeData, art::InSubRun>("block"s + std::to_string(i));
43  }
44 }
45 
46 void
48 {
49  auto stencil = std::make_unique<HMLargeData>();
50  std::iota(stencil->data(), stencil->data() + stencil->size(), 0);
51 
52  for (unsigned short i = 0; i < N_BLOCKS; ++i) {
53  auto prod = std::make_unique<HMLargeData>(*stencil);
54  sr.put(
55  std::move(prod), "block"s + std::to_string(i), art::subRunFragment());
56  }
57 }
58 
HMSubRunProdProducer(fhicl::ParameterSet const &)
static const double ps
Definition: Units.h:103
void endSubRun(art::SubRun &sr) override
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:68
constexpr unsigned short N_BLOCKS
Definition: HMLargeData.h:12
constexpr auto subRunFragment()
static const double s
Definition: Units.h:99
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Definition: DataViewImpl.h:692
static const double sr
Definition: Units.h:167
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34