From 5584911047685d00ff9f4f4a5e60c2dabf6ea955 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Fri, 23 Feb 2024 08:54:10 -0600 Subject: [PATCH] Erase from correct vector in PATTauHybridProducer Erasing an element from pfChs using an iterator from pfGammas is undefined behavior. Based on the surrounding code, I guess the intention was to erase the element from pfGammas. --- PhysicsTools/PatAlgos/plugins/PATTauHybridProducer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhysicsTools/PatAlgos/plugins/PATTauHybridProducer.cc b/PhysicsTools/PatAlgos/plugins/PATTauHybridProducer.cc index e1d8d7c783c19..7e949e3dbe0aa 100644 --- a/PhysicsTools/PatAlgos/plugins/PATTauHybridProducer.cc +++ b/PhysicsTools/PatAlgos/plugins/PATTauHybridProducer.cc @@ -385,7 +385,7 @@ void PATTauHybridProducer::fillTauFromJet(reco::PFTau& pfTau, const reco::JetBas pfTau.setleadChargedHadrCand(pfGammas[0]); pfTau.setleadCand(pfGammas[0]); pfGammasSig.push_back(pfGammas[0]); - pfChs.erase(pfGammas.begin()); + pfGammas.erase(pfGammas.begin()); } // Clean gamma candidates from low-pt ones for (CandPtrs::iterator it = pfGammas.begin(); it != pfGammas.end();) {