Skip to content

Commit 9765bdb

Browse files
committed
PATTauProducer.cc: try-catch causing problem when running PATTaus in HLT Tau DQM. Fixed to check the return value of getByToken()
1 parent 6792b7d commit 9765bdb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

PhysicsTools/PatAlgos/plugins/PATTauProducer.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,7 @@ void PATTauProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
287287

288288
// Get the collection of taus from the event
289289
edm::Handle<edm::View<reco::BaseTau>> anyTaus;
290-
try {
291-
iEvent.getByToken(baseTauToken_, anyTaus);
292-
} catch (const edm::Exception& e) {
290+
if (!iEvent.getByToken(baseTauToken_, anyTaus)) {
293291
edm::LogWarning("DataSource") << "WARNING! No Tau collection found. This missing input will not block the job. "
294292
"Instead, an empty tau collection is being be produced.";
295293
auto patTaus = std::make_unique<std::vector<Tau>>();

0 commit comments

Comments
 (0)