diff --git a/src/flow2supera/driver.py b/src/flow2supera/driver.py index 47344d1..0f32a86 100644 --- a/src/flow2supera/driver.py +++ b/src/flow2supera/driver.py @@ -210,6 +210,7 @@ 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'] @@ -217,7 +218,7 @@ def ReadEvent(self, data, is_sim=True,verbose=False): 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: diff --git a/src/flow2supera/utils.py b/src/flow2supera/utils.py index 9864954..3168cad 100644 --- a/src/flow2supera/utils.py +++ b/src/flow2supera/utils.py @@ -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) @@ -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: