Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Apr 13, 2021
1 parent 2af23d6 commit 7bed67a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
19 changes: 11 additions & 8 deletions RecoPixelVertexing/Configuration/python/RecoPixelVertexing_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,22 @@
#
from RecoPixelVertexing.PixelVertexFinding.PixelVertexes_cff import *
#from RecoVertex.PrimaryVertexProducer.OfflinePixel3DPrimaryVertices_cfi import *
recopixelvertexingTask = cms.Task(pixelTracksTask,pixelVertices)
recopixelvertexing = cms.Sequence(recopixelvertexingTask)
recopixelvertexingTask = cms.Task(pixelTracksTask, pixelVertices)

from Configuration.ProcessModifiers.gpu_cff import gpu
_recopixelvertexingTask_gpu = recopixelvertexingTask.copy()

from RecoPixelVertexing.PixelVertexFinding.pixelVertexCUDA_cfi import pixelVertexCUDA
_recopixelvertexingTask_gpu.add(pixelVertexCUDA)

from RecoPixelVertexing.PixelVertexFinding.pixelVertexSoA_cfi import pixelVertexSoA
from RecoPixelVertexing.PixelVertexFinding.pixelVertexFromSoA_cfi import pixelVertexFromSoA as _pixelVertexFromSoA
_recopixelvertexingTask_gpu.add(pixelVertexSoA)

_pixelVertexingCUDATask = cms.Task(pixelTracksTask,pixelVertexCUDA,pixelVertexSoA,pixelVertices)
from RecoPixelVertexing.PixelVertexFinding.pixelVertexFromSoA_cfi import pixelVertexFromSoA as _pixelVertexFromSoA
gpu.toModify(pixelVertices,
cuda = _pixelVertexFromSoA
)

# pixelVertexSoAonCPU = pixelVertexCUDA.clone()
# pixelVertexSoAonCPU.onGPU = False;
gpu.toReplaceWith(recopixelvertexingTask, _recopixelvertexingTask_gpu)

gpu.toReplaceWith(pixelVertices,_pixelVertexFromSoA)
gpu.toReplaceWith(recopixelvertexingTask,_pixelVertexingCUDATask)
recopixelvertexing = cms.Sequence(recopixelvertexingTask)
24 changes: 12 additions & 12 deletions RecoPixelVertexing/PixelTrackFitting/python/PixelTracks_cff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import FWCore.ParameterSet.Config as cms
from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA

from RecoLocalTracker.SiStripRecHitConverter.StripCPEfromTrackAngle_cfi import *
from RecoLocalTracker.SiStripRecHitConverter.SiStripRecHitMatcher_cfi import *
Expand Down Expand Up @@ -59,10 +60,12 @@
)
)

pixelTracks = _pixelTracks.clone(
SeedingHitSets = "pixelTracksHitQuadruplets"
pixelTracks = SwitchProducerCUDA(
cpu = _pixelTracks.clone(
SeedingHitSets = "pixelTracksHitQuadruplets"
)
)
trackingLowPU.toModify(pixelTracks, SeedingHitSets = "pixelTracksHitTriplets")
trackingLowPU.toModify(pixelTracks.cpu, SeedingHitSets = "pixelTracksHitTriplets")

pixelTracksTask = cms.Task(
pixelTracksTrackingRegions,
Expand All @@ -79,7 +82,7 @@

# Use ntuple fit and substitute previous Fitter producer with the ntuple one
from Configuration.ProcessModifiers.pixelNtupleFit_cff import pixelNtupleFit as ntupleFit
ntupleFit.toModify(pixelTracks, Fitter = "pixelNtupletsFitter")
ntupleFit.toModify(pixelTracks.cpu, Fitter = "pixelNtupletsFitter")
_pixelTracksTask_ntupleFit = pixelTracksTask.copy()
_pixelTracksTask_ntupleFit.replace(pixelFitterByHelixProjections, pixelNtupletsFitter)
ntupleFit.toReplaceWith(pixelTracksTask, _pixelTracksTask_ntupleFit)
Expand All @@ -89,14 +92,11 @@
from RecoPixelVertexing.PixelTriplets.caHitNtupletCUDA_cfi import caHitNtupletCUDA
from RecoPixelVertexing.PixelTrackFitting.pixelTrackSoA_cfi import pixelTrackSoA
from RecoPixelVertexing.PixelTrackFitting.pixelTrackProducerFromSoA_cfi import pixelTrackProducerFromSoA as _pixelTrackFromSoA
_pixelTracksGPUTask = cms.Task(
caHitNtupletCUDA,
pixelTrackSoA,
pixelTracks # FromSoA
_pixelTracksTask_gpu = pixelTracksTask.copy()
_pixelTracksTask_gpu.add(caHitNtupletCUDA, pixelTrackSoA)
gpu.toModify(pixelTracks,
cuda = _pixelTrackFromSoA.clone()
)

gpu.toReplaceWith(pixelTracksTask, _pixelTracksGPUTask)
gpu.toReplaceWith(pixelTracks,_pixelTrackFromSoA)

gpu.toReplaceWith(pixelTracksTask, _pixelTracksTask_gpu)

pixelTracksSequence = cms.Sequence(pixelTracksTask)
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import FWCore.ParameterSet.Config as cms
from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA

from RecoPixelVertexing.PixelVertexFinding.PixelVertexes_cfi import *

from RecoPixelVertexing.PixelVertexFinding.PixelVertexes_cfi import pvClusterComparer, pixelVertices as _pixelVertices
pixelVertices = SwitchProducerCUDA(
cpu = _pixelVertices.clone()
)

0 comments on commit 7bed67a

Please sign in to comment.