diff --git a/RecoLocalCalo/EcalRecProducers/plugins/EcalCPUUncalibRecHitProducer.cc b/RecoLocalCalo/EcalRecProducers/plugins/EcalCPUUncalibRecHitProducer.cc index adb4e858457b9..2b87a3dd565d8 100644 --- a/RecoLocalCalo/EcalRecProducers/plugins/EcalCPUUncalibRecHitProducer.cc +++ b/RecoLocalCalo/EcalRecProducers/plugins/EcalCPUUncalibRecHitProducer.cc @@ -27,7 +27,7 @@ class EcalCPUUncalibRecHitProducer : public edm::stream::EDProducer>; edm::EDGetTokenT recHitsInEBToken_, recHitsInEEToken_; using OutputProduct = ecal::UncalibratedRecHit>; @@ -44,7 +44,7 @@ void EcalCPUUncalibRecHitProducer::fillDescriptions(edm::ConfigurationDescriptio desc.add("recHitsOutLabelEB", "EcalUncalibRecHitsEB"); desc.add("containsTimingInformation", false); - desc.add("produceEE", true); + desc.add("isPhase1", true); desc.add("recHitsInLabelEE", edm::InputTag{"ecalUncalibRecHitProducerGPU", "EcalUncalibRecHitsEE"}); desc.add("recHitsOutLabelEE", "EcalUncalibRecHitsEE"); @@ -53,11 +53,11 @@ void EcalCPUUncalibRecHitProducer::fillDescriptions(edm::ConfigurationDescriptio } EcalCPUUncalibRecHitProducer::EcalCPUUncalibRecHitProducer(const edm::ParameterSet& ps) - : produceEE_{ps.getParameter("produceEE")}, + : isPhase1_{ps.getParameter("isPhase1")}, recHitsInEBToken_{consumes(ps.getParameter("recHitsInLabelEB"))}, recHitsOutEBToken_{produces(ps.getParameter("recHitsOutLabelEB"))}, containsTimingInformation_{ps.getParameter("containsTimingInformation")} { - if (produceEE_) { + if (isPhase1_) { recHitsInEEToken_ = consumes(ps.getParameter("recHitsInLabelEE")); recHitsOutEEToken_ = produces(ps.getParameter("recHitsOutLabelEE")); } @@ -84,7 +84,7 @@ void EcalCPUUncalibRecHitProducer::acquire(edm::Event const& event, cudaCheck(cudaMemcpyAsync(dest.data(), src, dest.size() * sizeof(type), cudaMemcpyDeviceToHost, ctx.stream())); }; - if (produceEE_) { + if (isPhase1_) { auto const& eeRecHitsProduct = event.get(recHitsInEEToken_); auto const& eeRecHits = ctx.get(eeRecHitsProduct); recHitsEE_.resize(eeRecHits.size); @@ -93,7 +93,6 @@ void EcalCPUUncalibRecHitProducer::acquire(edm::Event const& event, lambdaToTransfer(recHitsEB_.did, ebRecHits.did.get()); lambdaToTransfer(recHitsEB_.amplitudesAll, ebRecHits.amplitudesAll.get()); lambdaToTransfer(recHitsEB_.amplitude, ebRecHits.amplitude.get()); - lambdaToTransfer(recHitsEB_.amplitudeError, ebRecHits.amplitudeError.get()); lambdaToTransfer(recHitsEB_.chi2, ebRecHits.chi2.get()); lambdaToTransfer(recHitsEB_.pedestal, ebRecHits.pedestal.get()); lambdaToTransfer(recHitsEB_.flags, ebRecHits.flags.get()); @@ -101,15 +100,16 @@ void EcalCPUUncalibRecHitProducer::acquire(edm::Event const& event, lambdaToTransfer(recHitsEB_.jitter, ebRecHits.jitter.get()); lambdaToTransfer(recHitsEB_.jitterError, ebRecHits.jitterError.get()); } + if (!(isPhase1_)) + lambdaToTransfer(recHitsEB_.amplitudeError, ebRecHits.amplitudeError.get()); - if (produceEE_) { + if (isPhase1_) { auto const& eeRecHitsProduct = event.get(recHitsInEEToken_); auto const& eeRecHits = ctx.get(eeRecHitsProduct); recHitsEE_.resize(eeRecHits.size); lambdaToTransfer(recHitsEE_.did, eeRecHits.did.get()); lambdaToTransfer(recHitsEE_.amplitudesAll, eeRecHits.amplitudesAll.get()); lambdaToTransfer(recHitsEE_.amplitude, eeRecHits.amplitude.get()); - lambdaToTransfer(recHitsEE_.amplitudeError, eeRecHits.amplitudeError.get()); lambdaToTransfer(recHitsEE_.chi2, eeRecHits.chi2.get()); lambdaToTransfer(recHitsEE_.pedestal, eeRecHits.pedestal.get()); lambdaToTransfer(recHitsEE_.flags, eeRecHits.flags.get()); @@ -126,7 +126,7 @@ void EcalCPUUncalibRecHitProducer::produce(edm::Event& event, edm::EventSetup co // put into event event.put(recHitsOutEBToken_, std::move(recHitsOutEB)); - if (produceEE_) { + if (isPhase1_) { auto recHitsOutEE = std::make_unique(std::move(recHitsEE_)); event.put(recHitsOutEEToken_, std::move(recHitsOutEE)); } diff --git a/RecoLocalCalo/EcalRecProducers/plugins/EcalUncalibRecHitConvertGPU2CPUFormat.cc b/RecoLocalCalo/EcalRecProducers/plugins/EcalUncalibRecHitConvertGPU2CPUFormat.cc index 74ea6cc69bb8b..f74b1cabe8d77 100644 --- a/RecoLocalCalo/EcalRecProducers/plugins/EcalUncalibRecHitConvertGPU2CPUFormat.cc +++ b/RecoLocalCalo/EcalRecProducers/plugins/EcalUncalibRecHitConvertGPU2CPUFormat.cc @@ -19,7 +19,7 @@ class EcalUncalibRecHitConvertGPU2CPUFormat : public edm::stream::EDProducer<> { void produce(edm::Event&, edm::EventSetup const&) override; private: - bool produceEE_; + bool isPhase1_; const edm::EDGetTokenT recHitsGPUEB_; edm::EDGetTokenT recHitsGPUEE_; @@ -34,7 +34,7 @@ void EcalUncalibRecHitConvertGPU2CPUFormat::fillDescriptions(edm::ConfigurationD desc.add("recHitsLabelCPUEB", "EcalUncalibRecHitsEB"); - desc.add("produceEE", true); + desc.add("isPhase1", true); desc.add("recHitsLabelGPUEE", edm::InputTag("ecalUncalibRecHitProducerGPU", "EcalUncalibRecHitsEE")); desc.add("recHitsLabelCPUEE", "EcalUncalibRecHitsEE"); @@ -43,11 +43,11 @@ void EcalUncalibRecHitConvertGPU2CPUFormat::fillDescriptions(edm::ConfigurationD } EcalUncalibRecHitConvertGPU2CPUFormat::EcalUncalibRecHitConvertGPU2CPUFormat(const edm::ParameterSet& ps) - : produceEE_{ps.getParameter("produceEE")}, + : isPhase1_{ps.getParameter("isPhase1")}, recHitsGPUEB_{consumes(ps.getParameter("recHitsLabelGPUEB"))}, recHitsLabelCPUEB_{ps.getParameter("recHitsLabelCPUEB")} { produces(recHitsLabelCPUEB_); - if (produceEE_) { + if (isPhase1_) { recHitsGPUEE_ = consumes(ps.getParameter("recHitsLabelGPUEE")); recHitsLabelCPUEE_ = ps.getParameter("recHitsLabelCPUEE"); produces(recHitsLabelCPUEE_); @@ -68,13 +68,14 @@ void EcalUncalibRecHitConvertGPU2CPUFormat::produce(edm::Event& event, edm::Even recHitsGPUEB.jitter[i], recHitsGPUEB.chi2[i], recHitsGPUEB.flags[i]); - (*recHitsCPUEB)[i].setAmplitudeError(recHitsGPUEB.amplitudeError[i]); + if (!(isPhase1_)) + (*recHitsCPUEB)[i].setAmplitudeError(recHitsGPUEB.amplitudeError[i]); (*recHitsCPUEB)[i].setJitterError(recHitsGPUEB.jitterError[i]); auto const offset = i * EcalDataFrame::MAXSAMPLES; for (uint32_t sample = 0; sample < EcalDataFrame::MAXSAMPLES; ++sample) (*recHitsCPUEB)[i].setOutOfTimeAmplitude(sample, recHitsGPUEB.amplitudesAll[offset + sample]); } - if (produceEE_) { + if (isPhase1_) { auto const& recHitsGPUEE = event.get(recHitsGPUEE_); auto recHitsCPUEE = std::make_unique(); recHitsCPUEE->reserve(recHitsGPUEE.amplitude.size()); @@ -85,7 +86,6 @@ void EcalUncalibRecHitConvertGPU2CPUFormat::produce(edm::Event& event, edm::Even recHitsGPUEE.jitter[i], recHitsGPUEE.chi2[i], recHitsGPUEE.flags[i]); - (*recHitsCPUEB)[i].setAmplitudeError(recHitsGPUEE.amplitudeError[i]); (*recHitsCPUEE)[i].setJitterError(recHitsGPUEE.jitterError[i]); auto const offset = i * EcalDataFrame::MAXSAMPLES; for (uint32_t sample = 0; sample < EcalDataFrame::MAXSAMPLES; ++sample) { diff --git a/RecoLocalCalo/EcalRecProducers/python/ecalUncalibRecHitPhase2_cff.py b/RecoLocalCalo/EcalRecProducers/python/ecalUncalibRecHitPhase2_cff.py index 2ac18fd0a9d09..6349a6b7e082e 100644 --- a/RecoLocalCalo/EcalRecProducers/python/ecalUncalibRecHitPhase2_cff.py +++ b/RecoLocalCalo/EcalRecProducers/python/ecalUncalibRecHitPhase2_cff.py @@ -27,7 +27,7 @@ from RecoLocalCalo.EcalRecProducers.ecalCPUUncalibRecHitProducer_cfi import ecalCPUUncalibRecHitProducer as _ecalCPUUncalibRecHitProducer ecalMultiFitUncalibRecHitSoAnew = _ecalCPUUncalibRecHitProducer.clone( recHitsInLabelEB = cms.InputTag('ecalUncalibRecHitPhase2GPU', 'EcalUncalibRecHitsEB'), - produceEE = cms.bool(False) + isPhase1 = cms.bool(False) ) @@ -36,7 +36,7 @@ gpu.toModify(ecalUncalibRecHitPhase2, cuda = _ecalUncalibRecHitConvertGPU2CPUFormat.clone( recHitsLabelGPUEB = cms.InputTag('ecalMultiFitUncalibRecHitSoAnew', 'EcalUncalibRecHitsEB'), - produceEE = cms.bool(False) + isPhase1 = cms.bool(False) ) )