CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
SiPixelPhase2DigiToClusterCUDA Class Reference
Inheritance diagram for SiPixelPhase2DigiToClusterCUDA:
edm::stream::EDProducer< edm::ExternalWork >

Public Types

using GPUAlgo = pixelgpudetails::SiPixelRawToClusterGPUKernel< pixelTopology::Phase2 >
 
- Public Types inherited from edm::stream::EDProducer< edm::ExternalWork >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

 SiPixelPhase2DigiToClusterCUDA (const edm::ParameterSet &iConfig)
 
 ~SiPixelPhase2DigiToClusterCUDA () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::ExternalWork >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void acquire (const edm::Event &iEvent, const edm::EventSetup &iSetup, edm::WaitingTaskWithArenaHolder waitingTaskHolder) override
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 

Private Attributes

edm::EDPutTokenT< cms::cuda::Product< SiPixelClustersCUDA > > clusterPutToken_
 
const SiPixelClusterThresholds clusterThresholds_
 
cms::cuda::ContextState ctxState_
 
edm::EDPutTokenT< cms::cuda::Product< SiPixelDigiErrorsCUDA > > digiErrorPutToken_
 
edm::EDPutTokenT< cms::cuda::Product< SiPixelDigisCUDA > > digiPutToken_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeomToken_
 
GPUAlgo gpuAlgo_
 
const bool includeErrors_
 
uint32_t nDigis_
 
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > pixelDigiToken_
 

Detailed Description

Definition at line 28 of file SiPixelPhase2DigiToClusterCUDA.cc.

Member Typedef Documentation

◆ GPUAlgo

Definition at line 34 of file SiPixelPhase2DigiToClusterCUDA.cc.

Constructor & Destructor Documentation

◆ SiPixelPhase2DigiToClusterCUDA()

SiPixelPhase2DigiToClusterCUDA::SiPixelPhase2DigiToClusterCUDA ( const edm::ParameterSet iConfig)
explicit

Definition at line 58 of file SiPixelPhase2DigiToClusterCUDA.cc.

References edm::ParameterSet::getParameter().

