CMS 3D CMS Logo

ecalMultiFitUncalibRecHit_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from HeterogeneousCore.CUDACore.SwitchProducerCUDA import SwitchProducerCUDA
4 
5 # ECAL multifit running on CPU
6 from RecoLocalCalo.EcalRecProducers.ecalMultiFitUncalibRecHit_cfi import ecalMultiFitUncalibRecHit as _ecalMultiFitUncalibRecHit
7 ecalMultiFitUncalibRecHitCPU = _ecalMultiFitUncalibRecHit.clone()
8 ecalMultiFitUncalibRecHit = SwitchProducerCUDA(
9  cpu = ecalMultiFitUncalibRecHitCPU
10 )
11 
12 ecalMultiFitUncalibRecHitTask = cms.Task(
13  # ECAL multifit running on CPU
14  ecalMultiFitUncalibRecHit
15 )
16 
18 
19 # ECAL conditions used by the multifit running on GPU
20 from RecoLocalCalo.EcalRecProducers.ecalPedestalsGPUESProducer_cfi import ecalPedestalsGPUESProducer
21 from RecoLocalCalo.EcalRecProducers.ecalGainRatiosGPUESProducer_cfi import ecalGainRatiosGPUESProducer
22 from RecoLocalCalo.EcalRecProducers.ecalPulseShapesGPUESProducer_cfi import ecalPulseShapesGPUESProducer
23 from RecoLocalCalo.EcalRecProducers.ecalPulseCovariancesGPUESProducer_cfi import ecalPulseCovariancesGPUESProducer
24 from RecoLocalCalo.EcalRecProducers.ecalSamplesCorrelationGPUESProducer_cfi import ecalSamplesCorrelationGPUESProducer
25 from RecoLocalCalo.EcalRecProducers.ecalTimeBiasCorrectionsGPUESProducer_cfi import ecalTimeBiasCorrectionsGPUESProducer
26 from RecoLocalCalo.EcalRecProducers.ecalTimeCalibConstantsGPUESProducer_cfi import ecalTimeCalibConstantsGPUESProducer
27 from RecoLocalCalo.EcalRecProducers.ecalMultifitParametersGPUESProducer_cfi import ecalMultifitParametersGPUESProducer
28 
29 # ECAL multifit running on GPU
30 from RecoLocalCalo.EcalRecProducers.ecalUncalibRecHitProducerGPU_cfi import ecalUncalibRecHitProducerGPU as _ecalUncalibRecHitProducerGPU
31 ecalMultiFitUncalibRecHitGPU = _ecalUncalibRecHitProducerGPU.clone(
32  digisLabelEB = 'ecalDigisGPU:ebDigis',
33  digisLabelEE = 'ecalDigisGPU:eeDigis',
34 )
35 
36 # copy the uncalibrated rechits from GPU to CPU
37 from RecoLocalCalo.EcalRecProducers.ecalCPUUncalibRecHitProducer_cfi import ecalCPUUncalibRecHitProducer as _ecalCPUUncalibRecHitProducer
38 ecalMultiFitUncalibRecHitSoA = _ecalCPUUncalibRecHitProducer.clone(
39  recHitsInLabelEB = 'ecalMultiFitUncalibRecHitGPU:EcalUncalibRecHitsEB',
40  recHitsInLabelEE = 'ecalMultiFitUncalibRecHitGPU:EcalUncalibRecHitsEE',
41  containsTimingInformation = True
42 )
43 
44 # convert the uncalibrated rechits from SoA to legacy format
45 from RecoLocalCalo.EcalRecProducers.ecalUncalibRecHitConvertGPU2CPUFormat_cfi import ecalUncalibRecHitConvertGPU2CPUFormat as _ecalUncalibRecHitConvertGPU2CPUFormat
46 gpu.toModify(ecalMultiFitUncalibRecHit,
47  cuda = _ecalUncalibRecHitConvertGPU2CPUFormat.clone(
48  recHitsLabelGPUEB = 'ecalMultiFitUncalibRecHitSoA:EcalUncalibRecHitsEB',
49  recHitsLabelGPUEE = 'ecalMultiFitUncalibRecHitSoA:EcalUncalibRecHitsEE',
50  )
51 )
52 
53 gpu.toReplaceWith(ecalMultiFitUncalibRecHitTask, cms.Task(
54  # ECAL conditions used by the multifit running on GPU
55  ecalPedestalsGPUESProducer,
56  ecalGainRatiosGPUESProducer,
57  ecalPulseShapesGPUESProducer,
58  ecalPulseCovariancesGPUESProducer,
59  ecalSamplesCorrelationGPUESProducer,
60  ecalTimeBiasCorrectionsGPUESProducer,
61  ecalTimeCalibConstantsGPUESProducer,
62  ecalMultifitParametersGPUESProducer,
63  # ECAL multifit running on GPU
64  ecalMultiFitUncalibRecHitGPU,
65  # copy the uncalibrated rechits from GPU to CPU
66  ecalMultiFitUncalibRecHitSoA,
67  # ECAL multifit running on CPU, or convert the uncalibrated rechits from SoA to legacy format
68  ecalMultiFitUncalibRecHit,
69 ))
70 
71 # modifications for alpaka
73 
74 # ECAL conditions used by the multifit running on the accelerator
75 from RecoLocalCalo.EcalRecProducers.ecalMultifitConditionsHostESProducer_cfi import ecalMultifitConditionsHostESProducer
76 from RecoLocalCalo.EcalRecProducers.ecalMultifitParametersHostESProducer_cfi import ecalMultifitParametersHostESProducer
77 
78 ecalMultifitParametersSource = cms.ESSource("EmptyESSource",
79  recordName = cms.string('EcalMultifitParametersRcd'),
80  iovIsRunNotTime = cms.bool(True),
81  firstValid = cms.vuint32(1)
82 )
83 
84 # ECAL multifit running on the accelerator
85 from RecoLocalCalo.EcalRecProducers.ecalUncalibRecHitProducerPortable_cfi import ecalUncalibRecHitProducerPortable as _ecalUncalibRecHitProducerPortable
86 ecalMultiFitUncalibRecHitPortable = _ecalUncalibRecHitProducerPortable.clone(
87  digisLabelEB = 'ecalDigisPortable:ebDigis',
88  digisLabelEE = 'ecalDigisPortable:eeDigis'
89 )
90 
91 # replace the SwitchProducerCUDA branches with the module to convert the uncalibrated rechits from SoA to legacy format
92 from RecoLocalCalo.EcalRecProducers.ecalUncalibRecHitSoAToLegacy_cfi import ecalUncalibRecHitSoAToLegacy as _ecalUncalibRecHitSoAToLegacy
93 alpaka.toModify(ecalMultiFitUncalibRecHit,
94  cpu = _ecalUncalibRecHitSoAToLegacy.clone()
95 )
96 
97 alpaka.toReplaceWith(ecalMultiFitUncalibRecHitTask, cms.Task(
98  # ECAL conditions used by the multifit running on the accelerator
99  ecalMultifitConditionsHostESProducer,
100  ecalMultifitParametersHostESProducer,
101  # ECAL multifit running on device
102  ecalMultiFitUncalibRecHitPortable,
103  # ECAL multifit running on CPU, or convert the uncalibrated rechits from SoA to legacy format
104  ecalMultiFitUncalibRecHit,
105 ))