Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix electron PFCandidates RefVector usage in MuonFSRProducer #28221

Merged
merged 1 commit into from Oct 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 5 additions & 7 deletions MuonAnalysis/MuonAssociators/plugins/MuonFSRProducer.cc
Expand Up @@ -142,17 +142,15 @@ void MuonFSRProducer::produce(edm::StreamID streamID, edm::Event& iEvent, const
pat::PackedCandidateRef pfcandRef = pat::PackedCandidateRef(pfcands, iter_pf - pfcands->begin());

for (auto electrons_iter = electrons->begin(); electrons_iter != electrons->end(); ++electrons_iter) {
for (auto itr = electrons_iter->associatedPackedPFCandidates().begin();
itr != electrons_iter->associatedPackedPFCandidates().end();
++itr) {
if (!itr->isAvailable())
for (auto const& cand : electrons_iter->associatedPackedPFCandidates()) {
if (!cand.isAvailable())
continue;
if (itr->id() != pfcandRef.id())
if (cand.id() != pfcandRef.id())
throw cms::Exception("Configuration")
<< "The electron associatedPackedPFCandidates item does not have "
<< "the same ID of packed candidate collection used for cleaning the electron footprint: " << itr->id()
<< "the same ID of packed candidate collection used for cleaning the electron footprint: " << cand.id()
<< " (" << pfcandRef.id() << ")\n";
if (itr->key() == pfcandRef.key()) {
if (cand.key() == pfcandRef.key()) {
skipPhoton = true;
break;
}
Expand Down