Skip to content

Commit 02916d7

Browse files
authored
Merge pull request #184 from DUNE/feature_light_memory
merge light wvfm mc assn in the output
2 parents 2346070 + ba5350c commit 02916d7

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

larndsim/detector_properties/2x2.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ light_window: [0, 16] # us
6161
light_trig_window: [1.6, 14.4] # us
6262
light_digit_sample_spacing: 0.016 # us
6363
light_nbit: 14
64-
max_light_truth_ids: 3 # set to zero to disable light truth backtracking
64+
max_light_truth_ids: 0 # set to zero to disable light truth backtracking
6565
mc_truth_threshold: 1 # pe/us

larndsim/detector_properties/2x2_mod2mod_variation.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ light_window: [0, 16] # us
6161
light_trig_window: [1.6, 14.4] # us
6262
light_digit_sample_spacing: 0.016 # us
6363
light_nbit: 14
64-
max_light_truth_ids: 3 # set to zero to disable light truth backtracking
64+
max_light_truth_ids: 0 # set to zero to disable light truth backtracking
6565
mc_truth_threshold: 1 # pe/us

larndsim/detector_properties/2x2_non_beam.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ light_window: [0, 16] # us
6161
light_trig_window: [1.6, 14.4] # us
6262
light_digit_sample_spacing: 0.016 # us
6363
light_nbit: 14
64-
max_light_truth_ids: 3 # set to zero to disable light truth backtracking
64+
max_light_truth_ids: 0 # set to zero to disable light truth backtracking
6565
mc_truth_threshold: 1 # pe/us

larndsim/light_sim.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -736,10 +736,19 @@ def merge_module_light_wvfm_same_trigger(output_filename):
736736
for i_, i_mod in enumerate(detector.MOD_IDS):
737737
if i_ == 0:
738738
merged_wvfm = f[f'light_wvfm/light_wvfm_mod{i_mod-1}']
739+
if 'light_wvfm_mc_assn' in f.keys():
740+
merged_wvfm_mc_assn = f[f'light_wvfm_mc_assn/light_wvfm_mc_assn_mod{i_mod-1}']
739741
else:
740742
mod_wvfm = f[f'light_wvfm/light_wvfm_mod{i_mod-1}']
741743
if mod_wvfm.shape[0] != merged_wvfm.shape[0]:
742-
raise ValueError("The number of triggers should be the same in each module with light trigger mode 1.")
744+
raise ValueError("The number of triggers should be the same in each module with light trigger mode 1 (light waveform).")
745+
if 'light_wvfm_mc_assn' in f.keys():
746+
mod_wvfm_mc_assn = f[f'light_wvfm_mc_assn/light_wvfm_mc_assn_mod{i_mod-1}']
747+
if mod_wvfm_mc_assn.shape[0] != merged_wvfm_mc_assn.shape[0]:
748+
raise ValueError("The number of triggers should be the same in each module with light trigger mode 1 (light waveform mc assn).")
743749
merged_wvfm = np.append(merged_wvfm, mod_wvfm, axis=1)
750+
merged_wvfm_mc_assn = np.append(merged_wvfm_mc_assn, mod_wvfm_mc_assn, axis=1)
744751
del f['light_wvfm']
752+
del f['light_wvfm_mc_assn']
745753
f.create_dataset(f'light_wvfm', data=merged_wvfm, maxshape=(None,None,None))
754+
f.create_dataset(f'light_wvfm_mc_assn', data=merged_wvfm_mc_assn, maxshape=(None,None,None))

0 commit comments

Comments
 (0)