63  includeErrors_(iConfig.getParameter<bool>("IncludeErrors")),
64  clusterThresholds_{iConfig.getParameter<int32_t>("clusterThreshold_layer1"),
65  iConfig.getParameter<int32_t>("clusterThreshold_otherLayers"),
66  static_cast<float>(iConfig.getParameter<double>("ElectronPerADCGain")),
67  static_cast<int8_t>(iConfig.getParameter<int>("Phase2ReadoutMode")),
68  static_cast<uint16_t>(iConfig.getParameter<uint32_t>("Phase2DigiBaseline")),
69  static_cast<uint8_t>(iConfig.getParameter<uint32_t>("Phase2KinkADC"))} {
70  if (includeErrors_) {
71  digiErrorPutToken_ = produces<cms::cuda::Product<SiPixelDigiErrorsCUDA>>();
72  }
73 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDPutTokenT< cms::cuda::Product< SiPixelClustersCUDA > > clusterPutToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > pixelDigiToken_
edm::EDPutTokenT< cms::cuda::Product< SiPixelDigiErrorsCUDA > > digiErrorPutToken_
const SiPixelClusterThresholds clusterThresholds_
edm::EDPutTokenT< cms::cuda::Product< SiPixelDigisCUDA > > digiPutToken_

◆ ~SiPixelPhase2DigiToClusterCUDA()

SiPixelPhase2DigiToClusterCUDA::~SiPixelPhase2DigiToClusterCUDA ( )
overridedefault

Member Function Documentation

◆ acquire()

void SiPixelPhase2DigiToClusterCUDA::acquire ( const edm::Event iEvent,
const edm::EventSetup iSetup,
edm::WaitingTaskWithArenaHolder  waitingTaskHolder 
)
overrideprivate

Definition at line 89 of file SiPixelPhase2DigiToClusterCUDA.cc.

References clusterThresholds_, ctxState_, geomToken_, edm::EventSetup::getData(), gpuAlgo_, TrackerGeometry::idToDetUnit(), iEvent, GeomDet::index(), input, pixelgpudetails::SiPixelRawToClusterGPUKernel< TrackerTraits >::makePhase2ClustersAsync(), gpuClustering::maxNumDigis, eostools::move(), nDigis_, pixelDigiToken_, and multPhiCorr_741_25nsDY_cfi::px.

91  {
92  cms::cuda::ScopedContextAcquire ctx{iEvent.streamID(), std::move(waitingTaskHolder), ctxState_};
93 
94  auto const& input = iEvent.get(pixelDigiToken_);
95 
96  const TrackerGeometry* geom_ = &iSetup.getData(geomToken_);
97 
98  nDigis_ = 0;
99 
100  auto xDigis = cms::cuda::make_host_unique<uint16_t[]>(gpuClustering::maxNumDigis, ctx.stream());
101  auto yDigis = cms::cuda::make_host_unique<uint16_t[]>(gpuClustering::maxNumDigis, ctx.stream());
102  auto adcDigis = cms::cuda::make_host_unique<uint16_t[]>(gpuClustering::maxNumDigis, ctx.stream());
103  auto moduleIds = cms::cuda::make_host_unique<uint16_t[]>(gpuClustering::maxNumDigis, ctx.stream());
104  auto packedData = cms::cuda::make_host_unique<uint32_t[]>(gpuClustering::maxNumDigis, ctx.stream());
105  auto rawIds = cms::cuda::make_host_unique<uint32_t[]>(gpuClustering::maxNumDigis, ctx.stream());
106 
107  for (auto DSViter = input.begin(); DSViter != input.end(); DSViter++) {
108  unsigned int detid = DSViter->detId();
109  DetId detIdObject(detid);
110  const GeomDetUnit* genericDet = geom_->idToDetUnit(detIdObject);
111  auto const gind = genericDet->index();
112  for (auto const& px : *DSViter) {
113  moduleIds[nDigis_] = uint16_t(gind);
114 
115  xDigis[nDigis_] = uint16_t(px.row());
116  yDigis[nDigis_] = uint16_t(px.column());
117  adcDigis[nDigis_] = uint16_t(px.adc());
118 
119  packedData[nDigis_] = uint32_t(px.packedData());
120 
121  rawIds[nDigis_] = uint32_t(detid);
122 
123  nDigis_++;
124  }
125  }
126 
127  if (nDigis_ == 0)
128  return;
129 
131  moduleIds.get(),
132  xDigis.get(),
133  yDigis.get(),
134  adcDigis.get(),
135  packedData.get(),
136  rawIds.get(),
137  nDigis_,
138  ctx.stream());
139 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > pixelDigiToken_
int index() const
Definition: GeomDet.h:83
static std::string const input
Definition: EdmProvDump.cc:50
void makePhase2ClustersAsync(const SiPixelClusterThresholds clusterThresholds, const uint16_t *moduleIds, const uint16_t *xDigis, const uint16_t *yDigis, const uint16_t *adcDigis, const uint32_t *packedData, const uint32_t *rawIds, const uint32_t numDigis, cudaStream_t stream)
int iEvent
Definition: GenABIO.cc:224
const SiPixelClusterThresholds clusterThresholds_
Definition: DetId.h:17
def move(src, dest)
Definition: eostools.py:511
constexpr uint32_t maxNumDigis

◆ fillDescriptions()

void SiPixelPhase2DigiToClusterCUDA::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 75 of file SiPixelPhase2DigiToClusterCUDA.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

75  {
77 
78  desc.add<bool>("IncludeErrors", true);
79  desc.add<int32_t>("clusterThreshold_layer1", 4000);
80  desc.add<int32_t>("clusterThreshold_otherLayers", 4000);
81  desc.add<double>("ElectronPerADCGain", 1500);
82  desc.add<int32_t>("Phase2ReadoutMode", 3);
83  desc.add<uint32_t>("Phase2DigiBaseline", 1000);
84  desc.add<uint32_t>("Phase2KinkADC", 8);
85  desc.add<edm::InputTag>("InputDigis", edm::InputTag("simSiPixelDigis:Pixel"));
86  descriptions.addWithDefaultLabel(desc);
87 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

void SiPixelPhase2DigiToClusterCUDA::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 141 of file SiPixelPhase2DigiToClusterCUDA.cc.

References clusterPutToken_, ctxState_, digiErrorPutToken_, digiPutToken_, pixelgpudetails::SiPixelRawToClusterGPUKernel< TrackerTraits >::getErrors(), pixelgpudetails::SiPixelRawToClusterGPUKernel< TrackerTraits >::getResults(), gpuAlgo_, iEvent, includeErrors_, eostools::move(), nDigis_, pixelTopology::Phase2::numberOfModules, and createJobs::tmp.

141  {
143 
144  if (nDigis_ == 0) {
145  ctx.emplace(iEvent, digiPutToken_, nDigis_, ctx.stream());
147  if (includeErrors_) {
149  }
150  return;
151  }
152 
153  auto tmp = gpuAlgo_.getResults();
154  ctx.emplace(iEvent, digiPutToken_, std::move(tmp.first));
155  ctx.emplace(iEvent, clusterPutToken_, std::move(tmp.second));
156  if (includeErrors_) {
157  ctx.emplace(iEvent, digiErrorPutToken_, gpuAlgo_.getErrors());
158  }
159 }
edm::EDPutTokenT< cms::cuda::Product< SiPixelClustersCUDA > > clusterPutToken_
static constexpr uint16_t numberOfModules
edm::EDPutTokenT< cms::cuda::Product< SiPixelDigiErrorsCUDA > > digiErrorPutToken_
int iEvent
Definition: GenABIO.cc:224
std::pair< SiPixelDigisCUDA, SiPixelClustersCUDA > getResults()
edm::EDPutTokenT< cms::cuda::Product< SiPixelDigisCUDA > > digiPutToken_
tmp
align.sh
Definition: createJobs.py:716
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ clusterPutToken_

edm::EDPutTokenT<cms::cuda::Product<SiPixelClustersCUDA> > SiPixelPhase2DigiToClusterCUDA::clusterPutToken_
private

Definition at line 47 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by produce().

◆ clusterThresholds_

const SiPixelClusterThresholds SiPixelPhase2DigiToClusterCUDA::clusterThresholds_
private

Definition at line 54 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire().

◆ ctxState_

cms::cuda::ContextState SiPixelPhase2DigiToClusterCUDA::ctxState_
private

Definition at line 49 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire(), and produce().

◆ digiErrorPutToken_

edm::EDPutTokenT<cms::cuda::Product<SiPixelDigiErrorsCUDA> > SiPixelPhase2DigiToClusterCUDA::digiErrorPutToken_
private

Definition at line 46 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by produce().

◆ digiPutToken_

edm::EDPutTokenT<cms::cuda::Product<SiPixelDigisCUDA> > SiPixelPhase2DigiToClusterCUDA::digiPutToken_
private

Definition at line 45 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by produce().

◆ geomToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SiPixelPhase2DigiToClusterCUDA::geomToken_
private

Definition at line 42 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire().

◆ gpuAlgo_

GPUAlgo SiPixelPhase2DigiToClusterCUDA::gpuAlgo_
private

Definition at line 51 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire(), and produce().

◆ includeErrors_

const bool SiPixelPhase2DigiToClusterCUDA::includeErrors_
private

Definition at line 53 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by produce().

◆ nDigis_

uint32_t SiPixelPhase2DigiToClusterCUDA::nDigis_
private

Definition at line 55 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire(), and produce().

◆ pixelDigiToken_

const edm::EDGetTokenT<edm::DetSetVector<PixelDigi> > SiPixelPhase2DigiToClusterCUDA::pixelDigiToken_
private

Definition at line 43 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire().