diff --git a/RecoTracker/LST/plugins/alpaka/LSTProducer.cc b/RecoTracker/LST/plugins/alpaka/LSTProducer.cc index 00bd439460d..26a5142ee9f 100644 --- a/RecoTracker/LST/plugins/alpaka/LSTProducer.cc +++ b/RecoTracker/LST/plugins/alpaka/LSTProducer.cc @@ -18,28 +18,39 @@ #include "RecoTracker/LST/interface/LSTPhase2OTHitsInput.h" #include "RecoTracker/LST/interface/LSTOutput.h" +#include "HeterogeneousCore/SonicTriton/interface/TritonEDProducer.h" + #ifdef ALPAKA_ACC_GPU_CUDA_ENABLED #include "SDL/LST.h" #endif // ALPAKA_ACC_GPU_CUDA_ENABLED namespace ALPAKA_ACCELERATOR_NAMESPACE { - class LSTProducer : public edm::stream::EDProducer { + class LSTProducer : public TritonEDProducer<> { public: - LSTProducer(edm::ParameterSet const& config) + LSTProducer(edm::ParameterSet& config) : lstPixelSeedInputToken_{consumes(config.getParameter("pixelSeedInput"))}, lstPhase2OTHitsInputToken_{ consumes(config.getParameter("phase2OTHitsInput"))}, verbose_(config.getParameter("verbose")), lstOutputToken_{produces()} {} - void acquire(edm::Event const& event, edm::EventSetup const& setup, edm::WaitingTaskWithArenaHolder task) override { + //void acquire(edm::Event const& event, edm::EventSetup const& setup, edm::WaitingTaskWithArenaHolder task) override { + void acquire(edm::Event const& iEvent, edm::EventSetup const& iSetup, edm::WaitingTaskWithArenaHolder task, Input& iInput) { // create a context based on the EDM stream number - cms::alpakatools::ScopedContextAcquire ctx{event.streamID(), std::move(task)}; + cms::alpakatools::ScopedContextAcquire ctx{iEvent.streamID(), std::move(task)}; // Inputs - auto const& pixelSeeds = event.get(lstPixelSeedInputToken_); - auto const& phase2OTHits = event.get(lstPhase2OTHitsInputToken_); + auto const& pixelSeeds = iEvent.get(lstPixelSeedInputToken_); + auto const& phase2OTHits = iEvent.get(lstPhase2OTHitsInputToken_); + + + ////auto& input = iInput.at("input"); + ////auto pfdata = input.allocate(); + ////auto& vpfdata = (*pfdata)[0]; + ////for (const auto& pixelSeed : pixelSeeds) { + ////vpfdata.push_back(pixelSeed.dx()); + ////} #ifdef ALPAKA_ACC_GPU_CUDA_ENABLED lst_.eventSetup(); @@ -67,12 +78,12 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { #endif // ALPAKA_ACC_GPU_CUDA_ENABLED } - void produce(edm::Event& event, edm::EventSetup const&) override { + void produce(edm::Event& iEvent, edm::EventSetup const& iSetup, Output const& iOutput) { // Output LSTOutput lstOutput; lstOutput.setLSTOutputTraits(lst_.hits(), lst_.len(), lst_.seedIdx(), lst_.trackCandidateType()); - event.emplace(lstOutputToken_, std::move(lstOutput)); + iEvent.emplace(lstOutputToken_, std::move(lstOutput)); } static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {