Skip to content

Commit

Permalink
Protect against missing event branch
Browse files Browse the repository at this point in the history
  • Loading branch information
pastika committed Feb 14, 2020
1 parent 6a1a28e commit ef63b41
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion TopTagger/python/TopTagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,11 @@ def getTopsFromExampleFile(tt, event):

event.GetEntry(iEvt)

print "Event #:", event.event
try:
evtNum = getattr(event, options.evtBranch)
print "Event #:", evtNum
except AttributeError:
print "Event #:", iEvt

if options.example:
tops = getTopsFromExampleFile(tt, event)
Expand Down

0 comments on commit ef63b41

Please sign in to comment.