Skip to content

Commit

Permalink
Add protection againist missing (calo) tauId sources
Browse files Browse the repository at this point in the history
  • Loading branch information
mbluj committed Oct 26, 2017
1 parent b2d6c67 commit 4feb9c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions PhysicsTools/PatAlgos/plugins/PATTauProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ void PATTauProducer::produce(edm::Event & iEvent, const edm::EventSetup & iSetup
edm::Handle<reco::CaloTauDiscriminator> caloTauIdDiscr;
iEvent.getByToken(caloTauIDTokens_[i], caloTauIdDiscr);

if(!caloTauIdDiscr.isValid()){
edm::LogWarning("DataSource") << "Tau discriminator '" << tauIDSrcs_[i].first
<< "' has not been found in the event. It will not be embedded into the pat::Tau object.";
continue;
}
ids[i].first = tauIDSrcs_[i].first;
ids[i].second = getTauIdDiscriminator(caloTauCollection, idx, caloTauIdDiscr);
} else {
Expand Down

0 comments on commit 4feb9c9

Please sign in to comment.