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<TrackingRecHit2DCUDA>>()) {}
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  auto nHits = clusters.nClusters();
83  edm::LogWarning("PixelRecHitGPUKernel")
84  << "Clusters/Hits Overflow " << nHits << " >= " << TrackingRecHit2DSOAView::maxHits();
85  }
86 
87  ctx.emplace(iEvent,
88  tokenHit_,
89  gpuAlgo_.makeHitsAsync(digis, clusters, bs, fcpe->getGPUProductAsync(ctx.stream()), ctx.stream()));
90 }
91 
ConfigurationDescriptions.h
edm::StreamID
Definition: StreamID.h:30
Handle.h
pixelgpudetails::PixelRecHitGPUKernel::makeHitsAsync
TrackingRecHit2DCUDA makeHitsAsync(SiPixelDigisCUDA const &digis_d, SiPixelClustersCUDA const &clusters_d, BeamSpotCUDA const &bs_d, pixelCPEforGPU::ParamsOnGPU const *cpeParams, cudaStream_t stream) const
TrackerGeometry.h
PixelRecHitGPUKernel.h
ESInputTag
cms::cuda::ScopedContextProduce
Definition: ScopedContext.h:149
SiPixelClustersCUDA
Definition: SiPixelClustersCUDA.h:10
SiPixelRecHitCUDA
Definition: SiPixelRecHitCUDA.cc:26
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::EDPutTokenT
Definition: EDPutToken.h:33
TrackingRecHit2DHeterogeneous.h
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TrackingRecHit2DHeterogeneous
Definition: TrackingRecHit2DHeterogeneous.h:8
SiPixelRecHitCUDA::tokenDigi_
const edm::EDGetTokenT< cms::cuda::Product< SiPixelDigisCUDA > > tokenDigi_
Definition: SiPixelRecHitCUDA.cc:39
PixelCPEBase.h
pixelgpudetails::PixelRecHitGPUKernel
Definition: PixelRecHitGPUKernel.h:15
PixelCPEFast.h
SiPixelRawToDigi_cfi.cuda
cuda
Definition: SiPixelRawToDigi_cfi.py:14
SiPixelClustersCUDA.h
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
BeamSpotCUDA
Definition: BeamSpotCUDA.h:9
MakerMacros.h
cms::cuda::bs
bs
Definition: HistoContainer.h:127
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
nHits
const caConstants::TupleMultiplicity *__restrict__ const HitsOnGPU *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t nHits
Definition: BrokenLineFitOnGPU.h:27
PixelCPEFast
Definition: PixelCPEFast.h:15
TrackingRecHit2DSOAView::maxHits
static constexpr uint32_t maxHits()
Definition: TrackingRecHit2DSOAView.h:17
ParameterSetDescription.h
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiPixelDigisCUDA
Definition: SiPixelDigisCUDA.h:10
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
TrackerDigiGeometryRecord.h
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
SiPixelRecHitCUDA::gpuAlgo_
const pixelgpudetails::PixelRecHitGPUKernel gpuAlgo_
Definition: SiPixelRecHitCUDA.cc:42
BeamSpotCUDA.h
SiPixelRecHitCUDA::SiPixelRecHitCUDA
SiPixelRecHitCUDA(const edm::ParameterSet &iConfig)
Definition: SiPixelRecHitCUDA.cc:45
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:58
SiPixelDigisCUDA.h
SiPixelRecHitCUDA::tokenHit_
const edm::EDPutTokenT< cms::cuda::Product< TrackingRecHit2DCUDA > > tokenHit_
Definition: SiPixelRecHitCUDA.cc:40
edm::ESGetToken< PixelClusterParameterEstimator, TkPixelCPERecord >
InputTag.h
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
Product.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
std
Definition: JetResolutionObject.h:76
SiPixelRecHitCUDA::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: SiPixelRecHitCUDA.cc:52
SiPixelRecHitCUDA::produce
void produce(edm::StreamID streamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
Definition: SiPixelRecHitCUDA.cc:61
Exception
Definition: hltDiff.cc:245
ScopedContext.h
SiPixelRecHitCUDA::token_
const edm::EDGetTokenT< cms::cuda::Product< SiPixelClustersCUDA > > token_
Definition: SiPixelRecHitCUDA.cc:38
EventSetup.h
TkPixelCPERecord.h
SiPixelRecHitCUDA::~SiPixelRecHitCUDA
~SiPixelRecHitCUDA() override=default
SiPixelRecHitCUDA::cpeToken_
const edm::ESGetToken< PixelClusterParameterEstimator, TkPixelCPERecord > cpeToken_
Definition: SiPixelRecHitCUDA.cc:36
ParameterSet.h
EDProducer.h
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
SiPixelRecHitCUDA::tBeamSpot
const edm::EDGetTokenT< cms::cuda::Product< BeamSpotCUDA > > tBeamSpot
Definition: SiPixelRecHitCUDA.cc:37
cms
Namespace of DDCMS conversion namespace.
Definition: ProducerAnalyzer.cc:21