CMS 3D CMS Logo

HcalMahiPulseOffsetsESProducer.cc
Go to the documentation of this file.
2 
6 
12 
15  public:
17  std::vector<int> offsets = iConfig.getParameter<std::vector<int>>("pulseOffsets");
18 
19  product = std::make_unique<hcal::HcalMahiPulseOffsetsPortableHost>(offsets.size(), cms::alpakatools::host());
20 
21  auto view = product->view();
22 
23  for (uint32_t i = 0; i < offsets.size(); i++) {
24  view[i] = offsets[i];
25  }
26  setWhatProduced(this);
27  }
28 
29  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
31  desc.add<std::vector<int>>("pulseOffsets", {-3, -2, -1, 0, 1, 2, 3, 4});
32  descriptions.addWithDefaultLabel(desc);
33  }
34 
35  std::shared_ptr<hcal::HcalMahiPulseOffsetsPortableHost> produce(JobConfigurationGPURecord const& iRecord) {
36  return product;
37  }
38 
39  private:
40  std::shared_ptr<hcal::HcalMahiPulseOffsetsPortableHost> product;
41  };
42 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
43 
44 DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(HcalMahiPulseOffsetsESProducer);
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:166
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::shared_ptr< hcal::HcalMahiPulseOffsetsPortableHost > product
alpaka::DevCpu const & host()
Definition: host.h:14
std::shared_ptr< hcal::HcalMahiPulseOffsetsPortableHost > produce(JobConfigurationGPURecord const &iRecord)
#define DEFINE_FWK_EVENTSETUP_ALPAKA_MODULE(type)
Definition: ModuleFactory.h:17
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)