CMS 3D CMS Logo

customizeHLTforAlpaka.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
3 
4 
6  '''Customization to introduce Particle Flow Reconstruction in Alpaka
7  '''
8  process.hltPFRecHitHCALParamsRecordSource = cms.ESSource('EmptyESSource',
9  recordName = cms.string('PFRecHitHCALParamsRecord'),
10  iovIsRunNotTime = cms.bool(True),
11  firstValid = cms.vuint32(1)
12  )
13 
14  process.hltPFRecHitHCALTopologyRecordSource = cms.ESSource('EmptyESSource',
15  recordName = cms.string('PFRecHitHCALTopologyRecord'),
16  iovIsRunNotTime = cms.bool(True),
17  firstValid = cms.vuint32(1)
18  )
19 
20  process.hltPFClusterParamsRecordSource = cms.ESSource('EmptyESSource',
21  recordName = cms.string('JobConfigurationGPURecord'),
22  iovIsRunNotTime = cms.bool(True),
23  firstValid = cms.vuint32(1)
24  )
25 
26  process.hltHBHERecHitToSoA = cms.EDProducer("HCALRecHitSoAProducer@alpaka",
27  src = cms.InputTag("hltHbhereco"),
28  synchronise = cms.untracked.bool(False)
29  )
30 
31  process.hltPFRecHitHCALTopologyESProducer = cms.ESProducer('PFRecHitHCALTopologyESProducer@alpaka',
32  usePFThresholdsFromDB = cms.bool(True),
33  appendToDataLabel = cms.string(''),
34  )
35 
36 
37  process.hltPFRecHitHCALParamsESProducer = cms.ESProducer('PFRecHitHCALParamsESProducer@alpaka',
38  energyThresholdsHB = cms.vdouble(
39  0.1,
40  0.2,
41  0.3,
42  0.3
43  ),
44  energyThresholdsHE = cms.vdouble(
45  0.1,
46  0.2,
47  0.2,
48  0.2,
49  0.2,
50  0.2,
51  0.2
52  ),
53  appendToDataLabel = cms.string(''),
54  )
55 
56  process.hltPFRecHitSoAProducerHCAL = cms.EDProducer("PFRecHitSoAProducerHCAL@alpaka",
57  producers = cms.VPSet(
58  cms.PSet(
59  src = cms.InputTag("hltHBHERecHitToSoA"),
60  params = cms.ESInputTag("hltPFRecHitHCALParamsESProducer:"),
61  )
62  ),
63  topology = cms.ESInputTag("hltPFRecHitHCALTopologyESProducer:"),
64  synchronise = cms.untracked.bool(False)
65  )
66 
67  process.hltPFRecHitSoAProducerHCALCPUSerial = makeSerialClone(process.hltPFRecHitSoAProducerHCAL)
68 
69  process.hltLegacyPFRecHitProducer = cms.EDProducer("LegacyPFRecHitProducer",
70  src = cms.InputTag("hltPFRecHitSoAProducerHCAL")
71  )
72 
73  process.hltPFClusterParamsESProducer = cms.ESProducer("PFClusterParamsESProducer@alpaka",
74  seedFinder = cms.PSet(
75  nNeighbours = cms.int32(4),
76  thresholdsByDetector = cms.VPSet(
77  cms.PSet(
78  detector = cms.string('HCAL_BARREL1'),
79  seedingThreshold = cms.vdouble(
80  0.125,
81  0.25,
82  0.35,
83  0.35
84  ),
85  seedingThresholdPt = cms.double(0)
86  ),
87  cms.PSet(
88  detector = cms.string('HCAL_ENDCAP'),
89  seedingThreshold = cms.vdouble(
90  0.1375,
91  0.275,
92  0.275,
93  0.275,
94  0.275,
95  0.275,
96  0.275
97  ),
98  seedingThresholdPt = cms.double(0)
99  )
100  )
101  ),
102  initialClusteringStep = cms.PSet(
103  thresholdsByDetector = cms.VPSet(
104  cms.PSet(
105  detector = cms.string('HCAL_BARREL1'),
106  gatheringThreshold = cms.vdouble(
107  0.1,
108  0.2,
109  0.3,
110  0.3
111  )
112  ),
113  cms.PSet(
114  detector = cms.string('HCAL_ENDCAP'),
115  gatheringThreshold = cms.vdouble(
116  0.1,
117  0.2,
118  0.2,
119  0.2,
120  0.2,
121  0.2,
122  0.2
123  )
124  )
125  )
126  ),
127  pfClusterBuilder = cms.PSet(
128  maxIterations = cms.uint32(5),
129  minFracTot = cms.double(1e-20),
130  minFractionToKeep = cms.double(1e-07),
131  excludeOtherSeeds = cms.bool(True),
132  showerSigma = cms.double(10),
133  stoppingTolerance = cms.double(1e-08),
134  recHitEnergyNorms = cms.VPSet(
135  cms.PSet(
136  detector = cms.string('HCAL_BARREL1'),
137  recHitEnergyNorm = cms.vdouble(
138  0.1,
139  0.2,
140  0.3,
141  0.3
142  )
143  ),
144  cms.PSet(
145  detector = cms.string('HCAL_ENDCAP'),
146  recHitEnergyNorm = cms.vdouble(
147  0.1,
148  0.2,
149  0.2,
150  0.2,
151  0.2,
152  0.2,
153  0.2
154  )
155  )
156  ),
157  positionCalc = cms.PSet(
158  minFractionInCalc = cms.double(1e-09),
159  minAllowedNormalization = cms.double(1e-09)
160  ),
161  timeResolutionCalcBarrel = cms.PSet(
162  corrTermLowE = cms.double(0),
163  threshLowE = cms.double(6),
164  noiseTerm = cms.double(21.86),
165  constantTermLowE = cms.double(4.24),
166  noiseTermLowE = cms.double(8),
167  threshHighE = cms.double(15),
168  constantTerm = cms.double(2.82)
169  ),
170  timeResolutionCalcEndcap = cms.PSet(
171  corrTermLowE = cms.double(0),
172  threshLowE = cms.double(6),
173  noiseTerm = cms.double(21.86),
174  constantTermLowE = cms.double(4.24),
175  noiseTermLowE = cms.double(8),
176  threshHighE = cms.double(15),
177  constantTerm = cms.double(2.82)
178  )
179  ),
180  )
181 
182  process.hltPFClusterSoAProducer = cms.EDProducer("PFClusterSoAProducer@alpaka",
183  pfRecHits = cms.InputTag("hltPFRecHitSoAProducerHCAL"),
184  topology = cms.ESInputTag("hltPFRecHitHCALTopologyESProducer:"),
185  pfClusterParams = cms.ESInputTag("hltPFClusterParamsESProducer:"),
186  synchronise = cms.bool(False)
187  )
188 
189  process.hltPFClusterSoAProducerCPUSerial = makeSerialClone(process.hltPFClusterSoAProducer,
190  pfRecHits = cms.InputTag("hltPFRecHitSoAProducerHCALCPUSerial"),
191  )
192 
193 
194  if(not hasattr(process,'hltParticleFlowClusterHBHE')):
195  return process
196 
197  process.hltLegacyPFClusterProducer = cms.EDProducer("LegacyPFClusterProducer",
198  src = cms.InputTag("hltPFClusterSoAProducer"),
199  pfClusterBuilder = process.hltParticleFlowClusterHBHE.pfClusterBuilder,
200  usePFThresholdsFromDB = cms.bool(True),
201  recHitsSource = cms.InputTag("hltLegacyPFRecHitProducer"),
202  PFRecHitsLabelIn = cms.InputTag("hltPFRecHitSoAProducerHCAL")
203  )
204 
205 
206  #Same as default except change the clusterSource
207  process.hltParticleFlowClusterHCAL = cms.EDProducer("PFMultiDepthClusterProducer",
208  clustersSource = cms.InputTag("hltLegacyPFClusterProducer"),
209  usePFThresholdsFromDB = cms.bool(True),
210  energyCorrector = process.hltParticleFlowClusterHCAL.energyCorrector,
211  pfClusterBuilder = process.hltParticleFlowClusterHCAL.pfClusterBuilder,
212  positionReCalc = process.hltParticleFlowClusterHCAL.positionReCalc
213  )
214 
215  #Define the task (I assume the name has to be the same as the default task)
216  process.HLTPFHcalRecHits = cms.Sequence(
217  process.hltHBHERecHitToSoA+
218  process.hltPFRecHitSoAProducerHCAL+
219  process.hltLegacyPFRecHitProducer
220  )
221 
222  process.HLTPFHcalClustering = cms.Sequence(
223  process.HLTPFHcalRecHits+
224  process.hltPFClusterSoAProducer+
225  process.hltLegacyPFClusterProducer+
226  process.hltParticleFlowClusterHCAL
227  )
228 
229 
230  #Some Sequences contain all the modules of process.HLTPFHcalClustering Sequence instead of the Sequence itself
231  #find these Sequences and replace all the modules with the Sequence
232  def replaceItemsInSequence(process, itemsToReplace, replacingSequence):
233  for sequence, items in process.sequences.items():
234  #Find Sequences containing all the items in itemsToReplace
235  containsAll = all(items.contains(item) for item in itemsToReplace)
236  if(containsAll):
237  for item in itemsToReplace:
238  #remove items that will be replaced by replacingSequence
239  if(item != itemsToReplace[-1]):
240  items.remove(item)
241  else:
242  #if last item, replace it with the Sequence
243  items.replace(item, replacingSequence)
244  return process
245 
246  itemsList = [process.hltParticleFlowRecHitHBHE, process.hltParticleFlowClusterHBHE,process.hltParticleFlowClusterHCAL]
247  process = replaceItemsInSequence(process, itemsList, process.HLTPFHcalClustering)
248 
249  process.HLTPFClusterHBHECPUSerial = cms.Sequence(process.hltHBHERecHitToSoA+process.hltPFRecHitSoAProducerHCALCPUSerial+process.hltPFClusterSoAProducerCPUSerial)
250 
251  # modify EventContent of DQMGPUvsCPU stream
252  if hasattr(process, 'hltOutputDQMGPUvsCPU'):
253  process.hltOutputDQMGPUvsCPU.outputCommands.extend([
254  'keep *_hltPFClusterSoAProducer_*_*',
255  'keep *_hltPFClusterSoAProducerCPUSerial_*_*',
256  ])
257 
258  # Add CPUSerial sequences to DQM_HcalReconstruction_v Path
259  dqmHcalRecoPathName = None
260  for pathName in process.paths_():
261  if pathName.startswith('DQM_HcalReconstruction_v'):
262  dqmHcalRecoPathName = pathName
263  break
264 
265  if dqmHcalRecoPathName == None:
266  return process
267 
268  dqmHcalPath = getattr(process, dqmHcalRecoPathName)
269  dqmHcalRecoPathIndex = dqmHcalPath.index(process.hltHcalConsumerGPU) + 1
270  dqmHcalPath.insert(dqmHcalRecoPathIndex , process.HLTPFClusterHBHECPUSerial)
271 
272  return process
273 
274 
276  '''Ad-hoc changes to test HLT config containing only DQM_PixelReconstruction_v and DQMGPUvsCPU stream
277  only up to the Pixel Local Reconstruction
278  '''
279  dqmPixelRecoPathName = None
280  for pathName in process.paths_():
281  if pathName.startswith('DQM_PixelReconstruction_v'):
282  dqmPixelRecoPathName = pathName
283  break
284 
285  if dqmPixelRecoPathName == None:
286  return process
287 
288  process.hltPixelConsumerGPU.eventProducts = [
289  'hltSiPixelClusters',
290  'hltSiPixelClustersSoA',
291  'hltSiPixelDigis',
292  'hltSiPixelRecHits',
293  'hltSiPixelRecHitsSoA',
294  'hltPixelTracks',
295  'hltPixelTracksSoA',
296  'hltPixelVertices',
297  'hltPixelVerticesSoA',
298  ]
299 
300  process.hltPixelConsumerCPU.eventProducts = []
301  for foo in process.hltPixelConsumerGPU.eventProducts:
302  process.hltPixelConsumerCPU.eventProducts += [foo+'CPUSerial']
303 
304  # modify EventContent of DQMGPUvsCPU stream
305  if hasattr(process, 'hltOutputDQMGPUvsCPU'):
306  process.hltOutputDQMGPUvsCPU.outputCommands = [
307  'drop *',
308  'keep *Cluster*_hltSiPixelClusters_*_*',
309  'keep *Cluster*_hltSiPixelClustersLegacyFormatCPUSerial_*_*',
310  'keep *_hltSiPixelDigis_*_*',
311  'keep *_hltSiPixelDigiErrorsLegacyFormatCPUSerial_*_*',
312  'keep *RecHit*_hltSiPixelRecHits_*_*',
313  'keep *RecHit*_hltSiPixelRecHitsLegacyFormatCPUSerial_*_*',
314  'keep *_hltPixelTracks_*_*',
315  'keep *_hltPixelTracksLegacyFormatCPUSerial_*_*',
316  'keep *_hltPixelVertices_*_*',
317  'keep *_hltPixelVerticesLegacyFormatCPUSerial_*_*',
318  ]
319 
320  # PixelRecHits: monitor of CPUSerial product (Alpaka backend: 'serial_sync')
321  process.hltPixelRecHitsSoAMonitorCPU = cms.EDProducer('SiPixelPhase1MonitorRecHitsSoAAlpaka',
322  pixelHitsSrc = cms.InputTag( 'hltSiPixelRecHitsCPUSerial' ),
323  TopFolderName = cms.string( 'SiPixelHeterogeneous/PixelRecHitsCPU' )
324  )
325 
326  # PixelRecHits: monitor of GPU product (Alpaka backend: '')
327  process.hltPixelRecHitsSoAMonitorGPU = cms.EDProducer('SiPixelPhase1MonitorRecHitsSoAAlpaka',
328  pixelHitsSrc = cms.InputTag( 'hltSiPixelRecHitsSoA' ),
329  TopFolderName = cms.string( 'SiPixelHeterogeneous/PixelRecHitsGPU' )
330  )
331 
332  # PixelRecHits: 'GPUvsCPU' comparisons
333  process.hltPixelRecHitsSoACompareGPUvsCPU = cms.EDProducer('SiPixelPhase1CompareRecHitsSoAAlpaka',
334  pixelHitsSrcHost = cms.InputTag( 'hltSiPixelRecHitsCPUSerial' ),
335  pixelHitsSrcDevice = cms.InputTag( 'hltSiPixelRecHitsSoA' ),
336  topFolderName = cms.string( 'SiPixelHeterogeneous/PixelRecHitsCompareGPUvsCPU' ),
337  minD2cut = cms.double( 1.0E-4 )
338  )
339 
340  process.hltPixelTracksSoAMonitorCPU = cms.EDProducer("SiPixelPhase1MonitorTrackSoAAlpaka",
341  mightGet = cms.optional.untracked.vstring,
342  minQuality = cms.string('loose'),
343  pixelTrackSrc = cms.InputTag('hltPixelTracksCPUSerial'),
344  topFolderName = cms.string('SiPixelHeterogeneous/PixelTrackCPU'),
345  useQualityCut = cms.bool(True)
346  )
347 
348  process.hltPixelTracksSoAMonitorGPU = cms.EDProducer("SiPixelPhase1MonitorTrackSoAAlpaka",
349  mightGet = cms.optional.untracked.vstring,
350  minQuality = cms.string('loose'),
351  pixelTrackSrc = cms.InputTag('hltPixelTracksSoA'),
352  topFolderName = cms.string('SiPixelHeterogeneous/PixelTrackGPU'),
353  useQualityCut = cms.bool(True)
354  )
355 
356  process.hltPixelTracksSoACompareGPUvsCPU = cms.EDProducer("SiPixelPhase1CompareTrackSoAAlpaka",
357  deltaR2cut = cms.double(0.04),
358  mightGet = cms.optional.untracked.vstring,
359  minQuality = cms.string('loose'),
360  pixelTrackSrcHost = cms.InputTag("hltPixelTracksCPUSerial"),
361  pixelTrackSrcDevice = cms.InputTag("hltPixelTracksSoA"),
362  topFolderName = cms.string('SiPixelHeterogeneous/PixelTrackCompareGPUvsCPU'),
363  useQualityCut = cms.bool(True)
364  )
365 
366  process.hltPixelVertexSoAMonitorCPU = cms.EDProducer("SiPixelMonitorVertexSoAAlpaka",
367  beamSpotSrc = cms.InputTag("hltOnlineBeamSpot"),
368  mightGet = cms.optional.untracked.vstring,
369  pixelVertexSrc = cms.InputTag("hltPixelVerticesCPUSerial"),
370  topFolderName = cms.string('SiPixelHeterogeneous/PixelVertexCPU')
371  )
372 
373  process.hltPixelVertexSoAMonitorGPU = cms.EDProducer("SiPixelMonitorVertexSoAAlpaka",
374  beamSpotSrc = cms.InputTag("hltOnlineBeamSpot"),
375  mightGet = cms.optional.untracked.vstring,
376  pixelVertexSrc = cms.InputTag("hltPixelVerticesSoA"),
377  topFolderName = cms.string('SiPixelHeterogeneous/PixelVertexGPU')
378  )
379 
380  process.hltPixelVertexSoACompareGPUvsCPU = cms.EDProducer("SiPixelCompareVertexSoAAlpaka",
381  beamSpotSrc = cms.InputTag("hltOnlineBeamSpot"),
382  dzCut = cms.double(1),
383  mightGet = cms.optional.untracked.vstring,
384  pixelVertexSrcHost = cms.InputTag("hltPixelVerticesCPUSerial"),
385  pixelVertexSrcDevice = cms.InputTag("hltPixelVerticesSoA"),
386  topFolderName = cms.string('SiPixelHeterogeneous/PixelVertexCompareGPUvsCPU')
387  )
388 
389  process.HLTDQMPixelReconstruction = cms.Sequence(
390  process.hltPixelRecHitsSoAMonitorCPU
391  + process.hltPixelRecHitsSoAMonitorGPU
392  + process.hltPixelRecHitsSoACompareGPUvsCPU
393  + process.hltPixelTracksSoAMonitorCPU
394  + process.hltPixelTracksSoAMonitorGPU
395  + process.hltPixelTracksSoACompareGPUvsCPU
396  + process.hltPixelVertexSoAMonitorCPU
397  + process.hltPixelVertexSoAMonitorGPU
398  + process.hltPixelVertexSoACompareGPUvsCPU
399  )
400 
401  # Add CPUSerial sequences to DQM_PixelReconstruction_v Path
402  dqmPixelRecoPath = getattr(process, dqmPixelRecoPathName)
403  try:
404  dqmPixelRecoPathIndex = dqmPixelRecoPath.index(process.HLTRecopixelvertexingSequence) + 1
405  for cpuSeqName in [
406  'HLTDoLocalPixelCPUSerialSequence',
407  'HLTRecopixelvertexingCPUSerialSequence',
408  ]:
409  dqmPixelRecoPath.insert(dqmPixelRecoPathIndex, getattr(process, cpuSeqName))
410  dqmPixelRecoPathIndex += 1
411  except:
412  dqmPixelRecoPathIndex = None
413 
414  return process
415 
417  '''Customisation to introduce the Local Pixel Reconstruction in Alpaka
418  '''
419  process.hltESPSiPixelCablingSoA = cms.ESProducer('SiPixelCablingSoAESProducer@alpaka',
420  CablingMapLabel = cms.string(''),
421  UseQualityInfo = cms.bool(False),
422  appendToDataLabel = cms.string(''),
423  alpaka = cms.untracked.PSet(
424  backend = cms.untracked.string('')
425  )
426  )
427 
428  process.hltESPSiPixelGainCalibrationForHLTSoA = cms.ESProducer('SiPixelGainCalibrationForHLTSoAESProducer@alpaka',
429  appendToDataLabel = cms.string(''),
430  alpaka = cms.untracked.PSet(
431  backend = cms.untracked.string('')
432  )
433  )
434 
435  process.hltESPPixelCPEFastParamsPhase1 = cms.ESProducer('PixelCPEFastParamsESProducerAlpakaPhase1@alpaka',
436  appendToDataLabel = cms.string(''),
437  alpaka = cms.untracked.PSet(
438  backend = cms.untracked.string('')
439  )
440  )
441 
442 
443 
444  # alpaka EDProducer
445  # consumes
446  # - reco::BeamSpot
447  # produces
448  # - BeamSpotDevice
449  process.hltOnlineBeamSpotDevice = cms.EDProducer('BeamSpotDeviceProducer@alpaka',
450  src = cms.InputTag('hltOnlineBeamSpot'),
451  alpaka = cms.untracked.PSet(
452  backend = cms.untracked.string('')
453  )
454  )
455 
456  # alpaka EDProducer
457  # consumes
458  # - FEDRawDataCollection
459  # produces (* optional)
460  # - SiPixelClustersSoA
461  # - SiPixelDigisSoACollection
462  # - SiPixelDigiErrorsSoACollection *
463  # - SiPixelFormatterErrors *
464  process.hltSiPixelClustersSoA = cms.EDProducer('SiPixelRawToClusterPhase1@alpaka',
465  mightGet = cms.optional.untracked.vstring,
466  IncludeErrors = cms.bool(True),
467  UseQualityInfo = cms.bool(False),
468  clusterThreshold_layer1 = cms.int32(4000),
469  clusterThreshold_otherLayers = cms.int32(4000),
470  VCaltoElectronGain = cms.double(1), # all gains=1, pedestals=0
471  VCaltoElectronGain_L1 = cms.double(1),
472  VCaltoElectronOffset = cms.double(0),
473  VCaltoElectronOffset_L1 = cms.double(0),
474  InputLabel = cms.InputTag('rawDataCollector'),
475  Regions = cms.PSet(
476  inputs = cms.optional.VInputTag,
477  deltaPhi = cms.optional.vdouble,
478  maxZ = cms.optional.vdouble,
479  beamSpot = cms.optional.InputTag
480  ),
481  CablingMapLabel = cms.string(''),
482  # autoselect the alpaka backend
483  alpaka = cms.untracked.PSet(
484  backend = cms.untracked.string('')
485  )
486  )
487 
488  process.hltSiPixelClusters = cms.EDProducer('SiPixelDigisClustersFromSoAAlpakaPhase1',
489  src = cms.InputTag('hltSiPixelClustersSoA'),
490  clusterThreshold_layer1 = cms.int32(4000),
491  clusterThreshold_otherLayers = cms.int32(4000),
492  produceDigis = cms.bool(False),
493  storeDigis = cms.bool(False)
494  )
495 
496  process.hltSiPixelClustersCache = cms.EDProducer('SiPixelClusterShapeCacheProducer',
497  src = cms.InputTag( 'hltSiPixelClusters' ),
498  onDemand = cms.bool( False )
499  )
500 
501  # legacy EDProducer
502  # consumes
503  # - SiPixelDigiErrorsHost
504  # - SiPixelFormatterErrors
505  # produces
506  # - edm::DetSetVector<SiPixelRawDataError>
507  # - DetIdCollection
508  # - DetIdCollection, 'UserErrorModules'
509  # - edmNew::DetSetVector<PixelFEDChannel>
510  process.hltSiPixelDigis = cms.EDProducer('SiPixelDigiErrorsFromSoAAlpaka',
511  digiErrorSoASrc = cms.InputTag('hltSiPixelClustersSoA'),
512  fmtErrorsSoASrc = cms.InputTag('hltSiPixelClustersSoA'),
513  CablingMapLabel = cms.string(''),
514  UsePhase1 = cms.bool(True),
515  ErrorList = cms.vint32(29),
516  UserErrorList = cms.vint32(40)
517  )
518 
519  # alpaka EDProducer
520  # consumes
521  # - BeamSpotDevice
522  # - SiPixelClustersSoA
523  # - SiPixelDigisSoACollection
524  # produces
525  # - TrackingRecHitsSoACollection<TrackerTraits>
526  process.hltSiPixelRecHitsSoA = cms.EDProducer('SiPixelRecHitAlpakaPhase1@alpaka',
527  beamSpot = cms.InputTag('hltOnlineBeamSpotDevice'),
528  src = cms.InputTag('hltSiPixelClustersSoA'),
529  CPE = cms.string('PixelCPEFastParams'),
530  mightGet = cms.optional.untracked.vstring,
531  # autoselect the alpaka backend
532  alpaka = cms.untracked.PSet(
533  backend = cms.untracked.string('')
534  )
535  )
536 
537  process.hltSiPixelRecHits = cms.EDProducer('SiPixelRecHitFromSoAAlpakaPhase1',
538  pixelRecHitSrc = cms.InputTag('hltSiPixelRecHitsSoA'),
539  src = cms.InputTag('hltSiPixelClusters'),
540  )
541 
542 
545  process.HLTDoLocalPixelTask = cms.ConditionalTask(
546  process.hltOnlineBeamSpotDevice,
547  process.hltSiPixelClustersSoA,
548  process.hltSiPixelClusters, # was: hltSiPixelClusters
549  process.hltSiPixelClustersCache, # really needed ??
550  process.hltSiPixelDigis, # was: hltSiPixelDigis
551  process.hltSiPixelRecHitsSoA,
552  process.hltSiPixelRecHits, # was: hltSiPixelRecHits
553  )
554 
555 
558  process.hltOnlineBeamSpotDeviceCPUSerial = process.hltOnlineBeamSpotDevice.clone(
559  alpaka = dict( backend = 'serial_sync' )
560  )
561 
562  process.hltSiPixelClustersCPUSerial = process.hltSiPixelClustersSoA.clone(
563  alpaka = dict( backend = 'serial_sync' )
564  )
565 
566  process.hltSiPixelClustersLegacyFormatCPUSerial = process.hltSiPixelClusters.clone(
567  src = 'hltSiPixelClustersCPUSerial'
568  )
569 
570  process.hltSiPixelDigiErrorsLegacyFormatCPUSerial = process.hltSiPixelDigis.clone(
571  digiErrorSoASrc = 'hltSiPixelClustersCPUSerial',
572  fmtErrorsSoASrc = 'hltSiPixelClustersCPUSerial',
573  )
574 
575  process.hltSiPixelRecHitsCPUSerial = process.hltSiPixelRecHitsSoA.clone(
576  beamSpot = 'hltOnlineBeamSpotDeviceCPUSerial',
577  src = 'hltSiPixelClustersCPUSerial',
578  alpaka = dict( backend = 'serial_sync' )
579  )
580 
581  process.hltSiPixelRecHitsLegacyFormatCPUSerial = process.hltSiPixelRecHits.clone(
582  pixelRecHitSrc = 'hltSiPixelRecHitsCPUSerial',
583  src = 'hltSiPixelClustersLegacyFormatCPUSerial',
584  )
585 
586  process.HLTDoLocalPixelCPUSerialTask = cms.ConditionalTask(
587  process.hltOnlineBeamSpotDeviceCPUSerial,
588  process.hltSiPixelClustersCPUSerial,
589  process.hltSiPixelClustersLegacyFormatCPUSerial,
590  process.hltSiPixelDigiErrorsLegacyFormatCPUSerial,
591  process.hltSiPixelRecHitsCPUSerial,
592  process.hltSiPixelRecHitsLegacyFormatCPUSerial,
593  )
594 
595  process.HLTDoLocalPixelCPUSerialSequence = cms.Sequence( process.HLTDoLocalPixelCPUSerialTask )
596 
597  return process
598 
600  '''Customisation to introduce the Pixel-Track Reconstruction in Alpaka
601  '''
602 
603  # alpaka EDProducer
604  # consumes
605  # - TrackingRecHitsSoACollection<TrackerTraits>
606  # produces
607  # - TkSoADevice
608  process.hltPixelTracksSoA = cms.EDProducer('CAHitNtupletAlpakaPhase1@alpaka',
609  pixelRecHitSrc = cms.InputTag('hltSiPixelRecHitsSoA'),
610  CPE = cms.string('PixelCPEFastParams'),
611  ptmin = cms.double(0.9),
612  CAThetaCutBarrel = cms.double(0.002),
613  CAThetaCutForward = cms.double(0.003),
614  hardCurvCut = cms.double(0.0328407225),
615  dcaCutInnerTriplet = cms.double(0.15),
616  dcaCutOuterTriplet = cms.double(0.25),
617  earlyFishbone = cms.bool(True),
618  lateFishbone = cms.bool(False),
619  fillStatistics = cms.bool(False),
620  minHitsPerNtuplet = cms.uint32(3),
621  phiCuts = cms.vint32(
622  522, 730, 730, 522, 626,
623  626, 522, 522, 626, 626,
624  626, 522, 522, 522, 522,
625  522, 522, 522, 522
626  ),
627  maxNumberOfDoublets = cms.uint32(524288),
628  minHitsForSharingCut = cms.uint32(10),
629  fitNas4 = cms.bool(False),
630  doClusterCut = cms.bool(True),
631  doZ0Cut = cms.bool(True),
632  doPtCut = cms.bool(True),
633  useRiemannFit = cms.bool(False),
634  doSharedHitCut = cms.bool(True),
635  dupPassThrough = cms.bool(False),
636  useSimpleTripletCleaner = cms.bool(True),
637  idealConditions = cms.bool(False),
638  includeJumpingForwardDoublets = cms.bool(True),
639  trackQualityCuts = cms.PSet(
640  chi2MaxPt = cms.double(10),
641  chi2Coeff = cms.vdouble(0.9, 1.8),
642  chi2Scale = cms.double(8),
643  tripletMinPt = cms.double(0.5),
644  tripletMaxTip = cms.double(0.3),
645  tripletMaxZip = cms.double(12),
646  quadrupletMinPt = cms.double(0.3),
647  quadrupletMaxTip = cms.double(0.5),
648  quadrupletMaxZip = cms.double(12)
649  ),
650  # autoselect the alpaka backend
651  alpaka = cms.untracked.PSet(
652  backend = cms.untracked.string('')
653  )
654  )
655 
656  process.hltPixelTracksCPUSerial = process.hltPixelTracksSoA.clone(
657  pixelRecHitSrc = 'hltSiPixelRecHitsCPUSerial',
658  alpaka = dict( backend = 'serial_sync' )
659  )
660 
661  process.hltPixelTracks = cms.EDProducer("PixelTrackProducerFromSoAAlpakaPhase1",
662  beamSpot = cms.InputTag("hltOnlineBeamSpot"),
663  minNumberOfHits = cms.int32(0),
664  minQuality = cms.string('loose'),
665  pixelRecHitLegacySrc = cms.InputTag("hltSiPixelRecHits"),
666  trackSrc = cms.InputTag("hltPixelTracksSoA")
667  )
668 
669  process.hltPixelTracksLegacyFormatCPUSerial = process.hltPixelTracks.clone(
670  pixelRecHitLegacySrc = cms.InputTag("hltSiPixelRecHitsLegacyFormatCPUSerial"),
671  trackSrc = cms.InputTag("hltPixelTracksCPUSerial")
672  )
673 
674  process.HLTRecoPixelTracksTask = cms.ConditionalTask(
675  process.hltPixelTracksSoA,
676  process.hltPixelTracks,
677  )
678 
679  process.HLTRecoPixelTracksCPUSerialTask = cms.ConditionalTask(
680  process.hltPixelTracksCPUSerial,
681  process.hltPixelTracksLegacyFormatCPUSerial,
682  )
683 
684  process.HLTRecoPixelTracksCPUSerialSequence = cms.Sequence( process.HLTRecoPixelTracksCPUSerialTask )
685 
686  return process
687 
689  '''Customisation to introduce the Pixel-Vertex Reconstruction in Alpaka
690  '''
691 
692  # alpaka EDProducer
693  # consumes
694  # - TkSoADevice
695  # produces
696  # - ZVertexDevice
697  process.hltPixelVerticesSoA = cms.EDProducer('PixelVertexProducerAlpakaPhase1@alpaka',
698  oneKernel = cms.bool(True),
699  useDensity = cms.bool(True),
700  useDBSCAN = cms.bool(False),
701  useIterative = cms.bool(False),
702  minT = cms.int32(2),
703  eps = cms.double(0.07),
704  errmax = cms.double(0.01),
705  chi2max = cms.double(9),
706  PtMin = cms.double(0.5),
707  PtMax = cms.double(75),
708  pixelTrackSrc = cms.InputTag('hltPixelTracksSoA'),
709  # autoselect the alpaka backend
710  alpaka = cms.untracked.PSet(
711  backend = cms.untracked.string('')
712  )
713  )
714 
715  process.hltPixelVerticesCPUSerial = process.hltPixelVerticesSoA.clone(
716  pixelTrackSrc = 'hltPixelTracksCPUSerial',
717  alpaka = dict( backend = 'serial_sync' )
718  )
719 
720  process.hltPixelVertices = cms.EDProducer("PixelVertexProducerFromSoAAlpaka",
721  TrackCollection = cms.InputTag("hltPixelTracks"),
722  beamSpot = cms.InputTag("hltOnlineBeamSpot"),
723  src = cms.InputTag("hltPixelVerticesSoA")
724  )
725 
726  process.hltPixelVerticesLegacyFormatCPUSerial = process.hltPixelVertices.clone(
727  TrackCollection = cms.InputTag("hltPixelTracksLegacyFormatCPUSerial"),
728  src = cms.InputTag("hltPixelVerticesCPUSerial")
729  )
730 
731 
732  if(not hasattr(process,'hltTrimmedPixelVertices')):
733  return process
734 
735  process.HLTRecopixelvertexingTask = cms.ConditionalTask(
736  process.HLTRecoPixelTracksTask,
737  process.hltPixelVerticesSoA,
738  process.hltPixelVertices,
739  process.hltTrimmedPixelVertices
740  )
741 
742  process.HLTRecopixelvertexingCPUSerialTask = cms.ConditionalTask(
743  process.HLTRecoPixelTracksCPUSerialTask,
744  process.hltPixelVerticesCPUSerial,
745  process.hltPixelVerticesLegacyFormatCPUSerial,
746  )
747 
748  process.HLTRecopixelvertexingCPUSerialSequence = cms.Sequence( process.HLTRecopixelvertexingCPUSerialTask )
749 
750  return process
751 
753  '''Customize HLT path depending on old SoA tracks
754  '''
755  process.hltL2TauTagNNProducer = cms.EDProducer("L2TauNNProducerAlpaka",
756  BeamSpot = cms.InputTag("hltOnlineBeamSpot"),
757  L1Taus = cms.VPSet(
758  cms.PSet(
759  L1CollectionName = cms.string('DoubleTau'),
760  L1TauTrigger = cms.InputTag("hltL1sDoubleTauBigOR")
761  ),
762  cms.PSet(
763  L1CollectionName = cms.string('SingleTau'),
764  L1TauTrigger = cms.InputTag("hltL1sSingleTau")
765  ),
766  cms.PSet(
767  L1CollectionName = cms.string('MuXXTauYY'),
768  L1TauTrigger = cms.InputTag("hltL1sBigOrMuXXerIsoTauYYer")
769  ),
770  cms.PSet(
771  L1CollectionName = cms.string('Mu22Tau40'),
772  L1TauTrigger = cms.InputTag("hltL1sMu22erIsoTau40er")
773  ),
774  cms.PSet(
775  L1CollectionName = cms.string('DoubleTauJet'),
776  L1TauTrigger = cms.InputTag("hltL1sBigORDoubleTauJet")
777  ),
778  cms.PSet(
779  L1CollectionName = cms.string('VBFIsoTau'),
780  L1TauTrigger = cms.InputTag("hltL1VBFDiJetIsoTau")
781  ),
782  cms.PSet(
783  L1CollectionName = cms.string('Mu18TauXX'),
784  L1TauTrigger = cms.InputTag("hltL1sVeryBigORMu18erTauXXer2p1")
785  ),
786  cms.PSet(
787  L1CollectionName = cms.string('DoubleTauLowMass'),
788  L1TauTrigger = cms.InputTag("hltL1sDoubleTauBigORWithLowMass")
789  )
790  ),
791  debugLevel = cms.int32(0),
792  ebInput = cms.InputTag("hltEcalRecHit","EcalRecHitsEB"),
793  eeInput = cms.InputTag("hltEcalRecHit","EcalRecHitsEE"),
794  fractionSumPt2 = cms.double(0.3),
795  graphPath = cms.string('RecoTauTag/TrainingFiles/data/L2TauNNTag/L2TauTag_Run3v1.pb'),
796  hbheInput = cms.InputTag("hltHbhereco"),
797  hoInput = cms.InputTag("hltHoreco"),
798  maxVtx = cms.uint32(100),
799  minSumPt2 = cms.double(0.0),
800  normalizationDict = cms.string('RecoTauTag/TrainingFiles/data/L2TauNNTag/NormalizationDict.json'),
801  pataTracks = cms.InputTag("hltPixelTracksSoA"),
802  pataVertices = cms.InputTag("hltPixelVerticesSoA"),
803  track_chi2_max = cms.double(99999.0),
804  track_pt_max = cms.double(10.0),
805  track_pt_min = cms.double(1.0)
806  )
807 
808  return process
809 
811  '''Customisation to introduce the Pixel Local+Track+Vertex Reconstruction in Alpaka
812  '''
813 
814  process = customizeHLTforAlpakaPixelRecoLocal(process)
815  process = customizeHLTforAlpakaPixelRecoTracking(process)
816  process = customizeHLTforAlpakaPixelRecoVertexing(process)
817  process = customizeHLTforDQMGPUvsCPUPixel(process)
818  process = customizeHLTforAlpakaPixelRecoTheRest(process)
819 
820  return process
821 
822 
823 
825 
826  if hasattr(process, 'hltEcalDigisGPU'):
827  process.hltEcalDigisPortable = cms.EDProducer("EcalRawToDigiPortable@alpaka",
828  FEDs = process.hltEcalDigisGPU.FEDs,
829  InputLabel = process.hltEcalDigisGPU.InputLabel,
830  alpaka = cms.untracked.PSet(
831  backend = cms.untracked.string('')
832  ),
833  digisLabelEB = process.hltEcalDigisGPU.digisLabelEB,
834  digisLabelEE = process.hltEcalDigisGPU.digisLabelEE,
835  maxChannelsEB = process.hltEcalDigisGPU.maxChannelsEB,
836  maxChannelsEE = process.hltEcalDigisGPU.maxChannelsEE,
837  mightGet = cms.optional.untracked.vstring
838  )
839  process.HLTDoFullUnpackingEgammaEcalWithoutPreshowerTask.add(process.hltEcalDigisPortable)
840 
841  process.load("EventFilter.EcalRawToDigi.ecalElectronicsMappingHostESProducer_cfi")
842  process.HLTDoFullUnpackingEgammaEcalWithoutPreshowerTask.add(process.ecalElectronicsMappingHostESProducer)
843 
844  delattr(process, 'hltEcalDigisGPU')
845  delattr(process, 'ecalElectronicsMappingGPUESProducer')
846 
847  if hasattr(process, 'hltEcalDigisFromGPU'):
848  process.hltEcalDigisFromGPU = cms.EDProducer( "EcalDigisFromPortableProducer",
849  digisInLabelEB = cms.InputTag( 'hltEcalDigisPortable','ebDigis' ),
850  digisInLabelEE = cms.InputTag( 'hltEcalDigisPortable','eeDigis' ),
851  digisOutLabelEB = cms.string( "ebDigis" ),
852  digisOutLabelEE = cms.string( "eeDigis" ),
853  produceDummyIntegrityCollections = cms.bool( False )
854  )
855 
856  if hasattr(process, 'hltEcalUncalibRecHitGPU'):
857  process.hltEcalUncalibRecHitPortable = cms.EDProducer("EcalUncalibRecHitProducerPortable@alpaka",
858  EBtimeConstantTerm = process.hltEcalUncalibRecHitGPU.EBtimeConstantTerm,
859  EBtimeFitLimits_Lower = process.hltEcalUncalibRecHitGPU.EBtimeFitLimits_Lower,
860  EBtimeFitLimits_Upper = process.hltEcalUncalibRecHitGPU.EBtimeFitLimits_Upper,
861  EBtimeNconst = process.hltEcalUncalibRecHitGPU.EBtimeNconst,
862  EEtimeConstantTerm = process.hltEcalUncalibRecHitGPU.EEtimeConstantTerm,
863  EEtimeFitLimits_Lower = process.hltEcalUncalibRecHitGPU.EEtimeFitLimits_Lower,
864  EEtimeFitLimits_Upper = process.hltEcalUncalibRecHitGPU.EEtimeFitLimits_Upper,
865  EEtimeNconst = process.hltEcalUncalibRecHitGPU.EEtimeNconst,
866  alpaka = cms.untracked.PSet(
867  backend = cms.untracked.string('')
868  ),
869  amplitudeThresholdEB = process.hltEcalUncalibRecHitGPU.amplitudeThresholdEB,
870  amplitudeThresholdEE = process.hltEcalUncalibRecHitGPU.amplitudeThresholdEE,
871  digisLabelEB = cms.InputTag("hltEcalDigisPortable","ebDigis"),
872  digisLabelEE = cms.InputTag("hltEcalDigisPortable","eeDigis"),
873  kernelMinimizeThreads = process.hltEcalUncalibRecHitGPU.kernelMinimizeThreads,
874  mightGet = cms.optional.untracked.vstring,
875  outOfTimeThresholdGain12mEB = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain12mEB,
876  outOfTimeThresholdGain12mEE = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain12mEE,
877  outOfTimeThresholdGain12pEB = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain12pEB,
878  outOfTimeThresholdGain12pEE = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain12pEE,
879  outOfTimeThresholdGain61mEB = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain61mEB,
880  outOfTimeThresholdGain61mEE = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain61mEE,
881  outOfTimeThresholdGain61pEB = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain61pEB,
882  outOfTimeThresholdGain61pEE = process.hltEcalUncalibRecHitGPU.outOfTimeThresholdGain61pEE,
883  recHitsLabelEB = process.hltEcalUncalibRecHitGPU.recHitsLabelEB,
884  recHitsLabelEE = process.hltEcalUncalibRecHitGPU.recHitsLabelEE,
885  shouldRunTimingComputation = process.hltEcalUncalibRecHitGPU.shouldRunTimingComputation
886  )
887  process.HLTDoFullUnpackingEgammaEcalWithoutPreshowerTask.add(process.hltEcalUncalibRecHitPortable)
888 
889  process.load("RecoLocalCalo.EcalRecProducers.ecalMultifitConditionsHostESProducer_cfi")
890  process.HLTDoFullUnpackingEgammaEcalWithoutPreshowerTask.add(process.ecalMultifitConditionsHostESProducer)
891 
892  process.ecalMultifitParametersSource = cms.ESSource("EmptyESSource",
893  firstValid = cms.vuint32(1),
894  iovIsRunNotTime = cms.bool(True),
895  recordName = cms.string('EcalMultifitParametersRcd')
896  )
897  process.load("RecoLocalCalo.EcalRecProducers.ecalMultifitParametersHostESProducer_cfi")
898  process.HLTDoFullUnpackingEgammaEcalWithoutPreshowerTask.add(process.ecalMultifitParametersHostESProducer)
899 
900  delattr(process, 'hltEcalUncalibRecHitGPU')
901 
902  if hasattr(process, 'hltEcalUncalibRecHitFromSoA'):
903  process.hltEcalUncalibRecHitFromSoA = cms.EDProducer("EcalUncalibRecHitSoAToLegacy",
904  isPhase2 = process.hltEcalUncalibRecHitFromSoA.isPhase2,
905  mightGet = cms.optional.untracked.vstring,
906  recHitsLabelCPUEB = process.hltEcalUncalibRecHitFromSoA.recHitsLabelCPUEB,
907  recHitsLabelCPUEE = process.hltEcalUncalibRecHitFromSoA.recHitsLabelCPUEE,
908  uncalibRecHitsPortableEB = cms.InputTag("hltEcalUncalibRecHitPortable","EcalUncalibRecHitsEB"),
909  uncalibRecHitsPortableEE = cms.InputTag("hltEcalUncalibRecHitPortable","EcalUncalibRecHitsEE")
910  )
911 
912  if hasattr(process, 'hltEcalUncalibRecHitSoA'):
913  delattr(process, 'hltEcalUncalibRecHitSoA')
914 
915 
916  if hasattr(process, 'HLTDoFullUnpackingEgammaEcalWithoutPreshowerTask') and hasattr(process, 'HLTPreshowerTask'):
917  process.HLTDoFullUnpackingEgammaEcalTask = cms.ConditionalTask(process.HLTDoFullUnpackingEgammaEcalWithoutPreshowerTask, process.HLTPreshowerTask)
918 
919  return process
920 
922 
923  process.load("HeterogeneousCore.AlpakaCore.ProcessAcceleratorAlpaka_cfi")
924  process.load('Configuration.StandardSequences.Accelerators_cff')
925 
926  process = customizeHLTforAlpakaEcalLocalReco(process)
927  process = customizeHLTforAlpakaPixelReco(process)
929 
930  return process
931 
def customizeHLTforDQMGPUvsCPUPixel(process)
Pixel HLT in Alpaka.
def all(container)
workaround iterator generators for ROOT classes
Definition: cmstools.py:25
def customizeHLTforAlpakaPixelRecoVertexing(process)
def makeSerialClone(module, kwargs)
Definition: functions.py:1
def customizeHLTforAlpakaPixelRecoTracking(process)
def customizeHLTforAlpakaPixelRecoLocal(process)
def customizeHLTforAlpakaPixelReco(process)
def customizeHLTforAlpakaEcalLocalReco(process)
ECAL HLT in Alpaka.
def customizeHLTforAlpakaPixelRecoTheRest(process)
def customizeHLTforAlpakaParticleFlowClustering(process)
PF HLT in Alpaka.
if(threadIdxLocalY==0 &&threadIdxLocalX==0)