Skip to content

Commit 570948f

Browse files
committed
Fix per-module channel map slicing in light MC truth generation
adc0 = imod // adc_per_mod * adc_per_mod rounds the module index down as if it were an ADC index, so every module m > 0 sliced another module's block of the channel map. The resulting global SiPM indices all fall below the module's offset, get clamped to -1, and np.take then reads the last SiPM of the module's light_dat for every cell: each mc_truth/light_module{m} (m > 0) row holds one SiPM's truth copied into all adc_per_mod x n_channels cells (verified bitwise against the paired LARNDSIM light_dat). Module 0 and the single-dataset (2x2) path are unaffected, as are the waveforms, which are remapped with the full channel map in next(). Use adc0 = imod * adc_per_mod so each module slices its own rows.
1 parent fcbf815 commit 570948f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/proto_nd_flow/reco/light/mc_event_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def init(self):
218218
for imod in range(nmod):
219219
in_name = f'light_dat_module{imod}'
220220
this_light_dat = self.light_dat[in_name]
221-
adc0 = imod // adc_per_mod * adc_per_mod
221+
adc0 = imod * adc_per_mod
222222
this_channel_map = self.channel_map[adc0:adc0+adc_per_mod]
223223
out_name = f'{self.mc_truth_dset_name}_module{imod}'
224224
self.data_manager.create_dset(out_name, dtype=this_light_dat.dtype,

0 commit comments

Comments
 (0)