Skip to content

Commit

Permalink
Merge CMSSW_9_4_X into CMSSW_9_4_AN_X.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmsbuild committed Aug 7, 2018
2 parents 2e82e4e + 2f4918d commit 5ea525b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion RecoEgamma/EgammaTools/src/ElectronEnergyCalibrator.cc
Expand Up @@ -3,6 +3,7 @@
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/RandomNumberGenerator.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/Utilities/interface/isFinite.h"
#include <CLHEP/Random/RandGaussQ.h>

const EnergyScaleCorrection::ScaleCorrection ElectronEnergyCalibrator::defaultScaleCorr_;
Expand Down Expand Up @@ -43,7 +44,7 @@ calibrate(reco::GsfElectron &ele, unsigned int runNumber,
const float scEtaAbs = std::abs(ele.superCluster()->eta());
const float et = ele.ecalEnergy() / cosh(scEtaAbs);

if (et < minEt_) {
if (et < minEt_ || edm::isNotFinite(et) ) {
std::array<float,EGEnergySysIndex::kNrSysErrs> retVal;
retVal.fill(ele.energy());
retVal[EGEnergySysIndex::kScaleValue] = 1.0;
Expand Down
3 changes: 2 additions & 1 deletion RecoEgamma/EgammaTools/src/PhotonEnergyCalibrator.cc
Expand Up @@ -3,6 +3,7 @@
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Utilities/interface/RandomNumberGenerator.h"
#include "FWCore/Utilities/interface/Exception.h"
#include "FWCore/Utilities/interface/isFinite.h"
#include <CLHEP/Random/RandGaussQ.h>

const EnergyScaleCorrection::ScaleCorrection PhotonEnergyCalibrator::defaultScaleCorr_;
Expand Down Expand Up @@ -39,7 +40,7 @@ calibrate(reco::Photon &photon,const unsigned int runNumber,
const float scEtaAbs = std::abs(photon.superCluster()->eta());
const float et = photon.getCorrectedEnergy(reco::Photon::P4type::regression2) / cosh(scEtaAbs);

if (et < minEt_) {
if (et < minEt_ || edm::isNotFinite(et) ) {
std::array<float,EGEnergySysIndex::kNrSysErrs> retVal;
retVal.fill(photon.getCorrectedEnergy(reco::Photon::P4type::regression2));
retVal[EGEnergySysIndex::kScaleValue] = 1.0;
Expand Down

0 comments on commit 5ea525b

Please sign in to comment.