Ejemplo n.º 1
0
#--- for Run 3 on GPU
from Configuration.ProcessModifiers.gpu_cff import gpu

from RecoLocalCalo.HcalRecProducers.hbheRecHitProducerGPUTask_cff import *
_run3_hcalLocalRecoGPUTask = _run3_hcalLocalRecoTask.copy()
_run3_hcalLocalRecoGPUTask.add(hbheRecHitProducerGPUTask)
gpu.toReplaceWith(hcalLocalRecoTask, _run3_hcalLocalRecoGPUTask)

#--- HCAL-only workflow for Run 3
# FIXME rename `hbheprereco` to `hbhereco` and use it from hcalGlobalRecoTask
hcalOnlyLocalRecoTask = cms.Task(hbheprereco, hfprereco, hfreco, horeco)

#--- HCAL-only workflow for Run 3 on GPU
from Configuration.ProcessModifiers.gpu_cff import gpu

_hcalOnlyLocalRecoGPUTask = hcalOnlyLocalRecoTask.copy()
_hcalOnlyLocalRecoGPUTask.add(hbheRecHitProducerGPUTask)
gpu.toReplaceWith(hcalOnlyLocalRecoTask, _hcalOnlyLocalRecoGPUTask)

from RecoLocalCalo.HcalRecProducers.hcalCPURecHitsProducer_cfi import hcalCPURecHitsProducer as _hcalCPURecHitsProducer
gpu.toReplaceWith(hbheprereco, _hcalCPURecHitsProducer.clone(
    recHitsM0LabelIn = "hbheRecHitProducerGPU",
    recHitsM0LabelOut = "",
    recHitsLegacyLabelOut = ""
))

