Billy hit finder fix#239
Open
MadivB wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two bug fixes in light simulation