CMS 3D CMS Logo

SiPixelRecHitAlpaka.cc
Go to the documentation of this file.
21 
29 
33 
34 #include "PixelRecHitKernel.h"
35 
37  template <typename TrackerTraits>
39  public:
40  explicit SiPixelRecHitAlpaka(const edm::ParameterSet& iConfig);
41  ~SiPixelRecHitAlpaka() override = default;
42 
43  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
44 
45  private:
46  void produce(edm::StreamID streamID, device::Event& iEvent, const device::EventSetup& iSetup) const override;
47 
53 
55  };
56 
57  template <typename TrackerTraits>
59  : cpeToken_(esConsumes(edm::ESInputTag("", iConfig.getParameter<std::string>("CPE")))),
60  tBeamSpot(consumes(iConfig.getParameter<edm::InputTag>("beamSpot"))),
61  tokenClusters_(consumes(iConfig.getParameter<edm::InputTag>("src"))),
62  tokenDigi_(consumes(iConfig.getParameter<edm::InputTag>("src"))),
63  tokenHit_(produces()) {
64  // Workaround until the ProductID problem in issue https://github.com/cms-sw/cmssw/issues/44643 is fixed
65 #ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED
66  if constexpr (std::is_same_v<TrackerTraits, pixelTopology::Phase1>) {
67  producesTemporarily("edm::DeviceProduct<alpaka_cuda_async::TrackingRecHitSoAPhase1>");
68  }
69 #endif
70  }
71 
72  template <typename TrackerTraits>
75 
76  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpotDevice"));
77  desc.add<edm::InputTag>("src", edm::InputTag("siPixelClustersPreSplittingAlpaka"));
78 
79  std::string cpe = "PixelCPEFastParams";
80  cpe += TrackerTraits::nameModifier;
81  desc.add<std::string>("CPE", cpe);
82 
83  descriptions.addWithDefaultLabel(desc);
84  }
85 
86  template <typename TrackerTraits>
89  const device::EventSetup& es) const {
90  auto& fcpe = es.getData(cpeToken_);
91 
92  auto const& clusters = iEvent.get(tokenClusters_);
93 
94  auto const& digis = iEvent.get(tokenDigi_);
95 
96  auto const& bs = iEvent.get(tBeamSpot);
97 
98  iEvent.emplace(tokenHit_,
99  Algo_.makeHitsAsync(digis, clusters, bs.data(), fcpe.const_buffer().data(), iEvent.queue()));
100  }
103 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
104 
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const device::EDPutToken< TrackingRecHitsSoACollection< TrackerTraits > > tokenHit_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
int iEvent
Definition: GenABIO.cc:224
const device::EDGetToken< SiPixelClustersSoACollection > tokenClusters_
SiPixelRecHitAlpaka< pixelTopology::Phase1 > SiPixelRecHitAlpakaPhase1
const device::EDGetToken< SiPixelDigisSoACollection > tokenDigi_
T const & getData(edm::ESGetToken< T, R > const &iToken) const
Definition: EventSetup.h:32
const device::EDGetToken< BeamSpotDevice > tBeamSpot
SiPixelRecHitAlpaka< pixelTopology::Phase2 > SiPixelRecHitAlpakaPhase2
HLT enums.
void produce(edm::StreamID streamID, device::Event &iEvent, const device::EventSetup &iSetup) const override
#define DEFINE_FWK_ALPAKA_MODULE(name)
Definition: MakerMacros.h:16
const device::ESGetToken< PixelCPEFastParams< TrackerTraits >, PixelCPEFastParamsRecord > cpeToken_
const pixelgpudetails::PixelRecHitKernel< TrackerTraits > Algo_
SiPixelRecHitAlpaka(const edm::ParameterSet &iConfig)