From 36874eceed2a0406d3fba3e17763656c0d211d12 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Thu, 5 Aug 2021 11:17:53 -0500 Subject: [PATCH] Fix loop in PFJetIDSelectionFunctor The end iterator was not from the same container as the begin. This was found by gcc 11. --- PhysicsTools/SelectorUtils/interface/PFJetIDSelectionFunctor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhysicsTools/SelectorUtils/interface/PFJetIDSelectionFunctor.h b/PhysicsTools/SelectorUtils/interface/PFJetIDSelectionFunctor.h index 22a36569ec0a0..cd0266cc14911 100644 --- a/PhysicsTools/SelectorUtils/interface/PFJetIDSelectionFunctor.h +++ b/PhysicsTools/SelectorUtils/interface/PFJetIDSelectionFunctor.h @@ -412,7 +412,7 @@ class PFJetIDSelectionFunctor : public Selector { double e_muf = 0.0; nch = 0; nconstituents = 0; - for (reco::Jet::const_iterator ibegin = basicJet->begin(), iend = patJet->end(), isub = ibegin; isub != iend; + for (reco::Jet::const_iterator ibegin = basicJet->begin(), iend = basicJet->end(), isub = ibegin; isub != iend; ++isub) { reco::PFJet const *pfsub = dynamic_cast(&*isub); e_chf += pfsub->chargedHadronEnergy();