CMS 3D CMS Logo

SiStripClusterizerOnDemand_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA
3 
4 # from RecoLocalTracker.SiStripClusterizer.SiStripClusterizer_RealData_cfi import *
5 
8 
9 from RecoLocalTracker.SiStripClusterizer.siStripClusterizerFromRawGPU_cfi import siStripClusterizerFromRawGPU
10 from RecoLocalTracker.SiStripClusterizer.siStripClustersSOAtoHost_cfi import siStripClustersSOAtoHost
11 from RecoLocalTracker.SiStripClusterizer.siStripClustersFromSOA_cfi import siStripClustersFromSOA
12 from RecoLocalTracker.SiStripClusterizer.SiStripClusterizerConditionsGPUESProducer_cfi import SiStripClusterizerConditionsGPUESProducer
13 
14 _siStripClusterizerFromRaw = cms.EDProducer("SiStripClusterizerFromRaw",
15  onDemand = cms.bool(True),
16  Clusterizer = DefaultClusterizer,
17  Algorithms = DefaultAlgorithms,
18  DoAPVEmulatorCheck = cms.bool(False),
19  HybridZeroSuppressed = cms.bool(False),
20  ProductLabel = cms.InputTag('rawDataCollector'))
21 
22 _siStripClusterizerFromRaw.Clusterizer.MaxClusterSize = cms.uint32(16)
23 
24 siStripClusterizerFromRawGPU.Clusterizer = DefaultClusterizer
25 
26 siStripClusters = SwitchProducerCUDA(
27  cpu = _siStripClusterizerFromRaw.clone(),
28 )
29 
30 siStripClustersTask = cms.Task(
31  siStripClusters,
32 )
33 
35 
36 gpu.toModify(siStripClusters,
37  cuda = siStripClustersFromSOA,
38 )
39 
40 siStripClustersTaskCUDA = cms.Task()
41 
42 gpu.toReplaceWith(siStripClustersTaskCUDA, cms.Task(
43  # conditions used *only* by the modules running on GPU
44  SiStripClusterizerConditionsGPUESProducer,
45  # reconstruct the strip clusters on the gpu
46  siStripClusterizerFromRawGPU,
47  # copy clusters from GPU to pinned host memory
48  siStripClustersSOAtoHost,
49 ))
50 
51 gpu.toReplaceWith(siStripClustersTask, cms.Task(
52  # CUDA specific
53  siStripClustersTaskCUDA,
54  # switch producer to legacy format
55  siStripClusters,
56 ))