Skip to content

Commit

Permalink
bugfix last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gipert committed Apr 4, 2024
1 parent e0e7661 commit 8246f74
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/pygama/evt/aggregators.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,19 +272,19 @@ def evaluate_at_channel(
out = None

for ch in np.unique(ch_comp.nda.astype(int)):
table_id = utils.get_table_name_by_pattern(table_id_fmt, ch)
table_name = utils.get_table_name_by_pattern(table_id_fmt, ch)
# skip default value
if table_id not in lh5.ls(f.hit.file):
if table_name not in lh5.ls(f.hit.file):
continue

idx_ch = tcm.idx[tcm.id == ch]
evt_ids_ch = np.searchsorted(
tcm.cumulative_length, np.where(tcm.id == ch)[0], "right"
)
if table_id not in channels_skip:
if table_name not in channels_skip:
res = utils.get_data_at_channel(
datainfo=datainfo,
ch=table_id,
ch=table_name,
tcm=tcm,
expr=expr,
field_list=field_list,
Expand Down Expand Up @@ -343,7 +343,8 @@ def evaluate_at_channel_vov(

type_name = None
for ch in channels:
table_id = utils.get_table_name_by_pattern(f.hit.table_fmt, ch)
table_id = utils.get_tcm_id_by_pattern(f.hit.table_fmt, ch)

evt_ids_ch = np.searchsorted(
tcm.cumulative_length, np.where(tcm.id == ch)[0], "right"
)
Expand All @@ -357,7 +358,7 @@ def evaluate_at_channel_vov(
pars_dict=pars_dict,
)
else:
idx_ch = tcm.idx[tcm.id == table_id]
idx_ch = tcm.idx[tcm.id == ch]
res = np.full(len(idx_ch), default_value)

# see in which events the current channel is present
Expand Down

0 comments on commit 8246f74

Please sign in to comment.