diff --git a/python/process.py b/python/process.py index f1835fc9cf..2b74c5c771 100644 --- a/python/process.py +++ b/python/process.py @@ -22,8 +22,11 @@ def get_entries(inpath: str) -> int: ''' nevents = None with ROOT.TFile(inpath, 'READ') as infile: - tt = infile.Get("events") - nevents = tt.GetEntries() + try: + nevents = infile.Get("events").GetEntries() + except AttributeError: + LOGGER.error('Input file is missing "events" TTree!\nAborting...') + sys.exit(3) return nevents