#--- for FastSim
_fastSim_hcalLocalRecoTask = hcalLocalRecoTask.copyAndExclude([zdcreco])
from Configuration.Eras.Modifier_fastSim_cff import fastSim
fastSim.toReplaceWith( hcalLocalRecoTask, _fastSim_hcalLocalRecoTask )
Ejemplo n.º 2
0
def customiseHcalLocalReconstruction(process):

    if not 'HLTDoLocalHcalSequence' 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.HLTDoLocalHcalSequence = cms.Sequence()
    process.HLTStoppedHSCPLocalHcalReco = cms.Sequence()

    # Event Setup

    process.load(
        "EventFilter.HcalRawToDigi.hcalElectronicsMappingGPUESProducer_cfi")

    process.load("RecoLocalCalo.HcalRecProducers.hcalGainsGPUESProducer_cfi")
    process.load(
        "RecoLocalCalo.HcalRecProducers.hcalGainWidthsGPUESProducer_cfi")
    process.load(
        "RecoLocalCalo.HcalRecProducers.hcalLUTCorrsGPUESProducer_cfi")
    process.load(
        "RecoLocalCalo.HcalRecProducers.hcalConvertedPedestalsGPUESProducer_cfi"
    )
    process.load(
        "RecoLocalCalo.HcalRecProducers.hcalConvertedEffectivePedestalsGPUESProducer_cfi"
    )
    process.hcalConvertedEffectivePedestalsGPUESProducer.label0 = "withTopoEff"
    process.load(
        "RecoLocalCalo.HcalRecProducers.hcalConvertedPedestalWidthsGPUESProducer_cfi"
    )
    process.load(
        "RecoLocalCalo.HcalRecProducers.hcalConvertedEffectivePedestalWidthsGPUESProducer_cfi"
    )
    process.hcalConvertedEffectivePedestalWidthsGPUESProducer.label0 = "withTopoEff"
    process.hcalConvertedEffectivePedestalWidthsGPUESProducer.label1 = "withTopoEff"
    process.load(
        "RecoLocalCalo.HcalRecProducers.hcalQIECodersGPUESProducer_cfi")
    process.load(
        "RecoLocalCalo.HcalRecProducers.hcalRecoParamsWithPulseShapesGPUESProducer_cfi"
    )
    process.load(
        "RecoLocalCalo.HcalRecProducers.hcalRespCorrsGPUESProducer_cfi")
    process.load(
        "RecoLocalCalo.HcalRecProducers.hcalTimeCorrsGPUESProducer_cfi")
    process.load(
        "RecoLocalCalo.HcalRecProducers.hcalQIETypesGPUESProducer_cfi")
    process.load(
        "RecoLocalCalo.HcalRecProducers.hcalSiPMParametersGPUESProducer_cfi")
    process.load(
        "RecoLocalCalo.HcalRecProducers.hcalSiPMCharacteristicsGPUESProducer_cfi"
    )
    process.load(
        "RecoLocalCalo.HcalRecProducers.hcalMahiPulseOffsetsGPUESProducer_cfi")

    # Modules and EDAliases

    # The HCAL unpacker running on the gpu supports only the HB and HE digis.
    # So, run the legacy unacker on the cpu, then convert the HB and HE digis
    # to SoA format and copy them to the gpu.
    process.hltHcalDigisGPU = cms.EDProducer(
        "HcalDigisProducerGPU",
        hbheDigisLabel=cms.InputTag("hltHcalDigis"),
        qie11DigiLabel=cms.InputTag("hltHcalDigis"),
        digisLabelF01HE=cms.string(""),
        digisLabelF5HB=cms.string(""),
        digisLabelF3HB=cms.string(""),
        maxChannelsF01HE=cms.uint32(10000),
        maxChannelsF5HB=cms.uint32(10000),
        maxChannelsF3HB=cms.uint32(10000))

    # run the HCAL local reconstruction (including Method 0 and MAHI) on gpu
    from RecoLocalCalo.HcalRecProducers.hbheRecHitProducerGPU_cfi import hbheRecHitProducerGPU as _hbheRecHitProducerGPU
    process.hltHbherecoGPU = _hbheRecHitProducerGPU.clone(
        digisLabelF01HE="hltHcalDigisGPU",
        digisLabelF5HB="hltHcalDigisGPU",
        digisLabelF3HB="hltHcalDigisGPU",
        recHitsLabelM0HBHE="")

    # transfer the HCAL rechits to the cpu, and convert them to the legacy format
    from RecoLocalCalo.HcalRecProducers.hcalCPURecHitsProducer_cfi import hcalCPURecHitsProducer as _hcalCPURecHitsProducer
    process.hltHbherecoFromGPU = _hcalCPURecHitsProducer.clone(
        recHitsM0LabelIn="hltHbherecoGPU",
        recHitsM0LabelOut="",
        recHitsLegacyLabelOut="")

    # SwitchProducer between the legacy producer and the copy from gpu with conversion
    process.hltHbhereco = SwitchProducerCUDA(
        # legacy producer
        cpu=process.hltHbhereco.clone(),
        # alias to the rechits converted to legacy format
        cuda=cms.EDAlias(hltHbherecoFromGPU=cms.VPSet(
            cms.PSet(type=cms.string("HBHERecHitsSorted")))))

    # Tasks and Sequences

    process.HLTDoLocalHcalTask = cms.Task(
        process.hltHcalDigis,  # legacy producer, unpack HCAL digis on cpu
        process.hltHcalDigisGPU,  # copy to gpu and convert to SoA format
        process.
        hltHbherecoGPU,  # run the HCAL local reconstruction (including Method 0 and MAHI) on gpu
        process.
        hltHbherecoFromGPU,  # transfer the HCAL rechits to the cpu, and convert them to the legacy format
        process.
        hltHbhereco,  # SwitchProducer between the legacy producer and the copy from gpu with conversion
        process.hltHfprereco,  # legacy producer
        process.hltHfreco,  # legacy producer
        process.hltHoreco)  # legacy producer

    process.HLTDoLocalHcalSequence = cms.Sequence(process.HLTDoLocalHcalTask)

    process.HLTStoppedHSCPLocalHcalRecoTask = cms.Task(
        process.hltHcalDigis,  # legacy producer, unpack HCAL digis on cpu
        process.hltHcalDigisGPU,  # copy to gpu and convert to SoA format
        process.
        hltHbherecoGPU,  # run the HCAL local reconstruction (including Method 0 and MAHI) on gpu
        process.
        hltHbherecoFromGPU,  # transfer the HCAL rechits to the cpu, and convert them to the legacy format
        process.hltHbhereco
    )  # SwitchProducer between the legacy producer and the copy from gpu with conversion

    process.HLTStoppedHSCPLocalHcalReco = cms.Sequence(
        process.HLTStoppedHSCPLocalHcalRecoTask)

    # done
    return process
Ejemplo n.º 3
0
import FWCore.ParameterSet.Config as cms
from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA

#--- for Run 1 and Run 2
from RecoLocalCalo.HcalRecProducers.HBHEIsolatedNoiseReflagger_cfi import hbhereco as _phase0_hbhereco
hbhereco = SwitchProducerCUDA(
    cpu = _phase0_hbhereco.clone()
)
hcalGlobalRecoTask = cms.Task(hbhereco)
hcalGlobalRecoSequence = cms.Sequence(hcalGlobalRecoTask)

hcalOnlyGlobalRecoTask = cms.Task()
hcalOnlyGlobalRecoSequence = cms.Sequence(hcalOnlyGlobalRecoTask)

#--- for Run 3 and later
from Configuration.Eras.Modifier_run3_HB_cff import run3_HB

from RecoLocalCalo.HcalRecProducers.HBHEPhase1Reconstructor_cfi import hbheprereco as _phase1_hbheprereco
run3_HB.toReplaceWith(hbhereco.cpu, _phase1_hbheprereco)
run3_HB.toReplaceWith(hcalOnlyGlobalRecoTask, cms.Task(hbhereco))

#--- for Run 3 on GPU
from Configuration.ProcessModifiers.gpu_cff import gpu

from RecoLocalCalo.HcalRecProducers.hcalCPURecHitsProducer_cfi import hcalCPURecHitsProducer as _hbherecoFromCUDA
(run3_HB & gpu).toModify(hbhereco,
    cuda = _hbherecoFromCUDA.clone(
        produceSoA = False
    )
)