Skip to content

Commit

Permalink
Add protection against a missing tauId source(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbluj committed Oct 26, 2017
1 parent f409fc9 commit 48c0759
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 @@ -315,6 +315,11 @@ void PATTauProducer::produce(edm::Event & iEvent, const edm::EventSetup & iSetup
edm::Handle<reco::PFTauDiscriminator> pfTauIdDiscr;
iEvent.getByToken(pfTauIDTokens_[i], pfTauIdDiscr);

if(!pfTauIdDiscr.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(pfTauCollection, idx, pfTauIdDiscr);
} else if ( typeid(*tausRef) == typeid(reco::CaloTau) ) {
Expand Down

0 comments on commit 48c0759

Please sign in to comment.