CMS 3D CMS Logo

List of all members | 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 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_
 
pixelgpudetails::SiPixelRawToClusterGPUKernel gpuAlgo_
 
const bool includeErrors_
 
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > pixelDigiToken_
 
std::unique_ptr< pixelgpudetails::SiPixelRawToClusterGPUKernel::WordFedAppenderwordFedAppender_
 

Additional Inherited Members

- 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
 

Detailed Description

Definition at line 44 of file SiPixelPhase2DigiToClusterCUDA.cc.

Constructor & Destructor Documentation

◆ SiPixelPhase2DigiToClusterCUDA()

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

Definition at line 73 of file SiPixelPhase2DigiToClusterCUDA.cc.

References edm::ParameterSet::getParameter().

78  includeErrors_(iConfig.getParameter<bool>("IncludeErrors")),
79  clusterThresholds_{iConfig.getParameter<int32_t>("clusterThreshold_layer1"),
80  iConfig.getParameter<int32_t>("clusterThreshold_otherLayers")} {
81  if (includeErrors_) {
82  digiErrorPutToken_ = produces<cms::cuda::Product<SiPixelDigiErrorsCUDA>>();
83  }
84 }
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 96 of file SiPixelPhase2DigiToClusterCUDA.cc.

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

98  {
99  cms::cuda::ScopedContextAcquire ctx{iEvent.streamID(), std::move(waitingTaskHolder), ctxState_};
100 
101  auto const& input = iEvent.get(pixelDigiToken_);
102 
103  const TrackerGeometry* geom_ = &iSetup.getData(geomToken_);
104 
105  uint32_t nDigis = 0;
106 
107  auto xDigis = cms::cuda::make_host_unique<uint16_t[]>(gpuClustering::maxNumDigis, ctx.stream());
108  auto yDigis = cms::cuda::make_host_unique<uint16_t[]>(gpuClustering::maxNumDigis, ctx.stream());
109  auto adcDigis = cms::cuda::make_host_unique<uint16_t[]>(gpuClustering::maxNumDigis, ctx.stream());
110  auto moduleIds = cms::cuda::make_host_unique<uint16_t[]>(gpuClustering::maxNumDigis, ctx.stream());
111  auto packedData = cms::cuda::make_host_unique<uint32_t[]>(gpuClustering::maxNumDigis, ctx.stream());
112  auto rawIds = cms::cuda::make_host_unique<uint32_t[]>(gpuClustering::maxNumDigis, ctx.stream());
113 
114  for (auto DSViter = input.begin(); DSViter != input.end(); DSViter++) {
115  unsigned int detid = DSViter->detId();
116  DetId detIdObject(detid);
117  const GeomDetUnit* genericDet = geom_->idToDetUnit(detIdObject);
118  auto const gind = genericDet->index();
119  for (auto const& px : *DSViter) {
120  moduleIds[nDigis] = uint16_t(gind);
121 
122  xDigis[nDigis] = uint16_t(px.row());
123  yDigis[nDigis] = uint16_t(px.column());
124  adcDigis[nDigis] = uint16_t(px.adc());
125 
126  packedData[nDigis] = uint32_t(px.packedData());
127 
128  rawIds[nDigis] = uint32_t(detid);
129 
130  nDigis++;
131  }
132  }
133 
135  moduleIds.get(),
136  xDigis.get(),
137  yDigis.get(),
138  adcDigis.get(),
139  packedData.get(),
140  rawIds.get(),
141  nDigis,
142  ctx.stream());
143 }
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
int iEvent
Definition: GenABIO.cc:224
const SiPixelClusterThresholds clusterThresholds_
pixelgpudetails::SiPixelRawToClusterGPUKernel gpuAlgo_
Definition: DetId.h:17
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)
def move(src, dest)
Definition: eostools.py:511
constexpr uint32_t maxNumDigis

◆ fillDescriptions()

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

Definition at line 86 of file SiPixelPhase2DigiToClusterCUDA.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, kSiPixelClusterThresholdsDefaultPhase2, SiPixelClusterThresholds::layer1, and SiPixelClusterThresholds::otherLayers.

86  {
88 
89  desc.add<bool>("IncludeErrors", true);
90  desc.add<int32_t>("clusterThreshold_layer1", kSiPixelClusterThresholdsDefaultPhase2.layer1);
91  desc.add<int32_t>("clusterThreshold_otherLayers", kSiPixelClusterThresholdsDefaultPhase2.otherLayers);
92  desc.add<edm::InputTag>("InputDigis", edm::InputTag("simSiPixelDigis:Pixel"));
93  descriptions.addWithDefaultLabel(desc);
94 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
constexpr SiPixelClusterThresholds kSiPixelClusterThresholdsDefaultPhase2

◆ produce()

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

Definition at line 145 of file SiPixelPhase2DigiToClusterCUDA.cc.

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

145  {
147 
148  auto tmp = gpuAlgo_.getResults();
149  ctx.emplace(iEvent, digiPutToken_, std::move(tmp.first));
150  ctx.emplace(iEvent, clusterPutToken_, std::move(tmp.second));
151  if (includeErrors_) {
152  ctx.emplace(iEvent, digiErrorPutToken_, gpuAlgo_.getErrors());
153  }
154 }
edm::EDPutTokenT< cms::cuda::Product< SiPixelClustersCUDA > > clusterPutToken_
std::pair< SiPixelDigisCUDA, SiPixelClustersCUDA > getResults()
edm::EDPutTokenT< cms::cuda::Product< SiPixelDigiErrorsCUDA > > digiErrorPutToken_
int iEvent
Definition: GenABIO.cc:224
pixelgpudetails::SiPixelRawToClusterGPUKernel gpuAlgo_
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 62 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by produce().

◆ clusterThresholds_

const SiPixelClusterThresholds SiPixelPhase2DigiToClusterCUDA::clusterThresholds_
private

Definition at line 70 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire().

◆ ctxState_

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

Definition at line 64 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire(), and produce().

◆ digiErrorPutToken_

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

Definition at line 61 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by produce().

◆ digiPutToken_

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

Definition at line 60 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by produce().

◆ geomToken_

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

Definition at line 57 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire().

◆ gpuAlgo_

pixelgpudetails::SiPixelRawToClusterGPUKernel SiPixelPhase2DigiToClusterCUDA::gpuAlgo_
private

Definition at line 66 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire(), and produce().

◆ includeErrors_

const bool SiPixelPhase2DigiToClusterCUDA::includeErrors_
private

Definition at line 69 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by produce().

◆ pixelDigiToken_

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

Definition at line 58 of file SiPixelPhase2DigiToClusterCUDA.cc.

Referenced by acquire().

◆ wordFedAppender_

std::unique_ptr<pixelgpudetails::SiPixelRawToClusterGPUKernel::WordFedAppender> SiPixelPhase2DigiToClusterCUDA::wordFedAppender_
private

Definition at line 67 of file SiPixelPhase2DigiToClusterCUDA.cc.