Skip to content

Commit

Permalink
fix data filling after change with unassociated edeps. Unit test passed
Browse files Browse the repository at this point in the history
  • Loading branch information
sindhu-ku committed Aug 30, 2024
1 parent 34eeed1 commit e9224ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/flow2supera/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,15 @@ def ReadEvent(self, data, is_sim=True,verbose=False):

if not is_sim:
hits = data.hits
self._edeps_unassociated.reserve(len(hits))
for i_ht, hit in enumerate(hits):
edep = supera.EDep()
edep.x = hit['x']
edep.y = hit['y']
edep.z = hit['z']
edep.t = hit['t_drift']
edep.e = hit['E']
supera_event.unassociated_edeps.push_back(edep)
self._edeps_unassociated.push_back(edep)
return supera_event

if data.trajectories is None:
Expand Down
4 changes: 2 additions & 2 deletions src/flow2supera/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def run_supera(out_file='larcv.root',
if save_log: logger['time_read'].append(time_read)

t1 = time.time()
EventInput = driver.ReadEvent(input_data)
EventInput = driver.ReadEvent(input_data, is_sim=reader._is_sim)
time_convert = time.time() - t1
print("[run_supera] data conversion {:.3e} seconds".format(time_convert))
if save_log: logger['time_convert'].append(time_convert)
Expand All @@ -279,7 +279,7 @@ def run_supera(out_file='larcv.root',

t3 = time.time()
tensor_hits = writer.get_data("sparse3d", "hits")
driver.Meta().edep2voxelset(EventInput.unassociated_edeps).fill_std_vectors(id_v, value_v)
driver.Meta().edep2voxelset(driver._edeps_unassociated).fill_std_vectors(id_v, value_v)
larcv.as_event_sparse3d(tensor_hits, meta, id_v, value_v)

else:
Expand Down

0 comments on commit e9224ae

Please sign in to comment.