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_
 
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > pixelDigiToken_
 

Detailed Description

Definition at line 45 of file SiPixelPhase2DigiToClusterCUDA.cc.

Member Typedef Documentation

◆ GPUAlgo

Definition at line 51 of file SiPixelPhase2DigiToClusterCUDA.cc.

Constructor & Destructor Documentation

◆ SiPixelPhase2DigiToClusterCUDA()

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

Definition at line 74 of file SiPixelPhase2DigiToClusterCUDA.cc.

References edm::ParameterSet::getParameter().

79  includeErrors_(iConfig.getParameter<bool>("IncludeErrors")),
80  clusterThresholds_{iConfig.getParameter<int32_t>("clusterThreshold_layer1"),
81  iConfig.getParameter<int32_t>("clusterThreshold_otherLayers"),
82  static_cast<float>(iConfig.getParameter<double>("ElectronPerADCGain")),
83  static_cast<int8_t>(iConfig.getParameter<int>("Phase2ReadoutMode")),
84  static_cast<uint16_t>(iConfig.getParameter<uint32_t>("Phase2DigiBaseline")),
85  static_cast<uint8_t>(iConfig.getParameter<uint32_t>("Phase2KinkADC"))} {
86  if (includeErrors_) {
87  digiErrorPutToken_ = produces<cms::cuda::Product<SiPixelDigiErrorsCUDA>>();
88  }
89 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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 105 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(), pixelDigiToken_, and multPhiCorr_741_25nsDY_cfi::px.

107  {
108  cms::cuda::ScopedContextAcquire ctx{iEvent.streamID(), std::move(waitingTaskHolder), ctxState_};
109 
110  auto const& input = iEvent.get(pixelDigiToken_);
111 
112  const TrackerGeometry* geom_ = &iSetup.getData(geomToken_);
113 
114  uint32_t nDigis = 0;
115 
116  auto xDigis = cms::cuda::make_host_unique<uint16_t[]>(gpuClustering::maxNumDigis, ctx.stream());
117  auto yDigis = cms::cuda::make_host_unique<uint16_t[]>(gpuClustering::maxNumDigis, ctx.stream());
118  auto adcDigis = cms::cuda::make_host_unique<uint16_t[]>(gpuClustering::maxNumDigis, ctx.stream());
119  auto moduleIds = cms::cuda::make_host_unique<uint16_t[]>(gpuClustering::maxNumDigis, ctx.stream());
120  auto packedData = cms::cuda::make_host_unique<uint32_t[]>(gpuClustering::maxNumDigis, ctx.stream());
121  auto rawIds = cms::cuda::make_host_unique<uint32_t[]>(gpuClustering::maxNumDigis, ctx.stream());
122 
123  for (auto DSViter = input.begin(); DSViter != input.end(); DSViter++) {
124  unsigned int detid = DSViter->detId();
125  DetId detIdObject(detid);
126  const GeomDetUnit* genericDet = geom_->idToDetUnit(detIdObject);
127  auto const gind = genericDet->index();
128  for (auto const& px : *DSViter) {
129  moduleIds[nDigis] = uint16_t(gind);
130 
131  xDigis[nDigis] = uint16_t(px.row());
132  yDigis[nDigis] = uint16_t(px.column());
133  adcDigis[nDigis] = uint16_t(px.adc());
134 
135  packedData[nDigis] = uint32_t(px.packedData());
136 
137  rawIds[nDigis] = uint32_t(detid);
138 
139  nDigis++;
140  }
141  }
142 
144  moduleIds.get(),
145  xDigis.get(),
146  yDigis.get(),
147  adcDigis.get(),
148  packedData.get(),
149  rawIds.get(),
150  nDigis,
151  ctx.stream());
152 }
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 91 of file SiPixelPhase2DigiToClusterCUDA.cc.

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

91  {
93 
94  desc.add<bool>("IncludeErrors", true);
95  desc.add<int32_t>("clusterThreshold_layer1", 4000);
96  desc.add<int32_t>("clusterThreshold_otherLayers", 4000);
97  desc.add<double>("ElectronPerADCGain", 1500.f);
98  desc.add<int32_t>("Phase2ReadoutMode", 3);
99  desc.add<uint32_t>("Phase2DigiBaseline", 1000);
100  desc.add<uint32_t>("Phase2KinkADC", 8);
101  desc.add<edm::InputTag>("InputDigis", edm::InputTag("simSiPixelDigis:Pixel"));
102  descriptions.addWithDefaultLabel(desc);
103 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 154 of file SiPixelPhase2DigiToClusterCUDA.cc.

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

154  {
156 
157  auto tmp = gpuAlgo_.getResults();
158  ctx.emplace(iEvent, digiPutToken_, std::move(tmp.first));
159  ctx.emplace(iEvent, clusterPutToken_, std::move(tmp.second));
160  if (includeErrors_) {
161  ctx.emplace(iEvent, digiErrorPutToken_, gpuAlgo_.getErrors());
162  }
163 }
edm::EDPutTokenT< cms::cuda::Product< SiPixelClustersCUDA > > clusterPutToken_
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 64 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by produce().

◆ clusterThresholds_

const SiPixelClusterThresholds SiPixelPhase2DigiToClusterCUDA::clusterThresholds_
private

Definition at line 71 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire().

◆ ctxState_

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

Definition at line 66 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire(), and produce().

◆ digiErrorPutToken_

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

Definition at line 63 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by produce().

◆ digiPutToken_

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

Definition at line 62 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by produce().

◆ geomToken_

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

Definition at line 59 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire().

◆ gpuAlgo_

GPUAlgo SiPixelPhase2DigiToClusterCUDA::gpuAlgo_
private

Definition at line 68 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire(), and produce().

◆ includeErrors_

const bool SiPixelPhase2DigiToClusterCUDA::includeErrors_
private

Definition at line 70 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by produce().

◆ pixelDigiToken_

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

Definition at line 60 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire().