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 siPixelClustersPreSplittingAlpaka = _siPixelRawToClusterAlpaka.clone()
115 
116 (alpaka & run3_common).toModify(siPixelClustersPreSplittingAlpaka,
117  # use the pixel channel calibrations scheme for Run 3
118  clusterThreshold_layer1 = 4000,
119  VCaltoElectronGain = 1, # all gains=1, pedestals=0
120  VCaltoElectronGain_L1 = 1,
121  VCaltoElectronOffset = 0,
122  VCaltoElectronOffset_L1 = 0)
123 
124 from RecoLocalTracker.SiPixelClusterizer.siPixelPhase2DigiToCluster_cfi import siPixelPhase2DigiToCluster as _siPixelPhase2DigiToCluster
125 
126 (alpaka & phase2_tracker).toReplaceWith(siPixelClustersPreSplittingAlpaka, _siPixelPhase2DigiToCluster.clone(
127  Phase2ReadoutMode = PixelDigitizerAlgorithmCommon.Phase2ReadoutMode.value(), # flag to decide Readout Mode : linear TDR (-1), dual slope with slope parameters (+1,+2,+3,+4 ...) with threshold subtraction
128  Phase2DigiBaseline = int(PixelDigitizerAlgorithmCommon.ThresholdInElectrons_Barrel.value()), # same for barrel and endcap
129  Phase2KinkADC = 8,
130  ElectronPerADCGain = PixelDigitizerAlgorithmCommon.ElectronPerAdc.value()
131 ))
132 
133 # reconstruct the pixel digis and clusters with alpaka on the cpu, for validation
134 siPixelClustersPreSplittingAlpakaSerial = makeSerialClone(siPixelClustersPreSplittingAlpaka)
135 
136 from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAAlpakaPhase1_cfi import siPixelDigisClustersFromSoAAlpakaPhase1 as _siPixelDigisClustersFromSoAAlpakaPhase1
137 from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAAlpakaPhase2_cfi import siPixelDigisClustersFromSoAAlpakaPhase2 as _siPixelDigisClustersFromSoAAlpakaPhase2
138 
139 (alpaka & ~phase2_tracker).toReplaceWith(siPixelDigisClustersPreSplitting,_siPixelDigisClustersFromSoAAlpakaPhase1.clone(
140  src = "siPixelClustersPreSplittingAlpaka"
141 ))
142 
143 (alpaka & phase2_tracker).toReplaceWith(siPixelDigisClustersPreSplitting,_siPixelDigisClustersFromSoAAlpakaPhase2.clone(
144  clusterThreshold_layer1 = 4000,
145  clusterThreshold_otherLayers = 4000,
146  src = "siPixelClustersPreSplittingAlpaka",
147  storeDigis = False,
148  produceDigis = False
149 ))
150 
151 from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAAlpakaPhase1_cfi import siPixelDigisClustersFromSoAAlpakaPhase1 as _siPixelDigisClustersFromSoAAlpakaPhase1
152 from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoAAlpakaPhase2_cfi import siPixelDigisClustersFromSoAAlpakaPhase2 as _siPixelDigisClustersFromSoAAlpakaPhase2
153 
154 alpaka.toModify(siPixelClustersPreSplitting,
155  cpu = cms.EDAlias(
156  siPixelDigisClustersPreSplitting = cms.VPSet(
157  cms.PSet(type = cms.string("SiPixelClusteredmNewDetSetVector"))
158  )
159  )
160 )
161 
162 # Run 3
163 alpaka.toReplaceWith(siPixelClustersPreSplittingTask, cms.Task(
164  # reconstruct the pixel clusters with alpaka
165  siPixelClustersPreSplittingAlpaka,
166  # reconstruct the pixel clusters with alpaka on the cpu (if requested by the validation)
167  siPixelClustersPreSplittingAlpakaSerial,
168  # convert from host SoA to legacy formats (digis and clusters)
169  siPixelDigisClustersPreSplitting,
170  # EDAlias for the clusters
171  siPixelClustersPreSplitting)
172 )
173 
174 # Phase 2
175 (alpaka & phase2_tracker).toReplaceWith(siPixelClustersPreSplittingTask, cms.Task(
176  # reconstruct the pixel clusters with alpaka from copied digis
177  siPixelClustersPreSplittingAlpaka,
178  # reconstruct the pixel clusters with alpaka from copied digis on the cpu (if requested by the validation)
179  siPixelClustersPreSplittingAlpakaSerial,
180  # convert the pixel digis (except errors) and clusters to the legacy format
181  siPixelDigisClustersPreSplitting,
182  # SwitchProducer wrapping the legacy pixel cluster producer or an alias for the pixel clusters information converted from SoA
183  siPixelClustersPreSplitting)
184 )
def makeSerialClone(module, kwargs)
Definition: functions.py:1
def _addProcessCalibTrackerAlpakaES(process)
Alpaka Pixel Clusters Reco.