CMS 3D CMS Logo

customizeHLTforAlpaka.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
5 
6 
8  '''Customization to introduce Particle Flow Reconstruction in Alpaka
9  '''
10 
11  if not hasattr(process, 'hltParticleFlowClusterHBHE'):
12  return process
13 
14  for prod in producers_by_type(process, 'HCALRecHitSoAProducer@alpaka'):
15  return process
16 
17  process.hltESSPFRecHitHCALParamsRecord = cms.ESSource('EmptyESSource',
18  recordName = cms.string('PFRecHitHCALParamsRecord'),
19  iovIsRunNotTime = cms.bool(True),
20  firstValid = cms.vuint32(1)
21  )
22 
23  process.hltESSPFRecHitHCALTopologyRecord = cms.ESSource('EmptyESSource',
24  recordName = cms.string('PFRecHitHCALTopologyRecord'),
25  iovIsRunNotTime = cms.bool(True),
26  firstValid = cms.vuint32(1)
27  )
28 
29  process.hltESSJobConfigurationGPURecord = cms.ESSource('EmptyESSource',
30  recordName = cms.string('JobConfigurationGPURecord'),
31  iovIsRunNotTime = cms.bool(True),
32  firstValid = cms.vuint32(1)
33  )
34 
35  process.hltHbheRecHitSoA = cms.EDProducer("HCALRecHitSoAProducer@alpaka",
36  src = cms.InputTag("hltHbhereco"),
37  synchronise = cms.untracked.bool(False),
38  # autoselect the alpaka backend
39  alpaka = cms.untracked.PSet(
40  backend = cms.untracked.string('')
41  )
42  )
43 
44  process.hltESPPFRecHitHCALTopology = cms.ESProducer('PFRecHitHCALTopologyESProducer@alpaka',
45  usePFThresholdsFromDB = cms.bool(True),
46  appendToDataLabel = cms.string(''),
47  # autoselect the alpaka backend
48  alpaka = cms.untracked.PSet(
49  backend = cms.untracked.string('')
50  )
51  )
52 
53  process.hltESPPFRecHitHCALParams = cms.ESProducer('PFRecHitHCALParamsESProducer@alpaka',
54  energyThresholdsHB = cms.vdouble(0.1, 0.2, 0.3, 0.3),
55  energyThresholdsHE = cms.vdouble(0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2),
56  appendToDataLabel = cms.string(''),
57  # autoselect the alpaka backend
58  alpaka = cms.untracked.PSet(
59  backend = cms.untracked.string('')
60  )
61  )
62 
63  process.hltParticleFlowRecHitHBHESoA = cms.EDProducer("PFRecHitSoAProducerHCAL@alpaka",
64  producers = cms.VPSet(
65  cms.PSet(
66  src = cms.InputTag("hltHbheRecHitSoA"),
67  params = cms.ESInputTag("hltESPPFRecHitHCALParams:"),
68  )
69  ),
70  topology = cms.ESInputTag("hltESPPFRecHitHCALTopology:"),
71  synchronise = cms.untracked.bool(False),
72  # autoselect the alpaka backend
73  alpaka = cms.untracked.PSet(
74  backend = cms.untracked.string('')
75  )
76  )
77 
78  process.hltParticleFlowRecHitHBHE = cms.EDProducer("LegacyPFRecHitProducer",
79  src = cms.InputTag("hltParticleFlowRecHitHBHESoA")
80  )
81 
82  process.hltESPPFClusterParams = cms.ESProducer("PFClusterParamsESProducer@alpaka",
83  seedFinder = cms.PSet(
84  nNeighbours = cms.int32(4),
85  thresholdsByDetector = cms.VPSet(
86  cms.PSet(
87  detector = cms.string('HCAL_BARREL1'),
88  seedingThreshold = cms.vdouble(0.125, 0.25, 0.35, 0.35),
89  seedingThresholdPt = cms.double(0)
90  ),
91  cms.PSet(
92  detector = cms.string('HCAL_ENDCAP'),
93  seedingThreshold = cms.vdouble(0.1375, 0.275, 0.275, 0.275, 0.275, 0.275, 0.275),
94  seedingThresholdPt = cms.double(0)
95  )
96  )
97  ),
98  initialClusteringStep = cms.PSet(
99  thresholdsByDetector = cms.VPSet(
100  cms.PSet(
101  detector = cms.string('HCAL_BARREL1'),
102  gatheringThreshold = cms.vdouble(0.1, 0.2, 0.3, 0.3)
103  ),
104  cms.PSet(
105  detector = cms.string('HCAL_ENDCAP'),
106  gatheringThreshold = cms.vdouble(0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2)
107  )
108  )
109  ),
110  pfClusterBuilder = cms.PSet(
111  maxIterations = cms.uint32(5),
112  minFracTot = cms.double(1e-20),
113  minFractionToKeep = cms.double(1e-07),
114  excludeOtherSeeds = cms.bool(True),
115  showerSigma = cms.double(10),
116  stoppingTolerance = cms.double(1e-08),
117  recHitEnergyNorms = cms.VPSet(
118  cms.PSet(
119  detector = cms.string('HCAL_BARREL1'),
120  recHitEnergyNorm = cms.vdouble(0.1, 0.2, 0.3, 0.3)
121  ),
122  cms.PSet(
123  detector = cms.string('HCAL_ENDCAP'),
124  recHitEnergyNorm = cms.vdouble(0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2)
125  )
126  ),
127  positionCalc = cms.PSet(
128  minFractionInCalc = cms.double(1e-09),
129  minAllowedNormalization = cms.double(1e-09)
130  ),
131  timeResolutionCalcBarrel = cms.PSet(
132  corrTermLowE = cms.double(0),
133  threshLowE = cms.double(6),
134  noiseTerm = cms.double(21.86),
135  constantTermLowE = cms.double(4.24),
136  noiseTermLowE = cms.double(8),
137  threshHighE = cms.double(15),
138  constantTerm = cms.double(2.82)
139  ),
140  timeResolutionCalcEndcap = cms.PSet(
141  corrTermLowE = cms.double(0),
142  threshLowE = cms.double(6),
143  noiseTerm = cms.double(21.86),
144  constantTermLowE = cms.double(4.24),
145  noiseTermLowE = cms.double(8),
146  threshHighE = cms.double(15),
147  constantTerm = cms.double(2.82)
148  )
149  ),
150  # autoselect the alpaka backend
151  alpaka = cms.untracked.PSet(
152  backend = cms.untracked.string('')
153  )
154  )
155 
156  process.hltParticleFlowClusterHBHESoA = cms.EDProducer("PFClusterSoAProducer@alpaka",
157  pfRecHits = cms.InputTag("hltParticleFlowRecHitHBHESoA"),
158  topology = cms.ESInputTag("hltESPPFRecHitHCALTopology:"),
159  pfClusterParams = cms.ESInputTag("hltESPPFClusterParams:"),
160  synchronise = cms.bool(False),
161  # autoselect the alpaka backend
162  alpaka = cms.untracked.PSet(
163  backend = cms.untracked.string('')
164  )
165  )
166 
167  process.hltParticleFlowClusterHBHE = cms.EDProducer("LegacyPFClusterProducer",
168  src = cms.InputTag("hltParticleFlowClusterHBHESoA"),
169  pfClusterBuilder = process.hltParticleFlowClusterHBHE.pfClusterBuilder,
170  usePFThresholdsFromDB = cms.bool(True),
171  recHitsSource = cms.InputTag("hltParticleFlowRecHitHBHE"),
172  PFRecHitsLabelIn = cms.InputTag("hltParticleFlowRecHitHBHESoA")
173  )
174 
175  process.HLTPFHcalClustering = cms.Sequence(
176  process.hltHbheRecHitSoA +
177  process.hltParticleFlowRecHitHBHESoA +
178  process.hltParticleFlowRecHitHBHE +
179  process.hltParticleFlowClusterHBHESoA +
180  process.hltParticleFlowClusterHBHE +
181  process.hltParticleFlowClusterHCAL
182  )
183 
184  # Some Sequences contain all the modules of process.HLTPFHcalClustering Sequence instead of the Sequence itself
185  # find these Sequences and replace all the modules with the Sequence
186  def replaceItemsInSequence(process, seqNames, itemsToReplace, replacingSequence):
187  for seqName in seqNames:
188  if not hasattr(process, seqName):
189  continue
190  seq = getattr(process, seqName)
191  for item in itemsToReplace:
192  # remove items that will be replaced by replacingSequence
193  if (item != itemsToReplace[-1]):
194  seq.remove(item)
195  else:
196  # if last item, replace it with the Sequence
197  seq.replace(item, replacingSequence)
198  return process
199 
200  process = replaceItemsInSequence(
201  process, [
202  'HLTParticleFlowSequence',
203  'HLTParticleFlowSequenceForTaus',
204  'HLTParticleFlowSequenceForDisplTaus',
205  'HLTParticleFlowSequencePPOnAA',
206  'HLTPixelOnlyParticleFlowSequence',
207  ], [
208  process.hltParticleFlowRecHitHBHE,
209  process.hltParticleFlowClusterHBHE,
210  process.hltParticleFlowClusterHCAL
211  ],
212  process.HLTPFHcalClustering
213  )
214 
215  process.hltHbheRecHitSoACPUSerial = makeSerialClone(process.hltHbheRecHitSoA)
216 
217  process.hltParticleFlowRecHitHBHESoACPUSerial = makeSerialClone(process.hltParticleFlowRecHitHBHESoA)
218  process.hltParticleFlowRecHitHBHESoACPUSerial.producers[0].src = 'hltHbheRecHitSoACPUSerial'
219 
220  process.hltParticleFlowRecHitHBHECPUOnly = process.hltParticleFlowRecHitHBHE.clone(
221  src = 'hltParticleFlowRecHitHBHESoACPUSerial',
222  )
223 
224  process.hltParticleFlowClusterHBHESoACPUSerial = makeSerialClone(process.hltParticleFlowClusterHBHESoA,
225  pfRecHits = 'hltParticleFlowRecHitHBHESoACPUSerial',
226  )
227 
228  process.hltParticleFlowClusterHBHECPUOnly = process.hltParticleFlowClusterHBHE.clone(
229  src = 'hltParticleFlowClusterHBHESoACPUSerial',
230  recHitsSource = 'hltParticleFlowRecHitHBHECPUOnly',
231  PFRecHitsLabelIn = 'hltParticleFlowRecHitHBHESoACPUSerial',
232  )
233 
234  process.HLTPFHcalClusteringCPUOnly = cms.Sequence(
235  process.hltHbheRecHitSoACPUSerial +
236  process.hltParticleFlowRecHitHBHESoACPUSerial +
237  process.hltParticleFlowRecHitHBHECPUOnly +
238  process.hltParticleFlowClusterHBHESoACPUSerial +
239  process.hltParticleFlowClusterHBHECPUOnly +
240  process.hltParticleFlowClusterHCALCPUOnly
241  )
242 
243  process = replaceItemsInSequence(process, ['HLTParticleFlowCPUOnlySequence'],
244  [process.hltParticleFlowRecHitHBHECPUOnly, process.hltParticleFlowClusterHBHECPUOnly, process.hltParticleFlowClusterHCALCPUOnly],
245  process.HLTPFHcalClusteringCPUOnly)
246 
247  # modify EventContent of *DQMGPUvsCPU streams
248  for hltOutModMatch in ['hltOutputDQMGPUvsCPU', 'hltOutputHIDQMGPUvsCPU']:
249  if hasattr(process, hltOutModMatch):
250  outMod = getattr(process, hltOutModMatch)
251  outMod.outputCommands.extend([
252  'keep *_hltParticleFlowClusterHBHESoA_*_*',
253  'keep *_hltParticleFlowClusterHBHESoACPUSerial_*_*',
254  ])
255 
256  # Add PF sequences to DQM_*HcalReconstruction_v Path
257  for pathNameMatch in ['DQM_HcalReconstruction_v', 'DQM_HIHcalReconstruction_v']:
258  dqmHcalRecoPathName = None
259  for pathName in process.paths_():
260  if pathName.startswith(pathNameMatch):
261  dqmHcalRecoPathName = pathName
262  break
263  if dqmHcalRecoPathName == None:
264  continue
265  dqmHcalPath = getattr(process, dqmHcalRecoPathName)
266  dqmHcalRecoPathIndex = dqmHcalPath.index(process.hltHcalConsumerGPU) + 1
267  dqmHcalPath.insert(dqmHcalRecoPathIndex, process.HLTPFHcalClusteringCPUOnly)
268  dqmHcalPath.insert(dqmHcalRecoPathIndex, process.HLTPFHcalClustering)
269 
270  return process
271 
272 
273 
275  '''Ad-hoc changes to test HLT config containing only DQM_PixelReconstruction_v and DQMGPUvsCPU stream
276  only up to the Pixel Local Reconstruction
277  '''
278  dqmPixelRecoPathName = None
279  for pathName in process.paths_():
280  if pathName.startswith('DQM_PixelReconstruction_v'):
281  dqmPixelRecoPathName = pathName
282  break
283 
284  if dqmPixelRecoPathName == None:
285  return process
286 
287  for prod in producers_by_type(process, 'SiPixelPhase1MonitorRecHitsSoAAlpaka'):
288  return process
289 
290  # modify EventContent of DQMGPUvsCPU stream
291  try:
292  outCmds_new = [foo for foo in process.hltOutputDQMGPUvsCPU.outputCommands if 'Pixel' not in foo]
293  outCmds_new += [
294  'keep *Cluster*_hltSiPixelClusters_*_*',
295  'keep *Cluster*_hltSiPixelClustersLegacyFormatCPUSerial_*_*',
296  'keep *_hltSiPixelDigiErrors_*_*',
297  'keep *_hltSiPixelDigiErrorsLegacyFormatCPUSerial_*_*',
298  'keep *RecHit*_hltSiPixelRecHits_*_*',
299  'keep *RecHit*_hltSiPixelRecHitsLegacyFormatCPUSerial_*_*',
300  'keep *_hltPixelTracks_*_*',
301  'keep *_hltPixelTracksLegacyFormatCPUSerial_*_*',
302  'keep *_hltPixelVertices_*_*',
303  'keep *_hltPixelVerticesLegacyFormatCPUSerial_*_*',
304  ]
305  process.hltOutputDQMGPUvsCPU.outputCommands = outCmds_new[:]
306  except:
307  pass
308 
309  # PixelRecHits: monitor of CPUSerial product (Alpaka backend: 'serial_sync')
310  process.hltPixelRecHitsSoAMonitorCPU = cms.EDProducer('SiPixelPhase1MonitorRecHitsSoAAlpaka',
311  pixelHitsSrc = cms.InputTag('hltSiPixelRecHitsSoACPUSerial'),
312  TopFolderName = cms.string('SiPixelHeterogeneous/PixelRecHitsCPU')
313  )
314 
315  # PixelRecHits: monitor of GPU product (Alpaka backend: '')
316  process.hltPixelRecHitsSoAMonitorGPU = cms.EDProducer('SiPixelPhase1MonitorRecHitsSoAAlpaka',
317  pixelHitsSrc = cms.InputTag('hltSiPixelRecHitsSoA'),
318  TopFolderName = cms.string('SiPixelHeterogeneous/PixelRecHitsGPU')
319  )
320 
321  # PixelRecHits: 'GPUvsCPU' comparisons
322  process.hltPixelRecHitsSoACompareGPUvsCPU = cms.EDProducer('SiPixelPhase1CompareRecHitsSoAAlpaka',
323  pixelHitsSrcHost = cms.InputTag('hltSiPixelRecHitsSoACPUSerial'),
324  pixelHitsSrcDevice = cms.InputTag('hltSiPixelRecHitsSoA'),
325  topFolderName = cms.string('SiPixelHeterogeneous/PixelRecHitsCompareGPUvsCPU'),
326  minD2cut = cms.double(1.0e-4)
327  )
328 
329  process.hltPixelTracksSoAMonitorCPU = cms.EDProducer("SiPixelPhase1MonitorTrackSoAAlpaka",
330  minQuality = cms.string('loose'),
331  pixelTrackSrc = cms.InputTag('hltPixelTracksSoACPUSerial'),
332  topFolderName = cms.string('SiPixelHeterogeneous/PixelTrackCPU'),
333  useQualityCut = cms.bool(True)
334  )
335 
336  process.hltPixelTracksSoAMonitorGPU = cms.EDProducer("SiPixelPhase1MonitorTrackSoAAlpaka",
337  minQuality = cms.string('loose'),
338  pixelTrackSrc = cms.InputTag('hltPixelTracksSoA'),
339  topFolderName = cms.string('SiPixelHeterogeneous/PixelTrackGPU'),
340  useQualityCut = cms.bool(True)
341  )
342 
343  process.hltPixelTracksSoACompareGPUvsCPU = cms.EDProducer("SiPixelPhase1CompareTrackSoAAlpaka",
344  deltaR2cut = cms.double(0.04),
345  minQuality = cms.string('loose'),
346  pixelTrackSrcHost = cms.InputTag("hltPixelTracksSoACPUSerial"),
347  pixelTrackSrcDevice = cms.InputTag("hltPixelTracksSoA"),
348  topFolderName = cms.string('SiPixelHeterogeneous/PixelTrackCompareGPUvsCPU'),
349  useQualityCut = cms.bool(True)
350  )
351 
352  process.hltPixelVertexSoAMonitorCPU = cms.EDProducer("SiPixelMonitorVertexSoAAlpaka",
353  beamSpotSrc = cms.InputTag("hltOnlineBeamSpot"),
354  pixelVertexSrc = cms.InputTag("hltPixelVerticesSoACPUSerial"),
355  topFolderName = cms.string('SiPixelHeterogeneous/PixelVertexCPU')
356  )
357 
358  process.hltPixelVertexSoAMonitorGPU = cms.EDProducer("SiPixelMonitorVertexSoAAlpaka",
359  beamSpotSrc = cms.InputTag("hltOnlineBeamSpot"),
360  pixelVertexSrc = cms.InputTag("hltPixelVerticesSoA"),
361  topFolderName = cms.string('SiPixelHeterogeneous/PixelVertexGPU')
362  )
363 
364  process.hltPixelVertexSoACompareGPUvsCPU = cms.EDProducer("SiPixelCompareVertexSoAAlpaka",
365  beamSpotSrc = cms.InputTag("hltOnlineBeamSpot"),
366  dzCut = cms.double(1),
367  pixelVertexSrcHost = cms.InputTag("hltPixelVerticesSoACPUSerial"),
368  pixelVertexSrcDevice = cms.InputTag("hltPixelVerticesSoA"),
369  topFolderName = cms.string('SiPixelHeterogeneous/PixelVertexCompareGPUvsCPU')
370  )
371 
372  process.HLTDQMPixelReconstruction = cms.Sequence(
373  process.hltPixelRecHitsSoAMonitorCPU
374  + process.hltPixelRecHitsSoAMonitorGPU
375  + process.hltPixelRecHitsSoACompareGPUvsCPU
376  + process.hltPixelTracksSoAMonitorCPU
377  + process.hltPixelTracksSoAMonitorGPU
378  + process.hltPixelTracksSoACompareGPUvsCPU
379  + process.hltPixelVertexSoAMonitorCPU
380  + process.hltPixelVertexSoAMonitorGPU
381  + process.hltPixelVertexSoACompareGPUvsCPU
382  )
383 
384  for delMod in ['hltPixelConsumerCPU', 'hltPixelConsumerGPU']:
385  if hasattr(process, delMod):
386  process.__delattr__(delMod)
387 
388  return process
389 
390 
392  '''Customisation to introduce the Local Pixel Reconstruction in Alpaka
393  '''
394 
395  if not hasattr(process, 'HLTDoLocalPixelSequence'):
396  return process
397 
398  for prod in producers_by_type(process, 'SiPixelRawToClusterPhase1@alpaka'):
399  return process
400 
401  process.hltESPSiPixelCablingSoA = cms.ESProducer('SiPixelCablingSoAESProducer@alpaka',
402  CablingMapLabel = cms.string(''),
403  UseQualityInfo = cms.bool(False),
404  appendToDataLabel = cms.string(''),
405  alpaka = cms.untracked.PSet(
406  backend = cms.untracked.string('')
407  )
408  )
409 
410  process.hltESPSiPixelGainCalibrationForHLTSoA = cms.ESProducer('SiPixelGainCalibrationForHLTSoAESProducer@alpaka',
411  appendToDataLabel = cms.string(''),
412  alpaka = cms.untracked.PSet(
413  backend = cms.untracked.string('')
414  )
415  )
416 
417  process.hltESPPixelCPEFastParamsPhase1 = cms.ESProducer('PixelCPEFastParamsESProducerAlpakaPhase1@alpaka',
418  appendToDataLabel = cms.string(''),
419  alpaka = cms.untracked.PSet(
420  backend = cms.untracked.string('')
421  )
422  )
423 
424  if hasattr(process, 'hltESPPixelCPEFast'):
425  del process.hltESPPixelCPEFast
426 
427  # alpaka EDProducer
428  # consumes
429  # - reco::BeamSpot
430  # produces
431  # - BeamSpotDevice
432  process.hltOnlineBeamSpotDevice = cms.EDProducer('BeamSpotDeviceProducer@alpaka',
433  src = cms.InputTag('hltOnlineBeamSpot'),
434  alpaka = cms.untracked.PSet(
435  backend = cms.untracked.string('')
436  )
437  )
438 
439  if hasattr(process, 'hltOnlineBeamSpotToGPU'):
440  del process.hltOnlineBeamSpotToGPU
441 
442  # alpaka EDProducer
443  # consumes
444  # - FEDRawDataCollection
445  # produces (* optional)
446  # - SiPixelClustersSoA
447  # - SiPixelDigisSoACollection
448  # - SiPixelDigiErrorsSoACollection *
449  # - SiPixelFormatterErrors *
450  process.hltSiPixelClustersSoA = cms.EDProducer('SiPixelRawToClusterPhase1@alpaka',
451  IncludeErrors = cms.bool(True),
452  UseQualityInfo = cms.bool(False),
453  clusterThreshold_layer1 = cms.int32(4000),
454  clusterThreshold_otherLayers = cms.int32(4000),
455  VCaltoElectronGain = cms.double(1), # all gains=1, pedestals=0
456  VCaltoElectronGain_L1 = cms.double(1),
457  VCaltoElectronOffset = cms.double(0),
458  VCaltoElectronOffset_L1 = cms.double(0),
459  InputLabel = cms.InputTag('rawDataCollector'),
460  Regions = cms.PSet(),
461  CablingMapLabel = cms.string(''),
462  # autoselect the alpaka backend
463  alpaka = cms.untracked.PSet(
464  backend = cms.untracked.string('')
465  )
466  )
467 
468  if hasattr(process, 'hltSiPixelClustersGPU'):
469  del process.hltSiPixelClustersGPU
470 
471  process.hltSiPixelClusters = cms.EDProducer('SiPixelDigisClustersFromSoAAlpakaPhase1',
472  src = cms.InputTag('hltSiPixelClustersSoA'),
473  clusterThreshold_layer1 = cms.int32(4000),
474  clusterThreshold_otherLayers = cms.int32(4000),
475  produceDigis = cms.bool(False),
476  storeDigis = cms.bool(False)
477  )
478 
479  # used only in the PPRef menu for the legacy pixel track reconstruction
480  process.hltSiPixelClustersCache = cms.EDProducer('SiPixelClusterShapeCacheProducer',
481  src = cms.InputTag('hltSiPixelClusters'),
482  onDemand = cms.bool(False)
483  )
484 
485  # legacy EDProducer
486  # consumes
487  # - SiPixelDigiErrorsHost
488  # - SiPixelFormatterErrors
489  # produces
490  # - edm::DetSetVector<SiPixelRawDataError>
491  # - DetIdCollection
492  # - DetIdCollection, 'UserErrorModules'
493  # - edmNew::DetSetVector<PixelFEDChannel>
494  process.hltSiPixelDigiErrors = cms.EDProducer('SiPixelDigiErrorsFromSoAAlpaka',
495  digiErrorSoASrc = cms.InputTag('hltSiPixelClustersSoA'),
496  fmtErrorsSoASrc = cms.InputTag('hltSiPixelClustersSoA'),
497  CablingMapLabel = cms.string(''),
498  UsePhase1 = cms.bool(True),
499  ErrorList = cms.vint32(29),
500  UserErrorList = cms.vint32(40)
501  )
502 
503  if hasattr(process, 'hltSiPixelDigisSoA'):
504  del process.hltSiPixelDigisSoA
505  if hasattr(process, 'hltSiPixelDigiErrorsSoA'):
506  del process.hltSiPixelDigiErrorsSoA
507 
508  # alpaka EDProducer
509  # consumes
510  # - BeamSpotDevice
511  # - SiPixelClustersSoA
512  # - SiPixelDigisSoACollection
513  # produces
514  # - TrackingRecHitsSoACollection<TrackerTraits>
515  process.hltSiPixelRecHitsSoA = cms.EDProducer('SiPixelRecHitAlpakaPhase1@alpaka',
516  beamSpot = cms.InputTag('hltOnlineBeamSpotDevice'),
517  src = cms.InputTag('hltSiPixelClustersSoA'),
518  CPE = cms.string('PixelCPEFastParams'),
519  # autoselect the alpaka backend
520  alpaka = cms.untracked.PSet(
521  backend = cms.untracked.string('')
522  )
523  )
524 
525  if hasattr(process, 'hltSiPixelRecHitsGPU'):
526  del process.hltSiPixelRecHitsGPU
527  if hasattr(process, 'hltSiPixelRecHitsFromGPU'):
528  del process.hltSiPixelRecHitsFromGPU
529  if hasattr(process, 'hltSiPixelRecHitsSoAFromGPU'):
530  del process.hltSiPixelRecHitsSoAFromGPU
531 
532  process.hltSiPixelRecHits = cms.EDProducer('SiPixelRecHitFromSoAAlpakaPhase1',
533  pixelRecHitSrc = cms.InputTag('hltSiPixelRecHitsSoA'),
534  src = cms.InputTag('hltSiPixelClusters'),
535  )
536 
537 
540  process.HLTDoLocalPixelSequence = cms.Sequence(
541  process.hltOnlineBeamSpotDevice +
542  process.hltSiPixelClustersSoA +
543  process.hltSiPixelClusters +
544  process.hltSiPixelClustersCache + # used only in the PPRef menu for the legacy pixel track reconstruction
545  process.hltSiPixelDigiErrors + # renamed from hltSiPixelDigis
546  process.hltSiPixelRecHitsSoA +
547  process.hltSiPixelRecHits
548  )
549 
550  if hasattr(process, 'HLTDoLocalPixelTask'):
551  del process.HLTDoLocalPixelTask
552 
553 
556  process.hltOnlineBeamSpotDeviceCPUSerial = makeSerialClone(process.hltOnlineBeamSpotDevice)
557 
558  process.hltSiPixelClustersSoACPUSerial = makeSerialClone(process.hltSiPixelClustersSoA)
559 
560  process.hltSiPixelClustersLegacyFormatCPUSerial = process.hltSiPixelClusters.clone(
561  src = 'hltSiPixelClustersSoACPUSerial'
562  )
563 
564  process.hltSiPixelDigiErrorsLegacyFormatCPUSerial = process.hltSiPixelDigiErrors.clone(
565  digiErrorSoASrc = 'hltSiPixelClustersSoACPUSerial',
566  fmtErrorsSoASrc = 'hltSiPixelClustersSoACPUSerial',
567  )
568 
569  process.hltSiPixelRecHitsSoACPUSerial = makeSerialClone(process.hltSiPixelRecHitsSoA,
570  beamSpot = 'hltOnlineBeamSpotDeviceCPUSerial',
571  src = 'hltSiPixelClustersSoACPUSerial',
572  )
573 
574  process.hltSiPixelRecHitsLegacyFormatCPUSerial = process.hltSiPixelRecHits.clone(
575  pixelRecHitSrc = 'hltSiPixelRecHitsSoACPUSerial',
576  src = 'hltSiPixelClustersLegacyFormatCPUSerial',
577  )
578 
579  process.HLTDoLocalPixelCPUOnlySequence = cms.Sequence(
580  process.hltOnlineBeamSpotDeviceCPUSerial +
581  process.hltSiPixelClustersSoACPUSerial +
582  process.hltSiPixelClustersLegacyFormatCPUSerial +
583  process.hltSiPixelDigiErrorsLegacyFormatCPUSerial +
584  process.hltSiPixelRecHitsSoACPUSerial +
585  process.hltSiPixelRecHitsLegacyFormatCPUSerial
586  )
587 
588  if hasattr(process, 'HLTDoLocalPixelCPUOnlyTask'):
589  del process.HLTDoLocalPixelCPUOnlyTask
590 
591  if hasattr(process, 'hltMeasurementTrackerEventCPUOnly'):
592  process.hltMeasurementTrackerEventCPUOnly.pixelClusterProducer = "hltSiPixelClustersLegacyFormatCPUSerial"
593  process.hltMeasurementTrackerEventCPUOnly.inactivePixelDetectorLabels = ["hltSiPixelDigiErrorsLegacyFormatCPUSerial"]
594  process.hltMeasurementTrackerEventCPUOnly.badPixelFEDChannelCollectionLabels = ["hltSiPixelDigiErrorsLegacyFormatCPUSerial"]
595 
596  if hasattr(process, 'hltDoubletRecoveryClustersRefRemovalCPUOnly'):
597  process.hltDoubletRecoveryClustersRefRemovalCPUOnly.pixelClusters = "hltSiPixelClustersLegacyFormatCPUSerial"
598 
599  if hasattr(process, 'hltDoubletRecoveryPFlowPixelClusterCheckCPUOnly'):
600  process.hltDoubletRecoveryPFlowPixelClusterCheckCPUOnly.PixelClusterCollectionLabel = "hltSiPixelClustersLegacyFormatCPUSerial"
601 
602  if hasattr(process, 'hltDoubletRecoveryPixelLayersAndRegionsCPUOnly'):
603  process.hltDoubletRecoveryPixelLayersAndRegionsCPUOnly.inactivePixelDetectorLabels = ['hltSiPixelDigiErrorsLegacyFormatCPUSerial']
604  process.hltDoubletRecoveryPixelLayersAndRegionsCPUOnly.badPixelFEDChannelCollectionLabels = ['hltSiPixelDigiErrorsLegacyFormatCPUSerial']
605  process.hltDoubletRecoveryPixelLayersAndRegionsCPUOnly.BPix.HitProducer = "hltSiPixelRecHitsLegacyFormatCPUSerial"
606  process.hltDoubletRecoveryPixelLayersAndRegionsCPUOnly.FPix.HitProducer = "hltSiPixelRecHitsLegacyFormatCPUSerial"
607 
608  if hasattr(process, 'hltIter3IterL3FromL1MuonClustersRefRemovalCPUOnly'):
609  process.hltIter3IterL3FromL1MuonClustersRefRemovalCPUOnly.pixelClusters = "hltSiPixelClustersLegacyFormatCPUSerial"
610 
611  if hasattr(process, 'hltIter3IterL3FromL1MuonPixelClusterCheckCPUOnly'):
612  process.hltIter3IterL3FromL1MuonPixelClusterCheckCPUOnly.PixelClusterCollectionLabel = "hltSiPixelClustersLegacyFormatCPUSerial"
613 
614  if hasattr(process, 'hltIter3IterL3FromL1MuonPixelLayersAndRegionsCPUOnly'):
615  process.hltIter3IterL3FromL1MuonPixelLayersAndRegionsCPUOnly.inactivePixelDetectorLabels = ['hltSiPixelDigiErrorsLegacyFormatCPUSerial']
616  process.hltIter3IterL3FromL1MuonPixelLayersAndRegionsCPUOnly.badPixelFEDChannelCollectionLabels = ['hltSiPixelDigiErrorsLegacyFormatCPUSerial']
617  process.hltIter3IterL3FromL1MuonPixelLayersAndRegionsCPUOnly.BPix.HitProducer = "hltSiPixelRecHitsLegacyFormatCPUSerial"
618  process.hltIter3IterL3FromL1MuonPixelLayersAndRegionsCPUOnly.FPix.HitProducer = "hltSiPixelRecHitsLegacyFormatCPUSerial"
619 
620  for modLabel in [
621  'hltDoubletRecoveryPixelLayersAndRegions',
622  'hltFullIter6PixelTrackingRegionSeedLayersBPPRef',
623  'hltIter3IterL3FromL1MuonPixelLayersAndRegions',
624  'hltMeasurementTrackerEvent',
625  ]:
626  if hasattr(process, modLabel):
627  mod = getattr(process, modLabel)
628  mod.inactivePixelDetectorLabels = ['hltSiPixelDigiErrors']
629  mod.badPixelFEDChannelCollectionLabels = ['hltSiPixelDigiErrors']
630 
631  return process
632 
633 
635  '''Customisation to introduce the Pixel-Track Reconstruction in Alpaka
636  '''
637 
638  if not hasattr(process, 'HLTRecoPixelTracksSequence'):
639  return process
640 
641  for prod in producers_by_type(process, 'CAHitNtupletAlpakaPhase1@alpaka'):
642  return process
643 
644  # alpaka EDProducer
645  # consumes
646  # - TrackingRecHitsSoACollection<TrackerTraits>
647  # produces
648  # - TkSoADevice
649  process.hltPixelTracksSoA = cms.EDProducer('CAHitNtupletAlpakaPhase1@alpaka',
650  pixelRecHitSrc = cms.InputTag('hltSiPixelRecHitsSoA'),
651  CPE = cms.string('PixelCPEFastParams'),
652  ptmin = cms.double(0.9),
653  CAThetaCutBarrel = cms.double(0.002),
654  CAThetaCutForward = cms.double(0.003),
655  hardCurvCut = cms.double(0.0328407225),
656  dcaCutInnerTriplet = cms.double(0.15),
657  dcaCutOuterTriplet = cms.double(0.25),
658  earlyFishbone = cms.bool(True),
659  lateFishbone = cms.bool(False),
660  fillStatistics = cms.bool(False),
661  minHitsPerNtuplet = cms.uint32(3),
662  phiCuts = cms.vint32(
663  522, 730, 730, 522, 626,
664  626, 522, 522, 626, 626,
665  626, 522, 522, 522, 522,
666  522, 522, 522, 522
667  ),
668  maxNumberOfDoublets = cms.uint32(524288),
669  minHitsForSharingCut = cms.uint32(10),
670  fitNas4 = cms.bool(False),
671  doClusterCut = cms.bool(True),
672  doZ0Cut = cms.bool(True),
673  doPtCut = cms.bool(True),
674  useRiemannFit = cms.bool(False),
675  doSharedHitCut = cms.bool(True),
676  dupPassThrough = cms.bool(False),
677  useSimpleTripletCleaner = cms.bool(True),
678  idealConditions = cms.bool(False),
679  includeJumpingForwardDoublets = cms.bool(True),
680  trackQualityCuts = cms.PSet(
681  chi2MaxPt = cms.double(10),
682  chi2Coeff = cms.vdouble(0.9, 1.8),
683  chi2Scale = cms.double(8),
684  tripletMinPt = cms.double(0.5),
685  tripletMaxTip = cms.double(0.3),
686  tripletMaxZip = cms.double(12),
687  quadrupletMinPt = cms.double(0.3),
688  quadrupletMaxTip = cms.double(0.5),
689  quadrupletMaxZip = cms.double(12)
690  ),
691  # autoselect the alpaka backend
692  alpaka = cms.untracked.PSet(
693  backend = cms.untracked.string('')
694  )
695  )
696 
697  if hasattr(process, 'hltL2TauTagNNProducer'):
698  process.hltL2TauTagNNProducer = cms.EDProducer("L2TauNNProducerAlpaka", **process.hltL2TauTagNNProducer.parameters_())
699 
700  process.hltPixelTracksSoACPUSerial = makeSerialClone(process.hltPixelTracksSoA,
701  pixelRecHitSrc = 'hltSiPixelRecHitsSoACPUSerial'
702  )
703 
704  process.hltPixelTracks = cms.EDProducer("PixelTrackProducerFromSoAAlpakaPhase1",
705  beamSpot = cms.InputTag("hltOnlineBeamSpot"),
706  minNumberOfHits = cms.int32(0),
707  minQuality = cms.string('loose'),
708  pixelRecHitLegacySrc = cms.InputTag("hltSiPixelRecHits"),
709  trackSrc = cms.InputTag("hltPixelTracksSoA")
710  )
711 
712  if hasattr(process, 'hltPixelTracksCPU'):
713  del process.hltPixelTracksCPU
714  if hasattr(process, 'hltPixelTracksCPUOnly'):
715  del process.hltPixelTracksCPUOnly
716  if hasattr(process, 'hltPixelTracksFromGPU'):
717  del process.hltPixelTracksFromGPU
718  if hasattr(process, 'hltPixelTracksGPU'):
719  del process.hltPixelTracksGPU
720 
721  process.hltPixelTracksLegacyFormatCPUSerial = process.hltPixelTracks.clone(
722  pixelRecHitLegacySrc = cms.InputTag("hltSiPixelRecHitsLegacyFormatCPUSerial"),
723  trackSrc = cms.InputTag("hltPixelTracksSoACPUSerial")
724  )
725 
726  process.HLTRecoPixelTracksSequence = cms.Sequence(
727  process.hltPixelTracksSoA +
728  process.hltPixelTracks
729  )
730 
731  if hasattr(process, 'HLTRecoPixelTracksTask'):
732  del process.HLTRecoPixelTracksTask
733 
734  process.HLTRecoPixelTracksCPUSerialSequence = cms.Sequence(
735  process.hltPixelTracksSoACPUSerial +
736  process.hltPixelTracksLegacyFormatCPUSerial
737  )
738 
739  if hasattr(process, 'HLTRecoPixelTracksCPUOnlyTask'):
740  del process.HLTRecoPixelTracksCPUOnlyTask
741 
742  process.hltPixelTracksInRegionL2CPUOnly.tracks = "hltPixelTracksLegacyFormatCPUSerial"
743 
744  process.hltPixelTracksInRegionL1CPUOnly.tracks = "hltPixelTracksLegacyFormatCPUSerial"
745 
746  process.hltIter0PFLowPixelSeedsFromPixelTracksCPUOnly.InputCollection = "hltPixelTracksLegacyFormatCPUSerial"
747 
748  return process
749 
750 
752  '''Customisation to introduce the Pixel-Vertex Reconstruction in Alpaka
753  '''
754 
755  if not hasattr(process, 'HLTRecopixelvertexingSequence'):
756  return process
757 
758  # do not apply the customisation if the menu is already using the alpaka pixel reconstruction
759  for prod in producers_by_type(process, 'PixelVertexProducerAlpakaPhase1@alpaka'):
760  return process
761 
762  # alpaka EDProducer
763  # consumes
764  # - TkSoADevice
765  # produces
766  # - ZVertexDevice
767  process.hltPixelVerticesSoA = cms.EDProducer('PixelVertexProducerAlpakaPhase1@alpaka',
768  oneKernel = cms.bool(True),
769  useDensity = cms.bool(True),
770  useDBSCAN = cms.bool(False),
771  useIterative = cms.bool(False),
772  minT = cms.int32(2),
773  eps = cms.double(0.07),
774  errmax = cms.double(0.01),
775  chi2max = cms.double(9),
776  PtMin = cms.double(0.5),
777  PtMax = cms.double(75),
778  pixelTrackSrc = cms.InputTag('hltPixelTracksSoA'),
779  # autoselect the alpaka backend
780  alpaka = cms.untracked.PSet(
781  backend = cms.untracked.string('')
782  )
783  )
784 
785  process.hltPixelVerticesSoACPUSerial = makeSerialClone(process.hltPixelVerticesSoA,
786  pixelTrackSrc = 'hltPixelTracksSoACPUSerial'
787  )
788 
789  process.hltPixelVertices = cms.EDProducer("PixelVertexProducerFromSoAAlpaka",
790  TrackCollection = cms.InputTag("hltPixelTracks"),
791  beamSpot = cms.InputTag("hltOnlineBeamSpot"),
792  src = cms.InputTag("hltPixelVerticesSoA")
793  )
794 
795  process.hltPixelVerticesLegacyFormatCPUSerial = process.hltPixelVertices.clone(
796  TrackCollection = cms.InputTag("hltPixelTracksLegacyFormatCPUSerial"),
797  src = cms.InputTag("hltPixelVerticesSoACPUSerial")
798  )
799 
800  if hasattr(process, 'hltPixelVerticesCPU'):
801  del process.hltPixelVerticesCPU
802  if hasattr(process, 'hltPixelVerticesCPUOnly'):
803  del process.hltPixelVerticesCPUOnly
804  if hasattr(process, 'hltPixelVerticesFromGPU'):
805  del process.hltPixelVerticesFromGPU
806  if hasattr(process, 'hltPixelVerticesGPU'):
807  del process.hltPixelVerticesGPU
808 
809 
810  if not hasattr(process, 'hltTrimmedPixelVertices'):
811  return process
812 
813  process.HLTRecopixelvertexingSequence = cms.Sequence(
814  process.HLTRecoPixelTracksSequence +
815  process.hltPixelVerticesSoA +
816  process.hltPixelVertices +
817  process.hltTrimmedPixelVertices
818  )
819 
820  if hasattr(process, 'HLTRecopixelvertexingTask'):
821  del process.HLTRecopixelvertexingTask
822 
823  process.HLTRecopixelvertexingCPUOnlySequence = cms.Sequence(
824  process.HLTRecoPixelTracksCPUSerialSequence +
825  process.hltPixelVerticesSoACPUSerial +
826  process.hltPixelVerticesLegacyFormatCPUSerial +
827  process.hltTrimmedPixelVerticesCPUOnly
828  )
829 
830  if hasattr(process, 'HLTRecopixelvertexingCPUOnlyTask'):
831  del process.HLTRecopixelvertexingCPUOnlyTask
832 
833  process.hltTrimmedPixelVerticesCPUOnly.src = 'hltPixelVerticesLegacyFormatCPUSerial'
834  process.hltParticleFlowCPUOnly.vertexCollection = 'hltPixelVerticesLegacyFormatCPUSerial'
835  process.hltAK4PFJetsCPUOnly.srcPVs = 'hltPixelVerticesLegacyFormatCPUSerial'
836 
837  return process
838 
839 
841  '''Customisation to introduce the Pixel Local+Track+Vertex Reconstruction in Alpaka
842  '''
843  process = customizeHLTforAlpakaPixelRecoLocal(process)
844  process = customizeHLTforAlpakaPixelRecoTracking(process)
845  process = customizeHLTforAlpakaPixelRecoVertexing(process)
846  process = customizeHLTforDQMGPUvsCPUPixel(process)
847 
848  return process
849 
850 
851 
853 
854  if not hasattr(process, 'hltEcalDigisGPU'):
855  return process
856 
857  for prod in producers_by_type(process, 'EcalRawToDigiPortable@alpaka'):
858  return process
859 
860  # remove existing ECAL GPU-related ES modules
861  for foo in [foo for foo in process.es_producers_() if ('ecal' in foo and 'GPU' in foo)]:
862  process.__delattr__(foo)
863 
864  for foo in [foo for foo in process.es_sources_() if ('ecal' in foo and 'GPU' in foo)]:
865  process.__delattr__(foo)
866 
867  # redefine ECAL local reconstruction sequence
868  process.hltEcalDigisPortableSoA = cms.EDProducer("EcalRawToDigiPortable@alpaka",
869  FEDs = process.hltEcalDigisGPU.FEDs,
870  InputLabel = process.hltEcalDigisGPU.InputLabel,
871  digisLabelEB = process.hltEcalDigisGPU.digisLabelEB,
872  digisLabelEE = process.hltEcalDigisGPU.digisLabelEE,
873  maxChannelsEB = process.hltEcalDigisGPU.maxChannelsEB,
874  maxChannelsEE = process.hltEcalDigisGPU.maxChannelsEE,
875  # autoselect the alpaka backend
876  alpaka = cms.untracked.PSet(
877  backend = cms.untracked.string('')
878  )
879  )
880 
881  from EventFilter.EcalRawToDigi.ecalElectronicsMappingHostESProducer_cfi import ecalElectronicsMappingHostESProducer as _ecalElectronicsMappingHostESProducer
882  process.ecalElectronicsMappingHostESProducer = _ecalElectronicsMappingHostESProducer.clone()
883 
884  process.hltEcalDigis = cms.EDProducer("EcalDigisFromPortableProducer",
885  digisInLabelEB = cms.InputTag('hltEcalDigisPortableSoA', 'ebDigis'),
886  digisInLabelEE = cms.InputTag('hltEcalDigisPortableSoA', 'eeDigis'),
887  digisOutLabelEB = cms.string("ebDigis"),
888  digisOutLabelEE = cms.string("eeDigis"),
889  produceDummyIntegrityCollections = cms.bool(False)
890  )
891 
892  process.hltEcalUncalibRecHitPortableSoA = cms.EDProducer("EcalUncalibRecHitProducerPortable@alpaka",
893  EBtimeConstantTerm = process.hltEcalUncalibRecHitGPU.EBtimeConstantTerm,
894  EBtimeFitLimits_Lower = process.hltEcalUncalibRecHitGPU.EBtimeFitLimits_Lower,
895  EBtimeFitLimits_Upper = process.hltEcalUncalibRecHitGPU.EBtimeFitLimits_Upper,
896  EBtimeNconst = process.hltEcalUncalibRecHitGPU.EBtimeNconst,
897  EEtimeConstantTerm = process.hltEcalUncalibRecHitGPU.EEtimeConstantTerm,
898  EEtimeFitLimits_Lower = process.hltEcalUncalibRecHitGPU.EEtimeFitLimits_Lower,
899  EEtimeFitLimits_Upper = process.hltEcalUncalibRecHitGPU.EEtimeFitLimits_Upper,
900  EEtimeNconst = process.hltEcalUncalibRecHitGPU.EEtimeNconst,
901  amplitudeThresholdEB = process.hltEcalUncalibRecHitGPU.amplitudeThresholdEB,
902  amplitudeThresholdEE = process.hltEcalUncalibRecHitGPU.amplitudeThresholdEE,
903  digisLabelEB = cms.InputTag("hltEcalDigisPortableSoA", "ebDigis"),
904  digisLabelEE = cms.InputTag("hltEcalDigisPortableSoA", "eeDigis"),
905  kernelMinimizeThreads = process.hltEcalUncalibRecHitGPU.kernelMinimizeThreads,
906  outOfTimeThresholdGain12mEB = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain12mEB,
907  outOfTimeThresholdGain12mEE = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain12mEE,
908  outOfTimeThresholdGain12pEB = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain12pEB,
909  outOfTimeThresholdGain12pEE = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain12pEE,
910  outOfTimeThresholdGain61mEB = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain61mEB,
911  outOfTimeThresholdGain61mEE = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain61mEE,
912  outOfTimeThresholdGain61pEB = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain61pEB,
913  outOfTimeThresholdGain61pEE = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain61pEE,
914  recHitsLabelEB = process.hltEcalUncalibRecHitGPU.recHitsLabelEB,
915  recHitsLabelEE = process.hltEcalUncalibRecHitGPU.recHitsLabelEE,
916  shouldRunTimingComputation = process.hltEcalUncalibRecHitGPU.shouldRunTimingComputation,
917  # autoselect the alpaka backend
918  alpaka = cms.untracked.PSet(
919  backend = cms.untracked.string('')
920  )
921  )
922 
923  if hasattr(process, 'hltEcalUncalibRecHitGPU'):
924  del process.hltEcalUncalibRecHitGPU
925 
926  process.ecalMultifitParametersSource = cms.ESSource("EmptyESSource",
927  firstValid = cms.vuint32(1),
928  iovIsRunNotTime = cms.bool(True),
929  recordName = cms.string('EcalMultifitParametersRcd')
930  )
931 
932  from RecoLocalCalo.EcalRecProducers.ecalMultifitConditionsHostESProducer_cfi import ecalMultifitConditionsHostESProducer as _ecalMultifitConditionsHostESProducer
933  process.ecalMultifitConditionsHostESProducer = _ecalMultifitConditionsHostESProducer.clone()
934 
935  from RecoLocalCalo.EcalRecProducers.ecalMultifitParametersHostESProducer_cfi import ecalMultifitParametersHostESProducer as _ecalMultifitParametersHostESProducer
936  process.ecalMultifitParametersHostESProducer = _ecalMultifitParametersHostESProducer.clone()
937 
938  process.hltEcalUncalibRecHit = cms.EDProducer("EcalUncalibRecHitSoAToLegacy",
939  isPhase2 = process.hltEcalUncalibRecHitFromSoA.isPhase2,
940  recHitsLabelCPUEB = process.hltEcalUncalibRecHitFromSoA.recHitsLabelCPUEB,
941  recHitsLabelCPUEE = process.hltEcalUncalibRecHitFromSoA.recHitsLabelCPUEE,
942  uncalibRecHitsPortableEB = cms.InputTag("hltEcalUncalibRecHitPortableSoA", "EcalUncalibRecHitsEB"),
943  uncalibRecHitsPortableEE = cms.InputTag("hltEcalUncalibRecHitPortableSoA", "EcalUncalibRecHitsEE")
944  )
945 
946  if hasattr(process, 'hltEcalUncalibRecHitSoA'):
947  delattr(process, 'hltEcalUncalibRecHitSoA')
948 
949  process.hltEcalDetIdToBeRecovered = cms.EDProducer("EcalDetIdToBeRecoveredProducer",
950  integrityBlockSizeErrors = cms.InputTag('hltEcalDigisLegacy', 'EcalIntegrityBlockSizeErrors'),
951  integrityTTIdErrors = cms.InputTag('hltEcalDigisLegacy', 'EcalIntegrityTTIdErrors'),
952 
953  ebIntegrityGainErrors = cms.InputTag('hltEcalDigisLegacy', 'EcalIntegrityGainErrors'),
954  eeIntegrityGainErrors = cms.InputTag('hltEcalDigisLegacy', 'EcalIntegrityGainErrors'),
955 
956  ebIntegrityGainSwitchErrors = cms.InputTag('hltEcalDigisLegacy', 'EcalIntegrityGainSwitchErrors'),
957  eeIntegrityGainSwitchErrors = cms.InputTag('hltEcalDigisLegacy', 'EcalIntegrityGainSwitchErrors'),
958 
959  ebIntegrityChIdErrors = cms.InputTag('hltEcalDigisLegacy', 'EcalIntegrityChIdErrors'),
960  eeIntegrityChIdErrors = cms.InputTag('hltEcalDigisLegacy', 'EcalIntegrityChIdErrors'),
961 
962  ebSrFlagCollection = cms.InputTag("hltEcalDigisLegacy"),
963  eeSrFlagCollection = cms.InputTag("hltEcalDigisLegacy"),
964 
965  ebDetIdToBeRecovered = cms.string("ebDetId"),
966  eeDetIdToBeRecovered = cms.string("eeDetId"),
967 
968  ebFEToBeRecovered = cms.string("ebFE"),
969  eeFEToBeRecovered = cms.string("eeFE"),
970  )
971 
972  process.hltEcalRecHit.triggerPrimitiveDigiCollection = 'hltEcalDigisLegacy:EcalTriggerPrimitives'
973 
974  process.HLTDoFullUnpackingEgammaEcalWithoutPreshowerSequence = cms.Sequence(
975  process.hltEcalDigisLegacy +
976  process.hltEcalDigisPortableSoA +
977  process.hltEcalDigis + # conversion of PortableSoA to legacy format
978  process.hltEcalUncalibRecHitPortableSoA +
979  process.hltEcalUncalibRecHit + # conversion of PortableSoA to legacy format
980  process.hltEcalDetIdToBeRecovered +
981  process.hltEcalRecHit
982  )
983 
984  process.HLTPreshowerSequence = cms.Sequence(process.hltEcalPreshowerDigis + process.hltEcalPreshowerRecHit)
985 
986  process.HLTDoFullUnpackingEgammaEcalSequence = cms.Sequence(
987  process.HLTDoFullUnpackingEgammaEcalWithoutPreshowerSequence +
988  process.HLTPreshowerSequence
989  )
990 
991  process.HLTDoFullUnpackingEgammaEcalMFSequence = cms.Sequence(process.HLTDoFullUnpackingEgammaEcalSequence)
992 
993  process.hltEcalDigisCPUSerialSoA = makeSerialClone(process.hltEcalDigisPortableSoA)
994 
995  process.hltEcalDigisCPUSerial = process.hltEcalDigis.clone(
996  digisInLabelEB = 'hltEcalDigisCPUSerialSoA:ebDigis',
997  digisInLabelEE = 'hltEcalDigisCPUSerialSoA:eeDigis',
998  )
999 
1000  process.hltEcalUncalibRecHitCPUSerialSoA = makeSerialClone(process.hltEcalUncalibRecHitPortableSoA,
1001  digisLabelEB = "hltEcalDigisCPUSerialSoA:ebDigis",
1002  digisLabelEE = "hltEcalDigisCPUSerialSoA:eeDigis",
1003  )
1004 
1005  process.hltEcalUncalibRecHitCPUSerial = process.hltEcalUncalibRecHit.clone(
1006  uncalibRecHitsPortableEB = "hltEcalUncalibRecHitCPUSerialSoA:EcalUncalibRecHitsEB",
1007  uncalibRecHitsPortableEE = "hltEcalUncalibRecHitCPUSerialSoA:EcalUncalibRecHitsEE",
1008  )
1009 
1010  process.hltEcalRecHitCPUOnly = process.hltEcalRecHit.clone(
1011  EBuncalibRecHitCollection = 'hltEcalUncalibRecHitCPUSerial:EcalUncalibRecHitsEB',
1012  EEuncalibRecHitCollection = 'hltEcalUncalibRecHitCPUSerial:EcalUncalibRecHitsEE',
1013  )
1014 
1015  process.HLTDoFullUnpackingEgammaEcalWithoutPreshowerCPUOnlySequence = cms.Sequence(
1016  process.hltEcalDigisLegacy +
1017  process.hltEcalDigisCPUSerialSoA +
1018  process.hltEcalDigisCPUSerial + # conversion of CPUSerialSoA to legacy format
1019  process.hltEcalUncalibRecHitCPUSerialSoA +
1020  process.hltEcalUncalibRecHitCPUSerial + # conversion of CPUSerialSoA to legacy format
1021  process.hltEcalDetIdToBeRecovered +
1022  process.hltEcalRecHitCPUOnly
1023  )
1024 
1025  for prod in producers_by_type(process, 'HLTRechitsToDigis'):
1026  prod.srFlagsIn = 'hltEcalDigisLegacy'
1027 
1028  for prod in producers_by_type(process, 'CorrectedECALPFClusterProducer'):
1029  try:
1030  prod.energyCorrector.ebSrFlagLabel = 'hltEcalDigisLegacy'
1031  prod.energyCorrector.eeSrFlagLabel = 'hltEcalDigisLegacy'
1032  except:
1033  pass
1034 
1035  for pathNameMatch in ['DQM_EcalReconstruction_v', 'DQM_HIEcalReconstruction_v']:
1036  dqmEcalRecoPathName = None
1037  for pathName in process.paths_():
1038  if pathName.startswith(pathNameMatch):
1039  dqmEcalRecoPath = getattr(process, pathName)
1040  dqmEcalRecoPath.insert(dqmEcalRecoPath.index(process.HLTEndSequence), getattr(process, 'HLTDoFullUnpackingEgammaEcalWithoutPreshowerCPUOnlySequence'))
1041  for delmod in ['hltEcalConsumerCPU', 'hltEcalConsumerGPU']:
1042  if hasattr(process, delmod):
1043  process.__delattr__(delmod)
1044 
1045  for hltOutModMatch in ['hltOutputDQMGPUvsCPU', 'hltOutputHIDQMGPUvsCPU']:
1046  if hasattr(process, hltOutModMatch):
1047  outMod = getattr(process, hltOutModMatch)
1048  outCmds_new = [foo for foo in outMod.outputCommands if 'Ecal' not in foo]
1049  outCmds_new += [
1050  'keep *_hltEcalDigis_*_*',
1051  'keep *_hltEcalDigisCPUSerial_*_*',
1052  'keep *_hltEcalUncalibRecHit_*_*',
1053  'keep *_hltEcalUncalibRecHitCPUSerial_*_*',
1054  ]
1055  outMod.outputCommands = outCmds_new[:]
1056 
1057  return process
1058 
1059 
1061 
1062  if not hasattr(process, 'statusOnGPU'):
1063  return process
1064 
1065  process.hltBackend = cms.EDProducer('AlpakaBackendProducer@alpaka')
1066 
1067  insert_modules_before(process, process.statusOnGPU, process.hltBackend)
1068 
1069  del process.statusOnGPU
1070 
1071  process.hltStatusOnGPUFilter = cms.EDFilter('AlpakaBackendFilter',
1072  producer = cms.InputTag('hltBackend', 'backend'),
1073  backends = cms.vstring('CudaAsync', 'ROCmAsync')
1074  )
1075 
1076  insert_modules_before(process, process.statusOnGPUFilter, process.hltStatusOnGPUFilter)
1077  insert_modules_before(process, ~process.statusOnGPUFilter, ~process.hltStatusOnGPUFilter)
1078 
1079  del process.statusOnGPUFilter
1080 
1081  return process
1082 
1083 
1085  process.load('Configuration.StandardSequences.Accelerators_cff')
1086 
1087  process = customizeHLTforAlpakaStatus(process)
1088  process = customizeHLTforAlpakaPixelReco(process)
1089  process = customizeHLTforAlpakaEcalLocalReco(process)
1091 
1092  return process
def customizeHLTforDQMGPUvsCPUPixel(process)
Pixel HLT in Alpaka.
def producers_by_type(process, types)
def customizeHLTforAlpakaPixelRecoVertexing(process)
def makeSerialClone(module, kwargs)
Definition: functions.py:1
def insert_modules_before(process, target, modules)
Definition: common.py:34
def customizeHLTforAlpakaPixelRecoTracking(process)
def customizeHLTforAlpakaStatus(process)
def customizeHLTforAlpakaPixelRecoLocal(process)
def customizeHLTforAlpakaPixelReco(process)
def customizeHLTforAlpakaEcalLocalReco(process)
ECAL HLT in Alpaka.
def customizeHLTforAlpakaParticleFlowClustering(process)
PF HLT in Alpaka.