Skip to content

Commit

Permalink
Protection against missing collection
Browse files Browse the repository at this point in the history
  • Loading branch information
lathomas committed Sep 16, 2021
1 parent fceae16 commit 3c42a85
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions PhysicsTools/NanoAOD/plugins/L1TriggerResultsConverter.cc
Expand Up @@ -135,8 +135,12 @@ void L1TriggerResultsConverter::produce(edm::Event& iEvent, const edm::EventSetu
if (store_unprefireable_bit_) {
edm::Handle<GlobalExtBlkBxCollection> handleExtResults;
iEvent.getByToken(token_ext_, handleExtResults);
if (handleExtResults->size() != 0) {
unprefireable_bit = handleExtResults->at(0, 0).getExternalDecision(GlobalExtBlk::maxExternalConditions - 1);
if (handleExtResults.isValid()) {
if (handleExtResults->size() != 0) {
unprefireable_bit = handleExtResults->at(0, 0).getExternalDecision(GlobalExtBlk::maxExternalConditions - 1);
}
} else {
LogDebug("Unprefirable bit not found, always set to false");
}
}
} else {
Expand Down

0 comments on commit 3c42a85

Please sign in to comment.