def customisePixelTrackReconstruction(process): if not 'HLTRecoPixelTracksSequence' in process.__dict__: return process hasHLTPixelVertexReco = 'HLTRecopixelvertexingSequence' in process.__dict__ # FIXME replace the Sequences with empty ones to avoid expanding them during the (re)definition of Modules and EDAliases process.HLTRecoPixelTracksSequence = cms.Sequence() if hasHLTPixelVertexReco: process.HLTRecopixelvertexingSequence = cms.Sequence() # Modules and EDAliases # referenced in process.HLTRecoPixelTracksTask # cpu only: convert the pixel rechits from legacy to SoA format from RecoLocalTracker.SiPixelRecHits.siPixelRecHitSoAFromLegacy_cfi import siPixelRecHitSoAFromLegacy as _siPixelRecHitSoAFromLegacy process.hltSiPixelRecHitSoA = _siPixelRecHitSoAFromLegacy.clone( src="hltSiPixelClusters", beamSpot="hltOnlineBeamSpot", convertToLegacy=True) # build pixel ntuplets and pixel tracks in SoA format on gpu from RecoPixelVertexing.PixelTriplets.pixelTracksCUDA_cfi import pixelTracksCUDA as _pixelTracksCUDA process.hltPixelTracksCUDA = _pixelTracksCUDA.clone( idealConditions=False, pixelRecHitSrc="hltSiPixelRecHitsCUDA", onGPU=True) # use quality cuts tuned for Run 2 ideal conditions for all Run 3 workflows run3_common.toModify(process.hltPixelTracksCUDA, idealConditions=True) # SwitchProducer providing the pixel tracks in SoA format on cpu from RecoPixelVertexing.PixelTrackFitting.pixelTracksSoA_cfi import pixelTracksSoA as _pixelTracksSoA process.hltPixelTracksSoA = SwitchProducerCUDA( # build pixel ntuplets and pixel tracks in SoA format on cpu cpu=_pixelTracksCUDA.clone(idealConditions=False, pixelRecHitSrc="hltSiPixelRecHitSoA", onGPU=False), # transfer the pixel tracks in SoA format to the host cuda=_pixelTracksSoA.clone(src="hltPixelTracksCUDA")) # use quality cuts tuned for Run 2 ideal conditions for all Run 3 workflows run3_common.toModify(process.hltPixelTracksSoA.cpu, idealConditions=True) # convert the pixel tracks from SoA to legacy format from RecoPixelVertexing.PixelTrackFitting.pixelTrackProducerFromSoA_cfi import pixelTrackProducerFromSoA as _pixelTrackProducerFromSoA process.hltPixelTracks = _pixelTrackProducerFromSoA.clone( beamSpot="hltOnlineBeamSpot", pixelRecHitLegacySrc="hltSiPixelRecHits", trackSrc="hltPixelTracksSoA") # referenced in process.HLTRecopixelvertexingTask if hasHLTPixelVertexReco: # build pixel vertices in SoA format on gpu from RecoPixelVertexing.PixelVertexFinding.pixelVerticesCUDA_cfi import pixelVerticesCUDA as _pixelVerticesCUDA process.hltPixelVerticesCUDA = _pixelVerticesCUDA.clone( pixelTrackSrc="hltPixelTracksCUDA", onGPU=True) # build or transfer pixel vertices in SoA format on cpu from RecoPixelVertexing.PixelVertexFinding.pixelVerticesSoA_cfi import pixelVerticesSoA as _pixelVerticesSoA process.hltPixelVerticesSoA = SwitchProducerCUDA( # build pixel vertices in SoA format on cpu cpu=_pixelVerticesCUDA.clone(pixelTrackSrc="hltPixelTracksSoA", onGPU=False), # transfer the pixel vertices in SoA format to cpu cuda=_pixelVerticesSoA.clone(src="hltPixelVerticesCUDA")) # convert the pixel vertices from SoA to legacy format from RecoPixelVertexing.PixelVertexFinding.pixelVertexFromSoA_cfi import pixelVertexFromSoA as _pixelVertexFromSoA process.hltPixelVertices = _pixelVertexFromSoA.clone( src="hltPixelVerticesSoA", TrackCollection="hltPixelTracks", beamSpot="hltOnlineBeamSpot") # Tasks and Sequences process.HLTRecoPixelTracksTask = cms.Task( process.hltPixelTracksTrackingRegions, # from the original sequence process.hltSiPixelRecHitSoA, # pixel rechits on cpu, converted to SoA process.hltPixelTracksCUDA, # pixel ntuplets on gpu, in SoA format process.hltPixelTracksSoA, # pixel ntuplets on cpu, in SoA format process.hltPixelTracks) # pixel tracks on cpu, in legacy format process.HLTRecoPixelTracksSequence = cms.Sequence( process.HLTRecoPixelTracksTask) if hasHLTPixelVertexReco: process.HLTRecopixelvertexingTask = cms.Task( process.HLTRecoPixelTracksTask, process. hltPixelVerticesCUDA, # pixel vertices on gpu, in SoA format process. hltPixelVerticesSoA, # pixel vertices on cpu, in SoA format process. hltPixelVertices, # pixel vertices on cpu, in legacy format process.hltTrimmedPixelVertices) # from the original sequence process.HLTRecopixelvertexingSequence = cms.Sequence( process.hltPixelTracksFitter + # not used here, kept for compatibility with legacy sequences process. hltPixelTracksFilter, # not used here, kept for compatibility with legacy sequences process.HLTRecopixelvertexingTask) # done return process
from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA from RecoPixelVertexing.PixelTrackFitting.PixelTracks_cff import * from RecoPixelVertexing.PixelVertexFinding.PixelVertexes_cff import * # legacy pixel vertex reconsruction using the divisive vertex finder pixelVerticesTask = cms.Task(pixelVertices) # "Patatrack" pixel ntuplets, fishbone cleaning, Broken Line fit, and density-based vertex reconstruction from Configuration.ProcessModifiers.pixelNtupletFit_cff import pixelNtupletFit from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker # build the pixel vertices in SoA format on the CPU from RecoPixelVertexing.PixelVertexFinding.pixelVerticesCUDA_cfi import pixelVerticesCUDA as _pixelVerticesCUDA pixelVerticesSoA = SwitchProducerCUDA( cpu=_pixelVerticesCUDA.clone(pixelTrackSrc="pixelTracksSoA", onGPU=False)) # convert the pixel vertices from SoA to legacy format from RecoPixelVertexing.PixelVertexFinding.pixelVertexFromSoA_cfi import pixelVertexFromSoA as _pixelVertexFromSoA (pixelNtupletFit & ~phase2_tracker).toReplaceWith( pixelVertices, _pixelVertexFromSoA.clone(src="pixelVerticesSoA")) (pixelNtupletFit & ~phase2_tracker).toReplaceWith( pixelVerticesTask, cms.Task( # build the pixel vertices in SoA format on the CPU pixelVerticesSoA, # convert the pixel vertices from SoA to legacy format pixelVertices)) # "Patatrack" sequence running on the GPU