diff --git a/RecoJets/JetProducers/src/PileupJetIdAlgo.cc b/RecoJets/JetProducers/src/PileupJetIdAlgo.cc index 855905875f8ea..51b2ccea43760 100644 --- a/RecoJets/JetProducers/src/PileupJetIdAlgo.cc +++ b/RecoJets/JetProducers/src/PileupJetIdAlgo.cc @@ -571,10 +571,10 @@ PileupJetIdentifier PileupJetIdAlgo::computeIdVariables(const reco::Jet* jet, float dphi = reco::deltaPhi(*icand, *jet); sum_deta += deta * weight2; sum_dphi += dphi * weight2; - if (sumW2 > 0) { - ave_deta = sum_deta / sumW2; - ave_dphi = sum_dphi / sumW2; - } + } + if (sumW2 > 0) { + ave_deta = sum_deta / sumW2; + ave_dphi = sum_dphi / sumW2; } // // Finalize all variables