Skip to content

Commit

Permalink
Simplify the GPU pixel local reconstruction
Browse files Browse the repository at this point in the history
Simplify the Pixel local reconstruction running on GPU, taking advatage of #34259.
  • Loading branch information
fwyzard committed Sep 15, 2021
1 parent 9cf7a17 commit d98f14e
Showing 1 changed file with 29 additions and 30 deletions.
59 changes: 29 additions & 30 deletions HLTrigger/Configuration/python/customizeHLTforPatatrack.py
Expand Up @@ -131,51 +131,50 @@ def customisePixelLocalReconstruction(process):
src = "hltSiPixelClustersCUDA"
)

# convert the pixel digis errors to the legacy format
from EventFilter.SiPixelRawToDigi.siPixelDigiErrorsFromSoA_cfi import siPixelDigiErrorsFromSoA as _siPixelDigiErrorsFromSoA
process.hltSiPixelDigiErrors = _siPixelDigiErrorsFromSoA.clone(
digiErrorSoASrc = "hltSiPixelDigiErrorsSoA",
UsePhase1 = True
)

# copy the pixel digis (except errors) and clusters to the host
from EventFilter.SiPixelRawToDigi.siPixelDigisSoAFromCUDA_cfi import siPixelDigisSoAFromCUDA as _siPixelDigisSoAFromCUDA
process.hltSiPixelDigisSoA = _siPixelDigisSoAFromCUDA.clone(
src = "hltSiPixelClustersCUDA"
)

# convert the pixel digis (except errors) and clusters to the legacy format
from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoA_cfi import siPixelDigisClustersFromSoA as _siPixelDigisClustersFromSoA
process.hltSiPixelDigisClusters = _siPixelDigisClustersFromSoA.clone(
src = "hltSiPixelDigisSoA"
)
# reconstruct the pixel digis on the cpu
process.hltSiPixelDigisLegacy = process.hltSiPixelDigis.clone()

# SwitchProducer wrapping the legacy pixel digis producer or an alias combining the pixel digis information converted from SoA
# SwitchProducer wrapping a subset of the legacy pixel digis producer, or the conversion of the pixel digis errors to the legacy format
from EventFilter.SiPixelRawToDigi.siPixelDigiErrorsFromSoA_cfi import siPixelDigiErrorsFromSoA as _siPixelDigiErrorsFromSoA
process.hltSiPixelDigis = SwitchProducerCUDA(
# legacy producer
cpu = process.hltSiPixelDigis,
# alias used to access products from multiple conversion modules
cuda = cms.EDAlias(
hltSiPixelDigisClusters = cms.VPSet(
cms.PSet(type = cms.string("PixelDigiedmDetSetVector"))
),
hltSiPixelDigiErrors = cms.VPSet(
cpu = cms.EDAlias(
hltSiPixelDigisLegacy = cms.VPSet(
cms.PSet(type = cms.string("DetIdedmEDCollection")),
cms.PSet(type = cms.string("SiPixelRawDataErroredmDetSetVector")),
cms.PSet(type = cms.string("PixelFEDChanneledmNewDetSetVector"))
)
),
# conversion from SoA to legacy format
cuda = _siPixelDigiErrorsFromSoA.clone(
digiErrorSoASrc = "hltSiPixelDigiErrorsSoA",
UsePhase1 = True
)
)

# SwitchProducer wrapping the legacy pixel cluster producer or an alias for the pixel clusters information converted from SoA
# reconstruct the pixel clusters on the cpu
process.hltSiPixelClustersLegacy = process.hltSiPixelClusters.clone()

# SwitchProducer wrapping a subset of the legacy pixel cluster producer, or the conversion of the pixel digis (except errors) and clusters to the legacy format
from RecoLocalTracker.SiPixelClusterizer.siPixelDigisClustersFromSoA_cfi import siPixelDigisClustersFromSoA as _siPixelDigisClustersFromSoA
process.hltSiPixelClusters = SwitchProducerCUDA(
# legacy producer
cpu = process.hltSiPixelClusters,
# alias used to access products from multiple conversion modules
cuda = cms.EDAlias(
hltSiPixelDigisClusters = cms.VPSet(
cpu = cms.EDAlias(
hltSiPixelClustersLegacy = cms.VPSet(
cms.PSet(type = cms.string("SiPixelClusteredmNewDetSetVector"))
)
),
# conversion from SoA to legacy format
cuda = _siPixelDigisClustersFromSoA.clone(
src = "hltSiPixelDigisSoA",
produceDigis = False,
storeDigis = False,
)
)

Expand All @@ -191,7 +190,7 @@ def customisePixelLocalReconstruction(process):
process.hltSiPixelRecHits = SwitchProducerCUDA(
# legacy producer
cpu = process.hltSiPixelRecHits,
# converter to legacy format
# conversion from SoA to legacy format
cuda = _siPixelRecHitFromCUDA.clone(
pixelRecHitSrc = "hltSiPixelRecHitsCUDA",
src = "hltSiPixelClusters"
Expand All @@ -206,11 +205,11 @@ def customisePixelLocalReconstruction(process):
process.hltSiPixelClustersCUDA, # reconstruct the pixel digis and clusters on the gpu
process.hltSiPixelRecHitsCUDA, # reconstruct the pixel rechits on the gpu
process.hltSiPixelDigisSoA, # copy the pixel digis (except errors) and clusters to the host
process.hltSiPixelDigisClusters, # convert the pixel digis (except errors) and clusters to the legacy format
process.hltSiPixelDigiErrorsSoA, # copy the pixel digis errors to the host
process.hltSiPixelDigiErrors, # convert the pixel digis errors to the legacy format
process.hltSiPixelDigis, # SwitchProducer wrapping the legacy pixel digis producer or an alias combining the pixel digis information converted from SoA
process.hltSiPixelClusters, # SwitchProducer wrapping the legacy pixel cluster producer or an alias for the pixel clusters information converted from SoA
process.hltSiPixelDigisLegacy, # legacy pixel digis producer
process.hltSiPixelDigis, # SwitchProducer wrapping a subset of the legacy pixel digis producer, or the conversion of the pixel digis errors from SoA
process.hltSiPixelClustersLegacy, # legacy pixel cluster producer
process.hltSiPixelClusters, # SwitchProducer wrapping a subset of the legacy pixel cluster producer, or the conversion of the pixel digis (except errors) and clusters from SoA
process.hltSiPixelClustersCache, # legacy module, used by the legacy pixel quadruplet producer
process.hltSiPixelRecHits) # SwitchProducer wrapping the legacy pixel rechit producer or the transfer of the pixel rechits to the host and the conversion from SoA

Expand Down

0 comments on commit d98f14e

Please sign in to comment.