Skip to content

Commit

Permalink
Merge pull request #44000 from waredjeb/fix_integratePFAlpakaClusteri…
Browse files Browse the repository at this point in the history
…ngAtHLT_14_0_0_pre3

[14.0.X] Fix HLT customization for alpaka PF
  • Loading branch information
cmsbuild authored Feb 23, 2024
2 parents 1713ae4 + e6e2d97 commit 7e61dec
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions HLTrigger/Configuration/python/customizeHLTforAlpaka.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,10 @@ def customizeHLTforAlpakaParticleFlowClustering(process):

process.hltPFRecHitSoAProducerHCALCPUSerial = makeSerialClone(process.hltPFRecHitSoAProducerHCAL)


process.hltLegacyPFRecHitProducer = cms.EDProducer("LegacyPFRecHitProducer",
src = cms.InputTag("hltPFRecHitSoAProducerHCAL")
)

process.hltLegacyPFRecHitProducerCPUSerial = process.hltLegacyPFRecHitProducer.clone(
src = cms.InputTag("hltPFRecHitSoAProducerHCALCPUSerial")
)

process.hltPFClusterParamsESProducer = cms.ESProducer("PFClusterParamsESProducer@alpaka",
seedFinder = cms.PSet(
nNeighbours = cms.int32(4),
Expand Down Expand Up @@ -204,6 +199,7 @@ def customizeHLTforAlpakaParticleFlowClustering(process):
PFRecHitsLabelIn = cms.InputTag("hltPFRecHitSoAProducerHCAL")
)


#Same as default except change the clusterSource
process.hltParticleFlowClusterHCAL = cms.EDProducer("PFMultiDepthClusterProducer",
clustersSource = cms.InputTag("hltLegacyPFClusterProducer"),
Expand All @@ -217,19 +213,17 @@ def customizeHLTforAlpakaParticleFlowClustering(process):
process.HLTPFHcalRecHits = cms.Sequence(
process.hltHBHERecHitToSoA+
process.hltPFRecHitSoAProducerHCAL+
process.hltPFRecHitSoAProducerHCALCPUSerial+
process.hltLegacyPFRecHitProducer+
process.hltLegacyPFRecHitProducerCPUSerial
process.hltLegacyPFRecHitProducer
)

process.HLTPFHcalClustering = cms.Sequence(
process.HLTPFHcalRecHits+
process.hltPFClusterSoAProducer+
process.hltPFClusterSoAProducerCPUSerial+
process.hltLegacyPFClusterProducer+
process.hltParticleFlowClusterHCAL
)


#Some Sequences contain all the modules of process.HLTPFHcalClustering Sequence instead of the Sequence itself
#find these Sequences and replace all the modules with the Sequence
def replaceItemsInSequence(process, itemsToReplace, replacingSequence):
Expand All @@ -249,6 +243,29 @@ def replaceItemsInSequence(process, itemsToReplace, replacingSequence):
itemsList = [process.hltParticleFlowRecHitHBHE, process.hltParticleFlowClusterHBHE,process.hltParticleFlowClusterHCAL]
process = replaceItemsInSequence(process, itemsList, process.HLTPFHcalClustering)

process.HLTPFClusterHBHECPUSerial = cms.Sequence(process.hltHBHERecHitToSoA+process.hltPFRecHitSoAProducerHCALCPUSerial+process.hltPFClusterSoAProducerCPUSerial)

# modify EventContent of DQMGPUvsCPU stream
if hasattr(process, 'hltOutputDQMGPUvsCPU'):
process.hltOutputDQMGPUvsCPU.outputCommands.extend([
'keep *_hltPFClusterSoAProducer_*_*',
'keep *_hltPFClusterSoAProducerCPUSerial_*_*',
])

# Add CPUSerial sequences to DQM_HcalReconstruction_v Path
dqmHcalRecoPathName = None
for pathName in process.paths_():
if pathName.startswith('DQM_HcalReconstruction_v'):
dqmHcalRecoPathName = pathName
break

if dqmHcalRecoPathName == None:
return process

dqmHcalPath = getattr(process, dqmHcalRecoPathName)
dqmHcalRecoPathIndex = dqmHcalPath.index(process.hltHcalConsumerGPU) + 1
dqmHcalPath.insert(dqmHcalRecoPathIndex , process.HLTPFClusterHBHECPUSerial)

return process

## Pixel HLT in Alpaka
Expand Down

0 comments on commit 7e61dec

Please sign in to comment.