Skip to content

Commit

Permalink
Erase from correct vector in PATTauHybridProducer
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
makortel committed Feb 29, 2024
1 parent 7874d41 commit 5584911
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PhysicsTools/PatAlgos/plugins/PATTauHybridProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();) {
Expand Down

0 comments on commit 5584911

Please sign in to comment.