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

guard against invalid output products from HLTL1TSeed [14_0_X] #45048

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions HLTrigger/HLTfilters/plugins/HLTL1TSeed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,14 @@ bool HLTL1TSeed::seedsL1TriggerObjectMaps(edm::Event& iEvent, trigger::TriggerFi
<< "\nNo muons added to filterproduct." << endl;
} else {
for (std::list<int>::const_iterator itObj = listMuon.begin(); itObj != listMuon.end(); ++itObj) {
// skip invalid indices
if (*itObj < 0 or unsigned(*itObj) >= muons->size(0)) {
edm::LogWarning("HLTL1TSeed")
<< "Invalid index from the L1ObjectMap (L1uGT emulator), will be ignored (l1t::MuonBxCollection):"
<< " index=" << *itObj << " (size of unpacked L1T objects in BX0 = " << muons->size(0) << ")";
continue;
}

// Transform to index for Bx = 0 to begin of BxVector
unsigned int index = muons->begin(0) - muons->begin() + *itObj;

Expand All @@ -970,6 +978,14 @@ bool HLTL1TSeed::seedsL1TriggerObjectMaps(edm::Event& iEvent, trigger::TriggerFi
<< "\nNo muon showers added to filterproduct." << endl;
} else {
for (std::list<int>::const_iterator itObj = listMuonShower.begin(); itObj != listMuonShower.end(); ++itObj) {
// skip invalid indices
if (*itObj < 0 or unsigned(*itObj) >= muonShowers->size(0)) {
edm::LogWarning("HLTL1TSeed")
<< "Invalid index from the L1ObjectMap (L1uGT emulator), will be ignored (l1t::MuonShowerBxCollection):"
<< " index=" << *itObj << " (size of unpacked L1T objects in BX0 = " << muonShowers->size(0) << ")";
continue;
}

// Transform to index for Bx = 0 to begin of BxVector
unsigned int index = muonShowers->begin(0) - muonShowers->begin() + *itObj;

Expand All @@ -989,6 +1005,14 @@ bool HLTL1TSeed::seedsL1TriggerObjectMaps(edm::Event& iEvent, trigger::TriggerFi
<< "\nNo egammas added to filterproduct." << endl;
} else {
for (std::list<int>::const_iterator itObj = listEG.begin(); itObj != listEG.end(); ++itObj) {
// skip invalid indices
if (*itObj < 0 or unsigned(*itObj) >= egammas->size(0)) {
edm::LogWarning("HLTL1TSeed")
<< "Invalid index from the L1ObjectMap (L1uGT emulator), will be ignored (l1t::EGammaBxCollection):"
<< " index=" << *itObj << " (size of unpacked L1T objects in BX0 = " << egammas->size(0) << ")";
continue;
}

// Transform to begin of BxVector
unsigned int index = egammas->begin(0) - egammas->begin() + *itObj;

Expand All @@ -1009,6 +1033,14 @@ bool HLTL1TSeed::seedsL1TriggerObjectMaps(edm::Event& iEvent, trigger::TriggerFi
<< "\nNo jets added to filterproduct." << endl;
} else {
for (std::list<int>::const_iterator itObj = listJet.begin(); itObj != listJet.end(); ++itObj) {
// skip invalid indices
if (*itObj < 0 or unsigned(*itObj) >= jets->size(0)) {
edm::LogWarning("HLTL1TSeed")
<< "Invalid index from the L1ObjectMap (L1uGT emulator), will be ignored (l1t::JetBxCollection):"
<< " index=" << *itObj << " (size of unpacked L1T objects in BX0 = " << jets->size(0) << ")";
continue;
}

// Transform to begin of BxVector
unsigned int index = jets->begin(0) - jets->begin() + *itObj;

Expand All @@ -1029,6 +1061,14 @@ bool HLTL1TSeed::seedsL1TriggerObjectMaps(edm::Event& iEvent, trigger::TriggerFi
<< "\nNo taus added to filterproduct." << endl;
} else {
for (std::list<int>::const_iterator itObj = listTau.begin(); itObj != listTau.end(); ++itObj) {
// skip invalid indices
if (*itObj < 0 or unsigned(*itObj) >= taus->size(0)) {
edm::LogWarning("HLTL1TSeed")
<< "Invalid index from the L1ObjectMap (L1uGT emulator), will be ignored (l1t::TauBxCollection):"
<< " index=" << *itObj << " (size of unpacked L1T objects in BX0 = " << taus->size(0) << ")";
continue;
}

// Transform to begin of BxVector
unsigned int index = taus->begin(0) - taus->begin() + *itObj;

Expand Down