Skip to content

Commit

Permalink
fix problem with root_tree association event and trun/tshower, what can
Browse files Browse the repository at this point in the history
I do better ?
  • Loading branch information
luckyjim committed Mar 21, 2024
1 parent 258da9d commit a297132
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions grand/dataio/root_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,15 @@ def __init__(self, tt_event, f_name):
self.traces = np.empty((0, 3, 0), dtype=np.float32)
self.idx_event = -1
data_dir = groot.DataDirectory(os.path.dirname(f_name))
self.tt_shower = data_dir.tshower
self.tt_run = data_dir.trun
if f_name.find('_L0_') > 0:
self.tt_shower = data_dir.tshower_l0
self.tt_run = data_dir.trun_l0
elif f_name.find('_L1_') > 0:
self.tt_shower = data_dir.tshower
self.tt_run = data_dir.trun
else:
logger.exception("I don't know which version of trun/tshower is associated to event.")
raise
logger.info(f"file trun: {self.tt_run.file_name}\nfile tshower: {self.tt_shower.file_name}")
self.load_event_idx(0)

Expand Down

0 comments on commit a297132

Please sign in to comment.