예제 #1
0
def customizePixelTracksSoAonCPU(process):

    process.CUDAService = cms.Service("CUDAService",
                                      enabled=cms.untracked.bool(False))

    from RecoLocalTracker.SiPixelRecHits.siPixelRecHitHostSoA_cfi import siPixelRecHitHostSoA
    process.siPixelRecHitsPreSplitting = siPixelRecHitHostSoA.clone(
        convertToLegacy=True)

    from RecoPixelVertexing.PixelTriplets.caHitNtupletCUDA_cfi import caHitNtupletCUDA
    process.pixelTrackSoA = caHitNtupletCUDA.clone(
        onGPU=False, pixelRecHitSrc='siPixelRecHitsPreSplitting')

    from RecoPixelVertexing.PixelVertexFinding.pixelVertexCUDA_cfi import pixelVertexCUDA
    process.pixelVertexSoA = pixelVertexCUDA.clone(
        onGPU=False, pixelTrackSrc='pixelTrackSoA')

    from RecoPixelVertexing.PixelTrackFitting.pixelTrackProducerFromSoA_cfi import pixelTrackProducerFromSoA
    process.pixelTracks = pixelTrackProducerFromSoA.clone(
        pixelRecHitLegacySrc='siPixelRecHitsPreSplitting')

    from RecoPixelVertexing.PixelVertexFinding.pixelVertexFromSoA_cfi import pixelVertexFromSoA
    process.pixelVertices = pixelVertexFromSoA.clone()

    process.reconstruction_step += process.siPixelRecHitsPreSplitting + process.pixelTrackSoA + process.pixelVertexSoA

    return process
def customizePixelTracksSoAonCPU(process):

    process.CUDAService = cms.Service('CUDAService',
                                      enabled=cms.untracked.bool(False))

    # ensure the same results when running on GPU (which supports only the 'HLT' payload) and CPU
    process.siPixelClustersPreSplitting.cpu.payloadType = cms.string('HLT')

    from RecoLocalTracker.SiPixelRecHits.siPixelRecHitSoAFromLegacy_cfi import siPixelRecHitSoAFromLegacy
    process.siPixelRecHitsPreSplitting = siPixelRecHitSoAFromLegacy.clone(
        convertToLegacy=True)

    from RecoPixelVertexing.PixelTriplets.caHitNtupletCUDA_cfi import caHitNtupletCUDA
    process.pixelTrackSoA = caHitNtupletCUDA.clone(
        onGPU=False, pixelRecHitSrc='siPixelRecHitsPreSplitting')

    from RecoPixelVertexing.PixelVertexFinding.pixelVertexCUDA_cfi import pixelVertexCUDA
    process.pixelVertexSoA = pixelVertexCUDA.clone(
        onGPU=False, pixelTrackSrc='pixelTrackSoA')

    from RecoPixelVertexing.PixelTrackFitting.pixelTrackProducerFromSoA_cfi import pixelTrackProducerFromSoA
    process.pixelTracks = pixelTrackProducerFromSoA.clone(
        pixelRecHitLegacySrc='siPixelRecHitsPreSplitting')

    from RecoPixelVertexing.PixelVertexFinding.pixelVertexFromSoA_cfi import pixelVertexFromSoA
    process.pixelVertices = pixelVertexFromSoA.clone()

    process.reconstruction_step += process.siPixelRecHitsPreSplitting + process.pixelTrackSoA + process.pixelVertexSoA

    return process
