Skip to content

Commit

Permalink
Do not try to save ext_trig when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Fogarty committed Aug 29, 2023
1 parent be056d0 commit d146887
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions charge_reco/charge_clustering.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,9 @@ def run_reconstruction(input_config_name, input_filepath, output_filepath):
f['hits'].resize((f['hits'].shape[0] + hits.shape[0]), axis=0)
f['hits'][-hits.shape[0]:] = hits
hits_max_cindex = np.max(hits['cluster_index'])+1
f['ext_trig'].resize((f['ext_trig'].shape[0] + ext_trig.shape[0]), axis=0)
f['ext_trig'][-ext_trig.shape[0]:] = ext_trig
if len(ext_trig) > 0:
f['ext_trig'].resize((f['ext_trig'].shape[0] + ext_trig.shape[0]), axis=0)
f['ext_trig'][-ext_trig.shape[0]:] = ext_trig

index_start += batch_size
index_end += batch_size
Expand Down

0 comments on commit d146887

Please sign in to comment.