Skip to content

Billy hit finder fix#239

Open
MadivB wants to merge 2 commits into
developfrom
billy_hitFinderFix
Open

Billy hit finder fix#239
MadivB wants to merge 2 commits into
developfrom
billy_hitFinderFix

Conversation

@MadivB

@MadivB MadivB commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Two bug fixes in light simulation

  1. Fixes dynamic-threshold roll axis in light hit finder
  2. Fixes MC turth adc id definitions

MadivB added 2 commits June 10, 2026 12:08
np.roll without axis rolled the flattened (events, adc, chan, samples)
array, so the first n_bins_rolled samples of every waveform's rolling
threshold were seeded by the previous channel's tail (and wrapped across
the batch boundary, making output depend on batch slicing). Roll along
the sample axis and zero the pre-waveform history instead.
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.
@MadivB
MadivB requested a review from jroto June 15, 2026 16:01

@jroto jroto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready to merge. These bugs have been discussed here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants