CMS 3D CMS Logo

siPixelClustersPreSplitting_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
3 from Configuration.Eras.Modifier_run3_common_cff import run3_common
6 
7 # conditions used *only* by the modules running on GPU
8 from CalibTracker.SiPixelESProducers.siPixelROCsStatusAndMappingWrapperESProducer_cfi import siPixelROCsStatusAndMappingWrapperESProducer
9 from CalibTracker.SiPixelESProducers.siPixelGainCalibrationForHLTGPU_cfi import siPixelGainCalibrationForHLTGPU
10 
11 # SwitchProducer wrapping the legacy pixel cluster producer or an alias for the pixel clusters information converted from SoA
13 
14 siPixelClustersPreSplittingTask = cms.Task(
15  # SwitchProducer wrapping the legacy pixel cluster producer or an alias for the pixel clusters information converted from SoA
16  siPixelClustersPreSplitting
17 )
18 
19 # reconstruct the pixel digis and clusters on the gpu
20 from RecoLocalTracker.SiPixelClusterizer.siPixelRawToClusterCUDAPhase1_cfi import siPixelRawToClusterCUDAPhase1 as _siPixelRawToClusterCUDA
21 from RecoLocalTracker.SiPixelClusterizer.siPixelRawToClusterCUDAHIonPhase1_cfi import siPixelRawToClusterCUDAHIonPhase1 as _siPixelRawToClusterCUDAHIonPhase1
22 
23 siPixelClustersPreSplittingCUDA = _siPixelRawToClusterCUDA.clone()
24 
25 # HIon Modifiers
26 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
27 # Phase 2 Tracker Modifier
28 from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
29 
30 (pp_on_AA & ~phase2_tracker).toReplaceWith(siPixelClustersPreSplittingCUDA, _siPixelRawToClusterCUDAHIonPhase1.clone())
31 
32 run3_common.toModify(siPixelClustersPreSplittingCUDA,
33  # use the pixel channel calibrations scheme for Run 3
34  clusterThreshold_layer1 = 4000,
35  VCaltoElectronGain = 1, # all gains=1, pedestals=0
36  VCaltoElectronGain_L1 = 1,
37  VCaltoElectronOffset = 0,
38  VCaltoElectronOffset_L1 = 0)
39 
40 from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAPhase1_cfi import siPixelDigisClustersFromSoAPhase1 as _siPixelDigisClustersFromSoAPhase1
41 from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAPhase2_cfi import siPixelDigisClustersFromSoAPhase2 as _siPixelDigisClustersFromSoAPhase2
42 
43 siPixelDigisClustersPreSplitting = _siPixelDigisClustersFromSoAPhase1.clone()
44 
45 from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAHIonPhase1_cfi import siPixelDigisClustersFromSoAHIonPhase1 as _siPixelDigisClustersFromSoAHIonPhase1
46 (pp_on_AA & ~phase2_tracker).toReplaceWith(siPixelDigisClustersPreSplitting, _siPixelDigisClustersFromSoAHIonPhase1.clone())
47 
48 
49 run3_common.toModify(siPixelDigisClustersPreSplitting,
50  clusterThreshold_layer1 = 4000)
51 
52 gpu.toReplaceWith(siPixelClustersPreSplittingTask, cms.Task(
53  # conditions used *only* by the modules running on GPU
54  siPixelROCsStatusAndMappingWrapperESProducer,
55  siPixelGainCalibrationForHLTGPU,
56  # reconstruct the pixel digis and clusters on the gpu
57  siPixelClustersPreSplittingCUDA,
58  # convert the pixel digis (except errors) and clusters to the legacy format
59  siPixelDigisClustersPreSplitting,
60  # SwitchProducer wrapping the legacy pixel cluster producer or an alias for the pixel clusters information converted from SoA
61  siPixelClustersPreSplittingTask.copy()
62 ))
63 
64 from RecoLocalTracker.SiPixelClusterizer.siPixelPhase2DigiToClusterCUDA_cfi import siPixelPhase2DigiToClusterCUDA as _siPixelPhase2DigiToClusterCUDA
65 # for phase2 no pixel raw2digi is available at the moment
66 # so we skip the raw2digi step and run on pixel digis copied to gpu
67 
68 from SimTracker.SiPhase2Digitizer.phase2TrackerDigitizer_cfi import PixelDigitizerAlgorithmCommon
69 
70 phase2_tracker.toReplaceWith(siPixelClustersPreSplittingCUDA,_siPixelPhase2DigiToClusterCUDA.clone(
71  Phase2ReadoutMode = PixelDigitizerAlgorithmCommon.Phase2ReadoutMode.value(), # Flag to decide Readout Mode : linear TDR (-1), dual slope with slope parameters (+1,+2,+3,+4 ...) with threshold subtraction
72  Phase2DigiBaseline = int(PixelDigitizerAlgorithmCommon.ThresholdInElectrons_Barrel.value()), #Same for barrel and endcap
73  Phase2KinkADC = 8,
74  ElectronPerADCGain = PixelDigitizerAlgorithmCommon.ElectronPerAdc.value()
75 ))
76 
77 from EventFilter.SiPixelRawToDigi.siPixelDigisSoAFromCUDA_cfi import siPixelDigisSoAFromCUDA as _siPixelDigisSoAFromCUDA
78 siPixelDigisPhase2SoA = _siPixelDigisSoAFromCUDA.clone(
79  src = "siPixelClustersPreSplittingCUDA"
80 )
81 
82 phase2_tracker.toReplaceWith(siPixelDigisClustersPreSplitting, _siPixelDigisClustersFromSoAPhase2.clone(
83  clusterThreshold_layer1 = 4000,
84  clusterThreshold_otherLayers = 4000,
85  src = "siPixelDigisPhase2SoA",
86  #produceDigis = False
87  ))
88 
89 (gpu & phase2_tracker).toReplaceWith(siPixelClustersPreSplittingTask, cms.Task(
90  # reconstruct the pixel clusters on the gpu from copied digis
91  siPixelClustersPreSplittingCUDA,
92  # copy from gpu to cpu
93  siPixelDigisPhase2SoA,
94  # convert the pixel digis (except errors) and clusters to the legacy format
95  siPixelDigisClustersPreSplitting,
96  # SwitchProducer wrapping the legacy pixel cluster producer or an alias for the pixel clusters information converted from SoA
97  siPixelClustersPreSplitting))
98 
99 
100 
101 
102 
103 #from CalibTracker.SiPixelESProducers.siPixelCablingSoAESProducer_cfi import siPixelCablingSoAESProducer
104 #from CalibTracker.SiPixelESProducers.siPixelGainCalibrationForHLTSoAESProducer_cfi import siPixelGainCalibrationForHLTSoAESProducer
105 
107  process.load("CalibTracker.SiPixelESProducers.siPixelCablingSoAESProducer_cfi")
108  process.load("CalibTracker.SiPixelESProducers.siPixelGainCalibrationForHLTSoAESProducer_cfi")
109 
110 modifyConfigurationCalibTrackerAlpakaES_ = alpaka.makeProcessModifier(_addProcessCalibTrackerAlpakaES)
111 
112 # reconstruct the pixel digis and clusters with alpaka on the device
113 from RecoLocalTracker.SiPixelClusterizer.siPixelRawToClusterPhase1_cfi import siPixelRawToClusterPhase1 as _siPixelRawToClusterAlpaka
114 from RecoLocalTracker.SiPixelClusterizer.siPixelRawToClusterHIonPhase1_cfi import siPixelRawToClusterHIonPhase1 as _siPixelRawToClusterAlpakaHIonPhase1
115 
116 siPixelClustersPreSplittingAlpaka = _siPixelRawToClusterAlpaka.clone()
117 
118 (alpaka & pp_on_AA & ~phase2_tracker).toReplaceWith(siPixelClustersPreSplittingAlpaka,_siPixelRawToClusterAlpakaHIonPhase1.clone())
119 
120 (alpaka & run3_common).toModify(siPixelClustersPreSplittingAlpaka,
121  # use the pixel channel calibrations scheme for Run 3
122  clusterThreshold_layer1 = 4000,
123  VCaltoElectronGain = 1, # all gains=1, pedestals=0
124  VCaltoElectronGain_L1 = 1,
125  VCaltoElectronOffset = 0,
126  VCaltoElectronOffset_L1 = 0)
127 
128 from RecoLocalTracker.SiPixelClusterizer.siPixelPhase2DigiToCluster_cfi import siPixelPhase2DigiToCluster as _siPixelPhase2DigiToCluster
129 
130 (alpaka & phase2_tracker).toReplaceWith(siPixelClustersPreSplittingAlpaka, _siPixelPhase2DigiToCluster.clone(
131  Phase2ReadoutMode = PixelDigitizerAlgorithmCommon.Phase2ReadoutMode.value(), # flag to decide Readout Mode : linear TDR (-1), dual slope with slope parameters (+1,+2,+3,+4 ...) with threshold subtraction
132  Phase2DigiBaseline = int(PixelDigitizerAlgorithmCommon.ThresholdInElectrons_Barrel.value()), # same for barrel and endcap
133  Phase2KinkADC = 8,
134  ElectronPerADCGain = PixelDigitizerAlgorithmCommon.ElectronPerAdc.value()
135 ))
136 
137 # reconstruct the pixel digis and clusters with alpaka on the cpu, for validation
138 siPixelClustersPreSplittingAlpakaSerial = makeSerialClone(siPixelClustersPreSplittingAlpaka)
139 
140 from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAAlpakaPhase1_cfi import siPixelDigisClustersFromSoAAlpakaPhase1 as _siPixelDigisClustersFromSoAAlpakaPhase1
141 from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAAlpakaPhase2_cfi import siPixelDigisClustersFromSoAAlpakaPhase2 as _siPixelDigisClustersFromSoAAlpakaPhase2
142 from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAAlpakaHIonPhase1_cfi import siPixelDigisClustersFromSoAAlpakaHIonPhase1 as _siPixelDigisClustersFromSoAAlpakaHIonPhase1
143 
144 (alpaka & ~phase2_tracker).toReplaceWith(siPixelDigisClustersPreSplitting,_siPixelDigisClustersFromSoAAlpakaPhase1.clone(
145  src = "siPixelClustersPreSplittingAlpaka"
146 ))
147 
148 (alpaka & pp_on_AA & ~phase2_tracker).toReplaceWith(siPixelDigisClustersPreSplitting,_siPixelDigisClustersFromSoAAlpakaHIonPhase1.clone(
149  src = "siPixelClustersPreSplittingAlpaka"
150 ))
151 
152 (alpaka & phase2_tracker).toReplaceWith(siPixelDigisClustersPreSplitting,_siPixelDigisClustersFromSoAAlpakaPhase2.clone(
153  clusterThreshold_layer1 = 4000,
154  clusterThreshold_otherLayers = 4000,
155  src = "siPixelClustersPreSplittingAlpaka",
156  storeDigis = False,
157  produceDigis = False
158 ))
159 
160 alpaka.toModify(siPixelClustersPreSplitting,
161  cpu = cms.EDAlias(
162  siPixelDigisClustersPreSplitting = cms.VPSet(
163  cms.PSet(type = cms.string("SiPixelClusteredmNewDetSetVector"))
164  )
165  )
166 )
167 
168 # These produce pixelDigiErrors in Alpaka; they are constructed here because they need
169 # siPixelClustersPreSplittingAlpaka* as input
170 from EventFilter.SiPixelRawToDigi.siPixelDigiErrorsFromSoAAlpaka_cfi import siPixelDigiErrorsFromSoAAlpaka as _siPixelDigiErrorsFromSoAAlpaka
171 siPixelDigiErrorsAlpaka = _siPixelDigiErrorsFromSoAAlpaka.clone(
172  digiErrorSoASrc = cms.InputTag('siPixelClustersPreSplittingAlpaka'),
173  fmtErrorsSoASrc = cms.InputTag('siPixelClustersPreSplittingAlpaka'),
174  UsePhase1 = cms.bool(True)
175 )
176 
177 siPixelDigiErrorsAlpakaSerial = siPixelDigiErrorsAlpaka.clone(
178  digiErrorSoASrc = cms.InputTag('siPixelClustersPreSplittingAlpakaSerial'),
179  fmtErrorsSoASrc = cms.InputTag('siPixelClustersPreSplittingAlpakaSerial')
180 )
181 
182 # Run 3
183 alpaka.toReplaceWith(siPixelClustersPreSplittingTask, cms.Task(
184  # reconstruct the pixel clusters with alpaka
185  siPixelClustersPreSplittingAlpaka,
186  # reconstruct the pixel clusters with alpaka on the cpu (if requested by the validation)
187  siPixelClustersPreSplittingAlpakaSerial,
188  # reconstruct pixel digis errors legacy with alpaka on serial and device
189  siPixelDigiErrorsAlpaka,
190  siPixelDigiErrorsAlpakaSerial,
191  # convert from host SoA to legacy formats (digis and clusters)
192  siPixelDigisClustersPreSplitting,
193  # EDAlias for the clusters
194  siPixelClustersPreSplitting)
195 )
196 
197 # Phase 2
198 (alpaka & phase2_tracker).toReplaceWith(siPixelClustersPreSplittingTask, cms.Task(
199  # reconstruct the pixel clusters with alpaka from copied digis
200  siPixelClustersPreSplittingAlpaka,
201  # reconstruct the pixel clusters with alpaka from copied digis on the cpu (if requested by the validation)
202  siPixelClustersPreSplittingAlpakaSerial,
203  # reconstruct pixel digis errors legacy with alpaka on serial and device
204  siPixelDigiErrorsAlpaka,
205  siPixelDigiErrorsAlpakaSerial,
206  # convert the pixel digis (except errors) and clusters to the legacy format
207  siPixelDigisClustersPreSplitting,
208  # SwitchProducer wrapping the legacy pixel cluster producer or an alias for the pixel clusters information converted from SoA
209  siPixelClustersPreSplitting)
210 )
def makeSerialClone(module, kwargs)
Definition: functions.py:1
def _addProcessCalibTrackerAlpakaES(process)
Alpaka Pixel Clusters Reco.