CMS 3D CMS Logo

ecalRecHit_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 calibrated rechit reconstruction on CPU
6 from RecoLocalCalo.EcalRecProducers.ecalRecHit_cfi import ecalRecHit as _ecalRecHit
7 ecalRecHit = SwitchProducerCUDA(
8  cpu = _ecalRecHit.clone()
9 )
10 
11 ecalCalibratedRecHitTask = cms.Task(
12  ecalRecHit
13 )
14 
15 # ECAL rechit calibrations on GPU
16 from RecoLocalCalo.EcalRecProducers.ecalRechitADCToGeVConstantGPUESProducer_cfi import ecalRechitADCToGeVConstantGPUESProducer
17 from RecoLocalCalo.EcalRecProducers.ecalRechitChannelStatusGPUESProducer_cfi import ecalRechitChannelStatusGPUESProducer
18 from RecoLocalCalo.EcalRecProducers.ecalIntercalibConstantsGPUESProducer_cfi import ecalIntercalibConstantsGPUESProducer
19 from RecoLocalCalo.EcalRecProducers.ecalLaserAPDPNRatiosGPUESProducer_cfi import ecalLaserAPDPNRatiosGPUESProducer
20 from RecoLocalCalo.EcalRecProducers.ecalLaserAPDPNRatiosRefGPUESProducer_cfi import ecalLaserAPDPNRatiosRefGPUESProducer
21 from RecoLocalCalo.EcalRecProducers.ecalLaserAlphasGPUESProducer_cfi import ecalLaserAlphasGPUESProducer
22 from RecoLocalCalo.EcalRecProducers.ecalLinearCorrectionsGPUESProducer_cfi import ecalLinearCorrectionsGPUESProducer
23 from RecoLocalCalo.EcalRecProducers.ecalRecHitParametersGPUESProducer_cfi import ecalRecHitParametersGPUESProducer
24 
25 # ECAL rechits running on GPU
26 from RecoLocalCalo.EcalRecProducers.ecalRecHitGPU_cfi import ecalRecHitGPU as _ecalRecHitGPU
27 ecalRecHitGPU = _ecalRecHitGPU.clone(
28  uncalibrecHitsInLabelEB = cms.InputTag('ecalMultiFitUncalibRecHitGPU', 'EcalUncalibRecHitsEB'),
29  uncalibrecHitsInLabelEE = cms.InputTag('ecalMultiFitUncalibRecHitGPU', 'EcalUncalibRecHitsEE')
30 )
31 
32 # copy the rechits from GPU to CPU
33 from RecoLocalCalo.EcalRecProducers.ecalCPURecHitProducer_cfi import ecalCPURecHitProducer as _ecalCPURecHitProducer
34 ecalRecHitSoA = _ecalCPURecHitProducer.clone(
35  recHitsInLabelEB = cms.InputTag('ecalRecHitGPU', 'EcalRecHitsEB'),
36  recHitsInLabelEE = cms.InputTag('ecalRecHitGPU', 'EcalRecHitsEE')
37 )
38 
39 # TODO: the ECAL calibrated rechits produced on the GPU are not correct, yet.
40 # When they are working and validated, remove this comment and uncomment the next lines:
41 # convert the rechits from SoA to legacy format
42 #from RecoLocalCalo.EcalRecProducers.ecalRecHitConvertGPU2CPUFormat_cfi import ecalRecHitConvertGPU2CPUFormat as _ecalRecHitFromSoA
43 #gpu.toModify(ecalRecHit,
44 # cuda = _ecalRecHitFromSoA.clone(
45 # recHitsLabelGPUEB = cms.InputTag('ecalRecHitSoA', 'EcalRecHitsEB'),
46 # recHitsLabelGPUEE = cms.InputTag('ecalRecHitSoA', 'EcalRecHitsEE')
47 # )
48 #)
49 
50 # ECAL calibrated rechit reconstruction on GPU
51 gpu.toReplaceWith(ecalCalibratedRecHitTask, cms.Task(
52  # ECAL rechit calibrations on GPU
53  ecalRechitADCToGeVConstantGPUESProducer,
54  ecalRechitChannelStatusGPUESProducer,
55  ecalIntercalibConstantsGPUESProducer,
56  ecalLaserAPDPNRatiosGPUESProducer,
57  ecalLaserAPDPNRatiosRefGPUESProducer,
58  ecalLaserAlphasGPUESProducer,
59  ecalLinearCorrectionsGPUESProducer,
60  ecalRecHitParametersGPUESProducer,
61  # ECAL rechits running on GPU
62  ecalRecHitGPU,
63  # copy the rechits from GPU to CPU
64  ecalRecHitSoA,
65  # convert the rechits from SoA to legacy format
66  ecalRecHit
67 ))