From 91ba701f43a573a465090e3792d78cc46571fb37 Mon Sep 17 00:00:00 2001 From: Sam Harper Date: Wed, 12 Jun 2019 10:55:24 +0100 Subject: [PATCH] zeroing PF clustering uncertainty --- .../interface/PFClusterEMEnergyCorrector.h | 1 + .../plugins/CorrectedECALPFClusterProducer.cc | 1 + .../src/PFClusterEMEnergyCorrector.cc | 11 +++++++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/RecoParticleFlow/PFClusterProducer/interface/PFClusterEMEnergyCorrector.h b/RecoParticleFlow/PFClusterProducer/interface/PFClusterEMEnergyCorrector.h index 38cd633cafffa..6e106438fcd2f 100644 --- a/RecoParticleFlow/PFClusterProducer/interface/PFClusterEMEnergyCorrector.h +++ b/RecoParticleFlow/PFClusterProducer/interface/PFClusterEMEnergyCorrector.h @@ -53,6 +53,7 @@ class PFClusterEMEnergyCorrector { bool srfAwareCorrection_; bool applyCrackCorrections_; bool applyMVACorrections_; + bool setEnergyUncertainty_; bool autoDetectBunchSpacing_; int bunchSpacingManual_; diff --git a/RecoParticleFlow/PFClusterProducer/plugins/CorrectedECALPFClusterProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/CorrectedECALPFClusterProducer.cc index 3ceb184038e7b..4eb15071f4a61 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/CorrectedECALPFClusterProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/CorrectedECALPFClusterProducer.cc @@ -132,6 +132,7 @@ void CorrectedECALPFClusterProducer::fillDescriptions(edm::ConfigurationDescript psd0.add("applyCrackCorrections",false); psd0.add("applyMVACorrections",false); psd0.add("srfAwareCorrection",false); + psd0.add("setEnergyUncertainty",false); psd0.add("autoDetectBunchSpacing",true); psd0.add("bunchSpacing",25); psd0.add("maxPtForMVAEvaluation",-99.); diff --git a/RecoParticleFlow/PFClusterProducer/src/PFClusterEMEnergyCorrector.cc b/RecoParticleFlow/PFClusterProducer/src/PFClusterEMEnergyCorrector.cc index 57d961351afac..f981d02855b21 100644 --- a/RecoParticleFlow/PFClusterProducer/src/PFClusterEMEnergyCorrector.cc +++ b/RecoParticleFlow/PFClusterProducer/src/PFClusterEMEnergyCorrector.cc @@ -19,7 +19,7 @@ PFClusterEMEnergyCorrector::PFClusterEMEnergyCorrector(const edm::ParameterSet& applyCrackCorrections_ = conf.getParameter("applyCrackCorrections"); applyMVACorrections_ = conf.getParameter("applyMVACorrections"); srfAwareCorrection_ = conf.getParameter("srfAwareCorrection"); - + setEnergyUncertainty_ = conf.getParameter("setEnergyUncertainty"); maxPtForMVAEvaluation_ = conf.getParameter("maxPtForMVAEvaluation"); if (applyMVACorrections_) { @@ -250,8 +250,9 @@ void PFClusterEMEnergyCorrector::correctEnergies(const edm::Event &evt, double sigmacor = sigma*ecor; cluster.setCorrectedEnergy(ecor); - cluster.setCorrectedEnergyUncertainty(sigmacor); - + if(setEnergyUncertainty_) cluster.setCorrectedEnergyUncertainty(sigmacor); + else cluster.setCorrectedEnergyUncertainty(0.); + } return; } @@ -414,7 +415,9 @@ void PFClusterEMEnergyCorrector::correctEnergies(const edm::Event &evt, << exp(mean) << " " << ecor; cluster.setCorrectedEnergy(ecor); - cluster.setCorrectedEnergyUncertainty(sigmacor); + if(setEnergyUncertainty_) cluster.setCorrectedEnergyUncertainty(sigmacor); + else cluster.setCorrectedEnergyUncertainty(0.); + } }