Esempio n. 1
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
Esempio n. 2
0
from RecoLocalCalo.HcalRecProducers.hcalSiPMCharacteristicsGPUESProducer_cfi import hcalSiPMCharacteristicsGPUESProducer
from RecoLocalCalo.HcalRecProducers.hcalMahiPulseOffsetsGPUESProducer_cfi import hcalMahiPulseOffsetsGPUESProducer

# convert the HBHE digis into SoA format, and copy them from CPU to GPU
from EventFilter.HcalRawToDigi.hcalDigisProducerGPU_cfi import hcalDigisProducerGPU as _hcalDigisProducerGPU
hcalDigisGPU = _hcalDigisProducerGPU.clone(
    digisLabelF01HE = "",
    digisLabelF5HB = "",
    digisLabelF3HB = ""
)

# run the HCAL local reconstruction (MAHI) on GPU
from RecoLocalCalo.HcalRecProducers.hbheRecHitProducerGPU_cfi import hbheRecHitProducerGPU as _hbheRecHitProducerGPU
hbheRecHitProducerGPU = _hbheRecHitProducerGPU.clone(
    digisLabelF01HE = "hcalDigisGPU",
    digisLabelF5HB = "hcalDigisGPU",
    digisLabelF3HB = "hcalDigisGPU",
    recHitsLabelM0HBHE = ""
)

# Tasks and Sequences
hbheRecHitProducerGPUTask = cms.Task(
    hcalGainsGPUESProducer,
    hcalGainWidthsGPUESProducer,
    hcalLUTCorrsGPUESProducer,
    hcalConvertedPedestalsGPUESProducer,
    hcalConvertedEffectivePedestalsGPUESProducer,
    hcalConvertedPedestalWidthsGPUESProducer,
    hcalConvertedEffectivePedestalWidthsGPUESProducer,
    hcalQIECodersGPUESProducer,
    hcalRecoParamsWithPulseShapesGPUESProducer,
    hcalRespCorrsGPUESProducer,