CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 from Configuration.Eras.Modifier_phase2_brickedPixels_cff import phase2_brickedPixels
13 phase2_brickedPixels.toModify(siPixelRecHits,
14  CPE = 'PixelCPEGenericForBricked'
15 )
16 
17 # SwitchProducer wrapping the legacy pixel rechit producer
18 siPixelRecHitsPreSplitting = SwitchProducerCUDA(
19  cpu = siPixelRecHits.clone(
20  src = 'siPixelClustersPreSplitting'
21  )
22 )
23 
24 # convert the pixel rechits from legacy to SoA format
25 from RecoLocalTracker.SiPixelRecHits.siPixelRecHitSoAFromLegacy_cfi import siPixelRecHitSoAFromLegacy as siPixelRecHitsPreSplittingSoA
26 
27 siPixelRecHitsPreSplittingTask = cms.Task(
28  # SwitchProducer wrapping the legacy pixel rechit producer
29  siPixelRecHitsPreSplitting,
30  # convert the pixel rechits from legacy to SoA format
31  siPixelRecHitsPreSplittingSoA
32 )
33 
34 # reconstruct the pixel rechits on the gpu
35 from RecoLocalTracker.SiPixelRecHits.siPixelRecHitCUDA_cfi import siPixelRecHitCUDA as _siPixelRecHitCUDA
36 siPixelRecHitsPreSplittingCUDA = _siPixelRecHitCUDA.clone(
37  beamSpot = "offlineBeamSpotToCUDA"
38 )
39 
40 # transfer the pixel rechits to the host and convert them from SoA
41 from RecoLocalTracker.SiPixelRecHits.siPixelRecHitFromCUDA_cfi import siPixelRecHitFromCUDA as _siPixelRecHitFromCUDA
42 gpu.toModify(siPixelRecHitsPreSplitting,
43  cuda = _siPixelRecHitFromCUDA.clone()
44 )
45 
46 gpu.toReplaceWith(siPixelRecHitsPreSplittingTask, cms.Task(
47  # reconstruct the pixel rechits on the gpu
48  siPixelRecHitsPreSplittingCUDA,
49  # SwitchProducer wrapping the legacy pixel rechit producer or the transfer of the pixel rechits to the host and the conversion from SoA
50  siPixelRecHitsPreSplittingTask.copy()
51 ))
52