Skip to content

Commit

Permalink
Support track_ids in mc_assn for older files
Browse files Browse the repository at this point in the history
  • Loading branch information
mjkramer committed Dec 21, 2023
1 parent 5ce3e2d commit afdaefe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/proto_nd_flow/reco/charge/raw_event_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,9 @@ def next(self):
# write mc data to file
mc_assn = (np.concatenate(event_mc_assn, axis=0)
if len(event_mc_assn) else np.full((0,), -1, dtype=self.mc_assn.dtype))
mc_assn_mask = (mc_assn['segment_ids'] == -1) | (mc_assn['fraction'] == 0.)
event_tracks = ma.array(mc_assn['segment_ids'], mask=mc_assn_mask)
id_field = 'segment_ids' if 'segment_ids' in mc_assn.dtype.fields else 'track_ids'
mc_assn_mask = (mc_assn[id_field] == -1) | (mc_assn['fraction'] == 0.)
event_tracks = ma.array(mc_assn[id_field], mask=mc_assn_mask)
event_packet_fraction = ma.array(mc_assn['fraction'], mask=mc_assn_mask)

# set up packet references
Expand Down

0 comments on commit afdaefe

Please sign in to comment.