CMS 3D CMS Logo

SiPixelRecHitCUDA.cc
Go to the documentation of this file.
1 #include <cuda_runtime.h>
2 
23 
24 #include "PixelRecHitGPUKernel.h"
25 
27 public:
28  explicit SiPixelRecHitCUDA(const edm::ParameterSet& iConfig);
29  ~SiPixelRecHitCUDA() override = default;
30 
31  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
32 
33 private:
34  void produce(edm::StreamID streamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const override;
35 
41 
43 };
44 
46  : cpeToken_(esConsumes(edm::ESInputTag("", iConfig.getParameter<std::string>("CPE")))),
47  tBeamSpot(consumes<cms::cuda::Product<BeamSpotCUDA>>(iConfig.getParameter<edm::InputTag>("beamSpot"))),
48  token_(consumes<cms::cuda::Product<SiPixelClustersCUDA>>(iConfig.getParameter<edm::InputTag>("src"))),
49  tokenDigi_(consumes<cms::cuda::Product<SiPixelDigisCUDA>>(iConfig.getParameter<edm::InputTag>("src"))),
50  tokenHit_(produces<cms::cuda::Product<TrackingRecHit2DGPU>>()) {}
51 
54 
55  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpotCUDA"));
56  desc.add<edm::InputTag>("src", edm::InputTag("siPixelClustersPreSplittingCUDA"));
57  desc.add<std::string>("CPE", "PixelCPEFast");
58  descriptions.add("siPixelRecHitCUDA", desc);
59 }
60 
62  PixelCPEFast const* fcpe = dynamic_cast<const PixelCPEFast*>(&es.getData(cpeToken_));
63  if (not fcpe) {
64  throw cms::Exception("Configuration") << "SiPixelRecHitSoAFromLegacy can only use a CPE of type PixelCPEFast";
65  }
66 
68  iEvent.getByToken(token_, hclusters);
69 
70  cms::cuda::ScopedContextProduce ctx{*hclusters};
71  auto const& clusters = ctx.get(*hclusters);
72 
74  iEvent.getByToken(tokenDigi_, hdigis);
75  auto const& digis = ctx.get(*hdigis);
76 
78  iEvent.getByToken(tBeamSpot, hbs);
79  auto const& bs = ctx.get(*hbs);
80 
81  ctx.emplace(iEvent,
82  tokenHit_,
84  digis, clusters, bs, fcpe->getGPUProductAsync(ctx.stream()), fcpe->isPhase2(), ctx.stream()));
85 }
86 
const edm::EDGetTokenT< cms::cuda::Product< BeamSpotCUDA > > tBeamSpot
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const edm::EDGetTokenT< cms::cuda::Product< SiPixelDigisCUDA > > tokenDigi_
const edm::EDPutTokenT< cms::cuda::Product< TrackingRecHit2DGPU > > tokenHit_
int iEvent
Definition: GenABIO.cc:224
TrackingRecHit2DGPU makeHitsAsync(SiPixelDigisCUDA const &digis_d, SiPixelClustersCUDA const &clusters_d, BeamSpotCUDA const &bs_d, pixelCPEforGPU::ParamsOnGPU const *cpeParams, bool isPhase2, cudaStream_t stream) const
const pixelgpudetails::PixelRecHitGPUKernel gpuAlgo_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
bool getData(T &iHolder) const
Definition: EventSetup.h:122
Namespace of DDCMS conversion namespace.
SiPixelRecHitCUDA(const edm::ParameterSet &iConfig)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< cms::cuda::Product< SiPixelClustersCUDA > > token_
HLT enums.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void produce(edm::StreamID streamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
~SiPixelRecHitCUDA() override=default
const edm::ESGetToken< PixelClusterParameterEstimator, TkPixelCPERecord > cpeToken_