예제 #3
0
def customisePixelTrackReconstruction(process):

    if not 'HLTRecoPixelTracksSequence' in process.__dict__:
        return process

    # FIXME replace the Sequences with empty ones to avoid exanding them during the (re)definition of Modules and EDAliases

    process.HLTRecoPixelTracksSequence = cms.Sequence()
    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.caHitNtupletCUDA_cfi import caHitNtupletCUDA as _caHitNtupletCUDA
    process.hltPixelTracksCUDA = _caHitNtupletCUDA.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
    process.hltPixelTracksSoA = SwitchProducerCUDA(
        # build pixel ntuplets and pixel tracks in SoA format on cpu
        cpu=_caHitNtupletCUDA.clone(idealConditions=False,
                                    pixelRecHitSrc="hltSiPixelRecHitSoA",
                                    onGPU=False),
        # transfer the pixel tracks in SoA format to the host
        cuda=cms.EDProducer("PixelTrackSoAFromCUDA",
                            src=cms.InputTag("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

    # build pixel vertices in SoA format on gpu
    from RecoPixelVertexing.PixelVertexFinding.pixelVertexCUDA_cfi import pixelVertexCUDA as _pixelVertexCUDA
    process.hltPixelVerticesCUDA = _pixelVertexCUDA.clone(
        pixelTrackSrc="hltPixelTracksCUDA", onGPU=True)

    # build or transfer pixel vertices in SoA format on cpu
    process.hltPixelVerticesSoA = SwitchProducerCUDA(
        # build pixel vertices in SoA format on cpu
        cpu=_pixelVertexCUDA.clone(pixelTrackSrc="hltPixelTracksSoA",
                                   onGPU=False),
        # transfer the pixel vertices in SoA format to cpu
        cuda=cms.EDProducer("PixelVertexSoAFromCUDA",
                            src=cms.InputTag("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)

    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
예제 #4
0
# 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
from Configuration.ProcessModifiers.gpu_cff import gpu

# build pixel vertices in SoA format on the GPU
pixelVerticesCUDA = _pixelVerticesCUDA.clone(pixelTrackSrc="pixelTracksCUDA",
                                             onGPU=True)
예제 #5
0
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

    # 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
    if 'HLTRecoPixelTracksTask' in process.__dict__ and not isinstance(
            process.HLTRecoPixelTracksTask, cms.Task):
        raise Exception(
            'unsupported configuration: "process.HLTRecoPixelTracksTask" already exists, but it is not a Task'
        )

    process.HLTRecoPixelTracksTask = cms.Task(
        process.hltPixelTracksTrackingRegions,  # from the original sequence
        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:
        if 'HLTRecopixelvertexingTask' in process.__dict__ and not isinstance(
                process.HLTRecopixelvertexingTask, cms.Task):
            raise Exception(
                'unsupported configuration: "process.HLTRecopixelvertexingTask" already exists, but it is not a Task'
            )

        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
예제 #6
0
# "Patatrack" pixel ntuplets, fishbone cleaning, Broken Line fit, and density-based vertex reconstruction
from Configuration.ProcessModifiers.pixelNtupletFit_cff import pixelNtupletFit

# build the pixel vertices in SoA format on the CPU
from RecoPixelVertexing.PixelVertexFinding.pixelVertexCUDA_cfi import pixelVertexCUDA as _pixelVertexCUDA
pixelVerticesSoA = SwitchProducerCUDA(
    cpu = _pixelVertexCUDA.clone(
        pixelTrackSrc = "pixelTracksSoA",
        onGPU = False
    )
)

# convert the pixel vertices from SoA to legacy format
from RecoPixelVertexing.PixelVertexFinding.pixelVertexFromSoA_cfi import pixelVertexFromSoA as _pixelVertexFromSoA
pixelNtupletFit.toReplaceWith(pixelVertices, _pixelVertexFromSoA.clone(
    src = "pixelVerticesSoA"
))

pixelNtupletFit.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
from Configuration.ProcessModifiers.gpu_cff import gpu

# build pixel vertices in SoA format on the GPU
pixelVerticesCUDA = _pixelVertexCUDA.clone(
def customise_cpu_pixel(process):

    # FIXME replace the Sequences with empty ones to avoid exanding them during the (re)definition of Modules and EDAliases

    process.HLTRecoPixelTracksPPOnAASequence = cms.Sequence()
    process.HLTRecopixelvertexingSequencePPOnAA = cms.Sequence()

    # Event Setup

    process.load("RecoLocalTracker.SiPixelRecHits.PixelCPEFastESProducer_cfi")
    process.PixelCPEFastESProducer.DoLorentz = True

    # Modules and EDAliases

    # referenced in process.HLTRecoPixelTracksSequence

    from RecoLocalTracker.SiPixelRecHits.siPixelRecHitHostSoA_cfi import siPixelRecHitHostSoA as _siPixelRecHitHostSoA
    process.hltSiPixelRecHitSoAPPOnAA = _siPixelRecHitHostSoA.clone(
        beamSpot="hltOnlineBeamSpot",
        src="hltSiPixelClustersPPOnAA",
        convertToLegacy=True)

    from RecoPixelVertexing.PixelTriplets.caHitNtupletCUDA_cfi import caHitNtupletCUDA as _caHitNtupletCUDA
    process.hltPixelTracksHitQuadrupletsPPOnAA = _caHitNtupletCUDA.clone(
        idealConditions=False,
        pixelRecHitSrc="hltSiPixelRecHitSoAPPOnAA",
        onGPU=False)

    process.hltPixelTracksSoAPPOnAA = cms.EDAlias(
        hltPixelTracksHitQuadrupletsPPOnAA=cms.VPSet(
            cms.PSet(type=cms.string("32768TrackSoATHeterogeneousSoA"))))

    from RecoPixelVertexing.PixelTrackFitting.pixelTrackProducerFromSoA_cfi import pixelTrackProducerFromSoA as _pixelTrackProducerFromSoA
    process.hltPixelTracksPPOnAA = _pixelTrackProducerFromSoA.clone(
        beamSpot="hltOnlineBeamSpot",
        pixelRecHitLegacySrc="hltSiPixelRecHitsPPOnAA",
        trackSrc="hltPixelTracksSoAPPOnAA")

    # referenced in process.HLTRecopixelvertexingSequence

    from RecoPixelVertexing.PixelVertexFinding.pixelVertexCUDA_cfi import pixelVertexCUDA as _pixelVertexCUDA
    process.hltPixelVerticesSoAPPOnAA = _pixelVertexCUDA.clone(
        pixelTrackSrc="hltPixelTracksSoAPPOnAA", onGPU=False)

    from RecoPixelVertexing.PixelVertexFinding.pixelVertexFromSoA_cfi import pixelVertexFromSoA as _pixelVertexFromSoA
    process.hltPixelVerticesPPOnAA = _pixelVertexFromSoA.clone(
        TrackCollection="hltPixelTracksPPOnAA",
        beamSpot="hltOnlineBeamSpot",
        src="hltPixelVerticesSoAPPOnAA")

    # Sequences

    process.HLTRecoPixelTracksSequencePPOnAA = 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.
        hltPixelTracksTrackingRegionsPPOnAA  # from the original sequence
        + process.
        hltSiPixelRecHitSoAPPOnAA  # pixel rechits on cpu, converted to SoA
        + process.
        hltPixelTracksHitQuadrupletsPPOnAA  # pixel ntuplets on cpu, in SoA format
        # process.hltPixelTracksSoA                         # alias for hltPixelTracksHitQuadruplets
        + process.hltPixelTracksPPOnAA
    )  # pixel tracks on cpu, with transfer and conversion to legacy
    process.HLTRecoPixelTracksPPOnAASequence = cms.Sequence(
        process.HLTRecoPixelTracksSequencePPOnAA)

    process.HLTRecopixelvertexingSequencePPOnAA = cms.Sequence(
        process.HLTRecoPixelTracksSequencePPOnAA + process.
        hltPixelVerticesSoAPPOnAA  # pixel vertices on cpu, in SoA format
        + process.
        hltPixelVerticesPPOnAA  # pixel vertices on cpu, in legacy format
        + process.hltTrimmedPixelVerticesPPOnAA)  # from the original sequence
    process.HLTPixelVertexingPPOnAASequence = cms.Sequence(
        process.HLTRecopixelvertexingSequencePPOnAA)
    process.HLTPixelVertexingSequencePPOnAA = cms.Sequence(
        process.HLTRecopixelvertexingSequencePPOnAA)

    # done
    return process