CMS 3D CMS Logo

SiPixelRecHits_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA
3 from Configuration.ProcessModifiers.gpu_cff import gpu
4 
5 # legacy pixel rechit producer
6 siPixelRecHits = cms.EDProducer("SiPixelRecHitConverter",
7  src = cms.InputTag("siPixelClusters"),
8  CPE = cms.string('PixelCPEGeneric'),
9  VerboseLevel = cms.untracked.int32(0)
10 )
11 
12 # SwitchProducer wrapping the legacy pixel rechit producer
13 siPixelRecHitsPreSplitting = SwitchProducerCUDA(
14  cpu = siPixelRecHits.clone(
15  src = 'siPixelClustersPreSplitting'
16  )
17 )
18 
19 # convert the pixel rechits from legacy to SoA format
20 from RecoLocalTracker.SiPixelRecHits.siPixelRecHitSoAFromLegacy_cfi import siPixelRecHitSoAFromLegacy as siPixelRecHitsPreSplittingSoA
21 
22 siPixelRecHitsPreSplittingTask = cms.Task(
23  # SwitchProducer wrapping the legacy pixel rechit producer
24  siPixelRecHitsPreSplitting,
25  # convert the pixel rechits from legacy to SoA format
26  siPixelRecHitsPreSplittingSoA
27 )
28 
29 # reconstruct the pixel rechits on the gpu
30 from RecoLocalTracker.SiPixelRecHits.siPixelRecHitCUDA_cfi import siPixelRecHitCUDA as _siPixelRecHitCUDA
31 siPixelRecHitsPreSplittingCUDA = _siPixelRecHitCUDA.clone(
32  beamSpot = "offlineBeamSpotToCUDA"
33 )
34 
35 # transfer the pixel rechits to the host and convert them from SoA
36 from RecoLocalTracker.SiPixelRecHits.siPixelRecHitFromCUDA_cfi import siPixelRecHitFromCUDA as _siPixelRecHitFromCUDA
37 gpu.toModify(siPixelRecHitsPreSplitting,
38  cuda = _siPixelRecHitFromCUDA.clone()
39 )
40 
41 gpu.toReplaceWith(siPixelRecHitsPreSplittingTask, cms.Task(
42  # reconstruct the pixel rechits on the gpu
43  siPixelRecHitsPreSplittingCUDA,
44  # SwitchProducer wrapping the legacy pixel rechit producer or the transfer of the pixel rechits to the host and the conversion from SoA
45  siPixelRecHitsPreSplittingTask.copy()
46 ))
SwitchProducerCUDA
Definition: SwitchProducerCUDA.py:1