CMS 3D CMS Logo

TestAlpakaGlobalProducerE.cc
Go to the documentation of this file.
12 
13 #include "TestAlgo.h"
14 
23  public:
25  : esToken_(esConsumes(config.getParameter<edm::ESInputTag>("eventSetupSource"))),
26  getToken_(consumes(config.getParameter<edm::InputTag>("source"))),
27  getTokenMulti2_(consumes(config.getParameter<edm::InputTag>("source"))),
28  getTokenMulti3_(consumes(config.getParameter<edm::InputTag>("source"))),
32 
33  void produce(edm::StreamID, device::Event& iEvent, device::EventSetup const& iSetup) const override {
34  auto const& esData = iSetup.getData(esToken_);
35  auto const& input = iEvent.get(getToken_);
36  auto const& inputMulti2 = iEvent.get(getTokenMulti2_);
37  auto const& inputMulti3 = iEvent.get(getTokenMulti3_);
38 
39  // run the algorithm, potentially asynchronously
40  auto deviceProduct = algo_.update(iEvent.queue(), input, esData);
41  auto deviceProductMulti2 = algo_.updateMulti2(iEvent.queue(), inputMulti2, esData);
42  auto deviceProductMulti3 = algo_.updateMulti3(iEvent.queue(), inputMulti3, esData);
43 
44  iEvent.emplace(putToken_, std::move(deviceProduct));
45  iEvent.emplace(putTokenMulti2_, std::move(deviceProductMulti2));
46  iEvent.emplace(putTokenMulti3_, std::move(deviceProductMulti3));
47  }
48 
49  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
51  desc.add("eventSetupSource", edm::ESInputTag{});
52  desc.add("source", edm::InputTag{});
53 
54  descriptions.addWithDefaultLabel(desc);
55  }
56 
57  private:
65 
66  // implementation of the algorithm
68  };
69 
70 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
71 
73 DEFINE_FWK_ALPAKA_MODULE(TestAlpakaGlobalProducerE);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const device::EDPutToken< portabletest::TestDeviceCollection > putToken_
const device::EDPutToken< portabletest::TestDeviceMultiCollection3 > putTokenMulti3_
const device::ESGetToken< AlpakaESTestDataEDevice, AlpakaESTestRecordC > esToken_
void produce(edm::StreamID, device::Event &iEvent, device::EventSetup const &iSetup) const override
Definition: config.py:1
const device::EDGetToken< portabletest::TestDeviceMultiCollection2 > getTokenMulti2_
portabletest::TestDeviceCollection update(Queue &queue, portabletest::TestDeviceCollection const &input, AlpakaESTestDataEDevice const &esData) const
static std::string const input
Definition: EdmProvDump.cc:50
int iEvent
Definition: GenABIO.cc:224
portabletest::TestDeviceMultiCollection2 updateMulti2(Queue &queue, portabletest::TestDeviceMultiCollection2 const &input, AlpakaESTestDataEDevice const &esData) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const device::EDPutToken< portabletest::TestDeviceMultiCollection2 > putTokenMulti2_
const device::EDGetToken< portabletest::TestDeviceMultiCollection3 > getTokenMulti3_
T const & getData(edm::ESGetToken< T, R > const &iToken) const
Definition: EventSetup.h:32
HLT enums.
auto produces(std::string instanceName) noexcept
declare what type of product will make and with which optional label
#define DEFINE_FWK_ALPAKA_MODULE(name)
Definition: MakerMacros.h:16
portabletest::TestDeviceMultiCollection3 updateMulti3(Queue &queue, portabletest::TestDeviceMultiCollection3 const &input, AlpakaESTestDataEDevice const &esData) const
const device::EDGetToken< portabletest::TestDeviceCollection > getToken_
def move(src, dest)
Definition: eostools.py:511