Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:45

0001 import FWCore.ParameterSet.Config as cms
0002 from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA
0003 from Configuration.ProcessModifiers.gpu_cff import gpu
0004 
0005 
0006 from RecoLocalCalo.EcalRecProducers.ecalUncalibRecHitPhase2_cfi import ecalUncalibRecHitPhase2 as _ecalUncalibRecHitPhase2
0007 ecalUncalibRecHitPhase2 = SwitchProducerCUDA(
0008   cpu = _ecalUncalibRecHitPhase2.clone()
0009 )
0010 
0011 # cpu weights
0012 ecalUncalibRecHitPhase2Task = cms.Task(ecalUncalibRecHitPhase2)
0013 
0014 # conditions used on gpu
0015 
0016 
0017 from RecoLocalCalo.EcalRecProducers.ecalPhase2DigiToGPUProducer_cfi import ecalPhase2DigiToGPUProducer as _ecalPhase2DigiToGPUProducer
0018 ecalPhase2DigiToGPUProducer = _ecalPhase2DigiToGPUProducer.clone()
0019 
0020 # gpu weights
0021 from RecoLocalCalo.EcalRecProducers.ecalUncalibRecHitPhase2GPU_cfi import ecalUncalibRecHitPhase2GPU as _ecalUncalibRecHitPhase2GPU
0022 ecalUncalibRecHitPhase2GPU = _ecalUncalibRecHitPhase2GPU.clone(
0023   digisLabelEB = ('ecalPhase2DigiToGPUProducer', 'ebDigis')
0024 )
0025 
0026 # copy the uncalibrated rechits from GPU to CPU
0027 from RecoLocalCalo.EcalRecProducers.ecalCPUUncalibRecHitProducer_cfi import ecalCPUUncalibRecHitProducer as _ecalCPUUncalibRecHitProducer
0028 ecalUncalibRecHitSoA = _ecalCPUUncalibRecHitProducer.clone(
0029   recHitsInLabelEB = ('ecalUncalibRecHitPhase2GPU', 'EcalUncalibRecHitsEB'),
0030   isPhase2 = True,
0031   recHitsInLabelEE = None,  # remove unneeded Phase1 parameters
0032   recHitsOutLabelEE = None
0033 )
0034 
0035 
0036 from RecoLocalCalo.EcalRecProducers.ecalUncalibRecHitConvertGPU2CPUFormat_cfi import ecalUncalibRecHitConvertGPU2CPUFormat as _ecalUncalibRecHitConvertGPU2CPUFormat
0037 gpu.toModify(ecalUncalibRecHitPhase2,
0038     cuda = _ecalUncalibRecHitConvertGPU2CPUFormat.clone(
0039         isPhase2 = True,
0040         recHitsLabelGPUEB = ('ecalUncalibRecHitSoA', 'EcalUncalibRecHitsEB'),
0041         recHitsLabelGPUEE = None,  # remove unneeded Phase1 parameters
0042         recHitsLabelCPUEE = None
0043     )
0044 )
0045 
0046 gpu.toReplaceWith(ecalUncalibRecHitPhase2Task, cms.Task(
0047   # convert phase2 digis to GPU SoA
0048   ecalPhase2DigiToGPUProducer, 
0049   # ECAL weights running on GPU
0050   ecalUncalibRecHitPhase2GPU,
0051   # copy the uncalibrated rechits from GPU to CPU
0052   ecalUncalibRecHitSoA,
0053   # ECAL multifit running on CPU, or convert the uncalibrated rechits from SoA to legacy format
0054   ecalUncalibRecHitPhase2,
0055 ))