Repository navigation
Conversation
Pixel response NPZ tables (larnd-sim's, and config/pixel_response.npz) sample the quadrant at bin centres, x_k = (k + 1/2) * bin from the pixel centre. interpolate_pixel_response_kernel read bin k at x = k * bin, so every lookup was half a bin too far out. Charge on pixel edges was lost. With 10 bins per pitch and diffusion off, the total charge collected by all output pixels averaged 0.81 of the pad-sum (0.9 per axis), and fell to 0.016 near a pixel corner. - Read distance d (in bins) at max(d - 1/2, 0). Within half a bin of the centre the mirror neighbour of bin 0 is bin 0, so the clip is exact. - Pad the 3-D diffusion table with mode='symmetric' instead of 'reflect'. 'reflect' assumes a sample at the centre; the bin-centre grid has none. The table format and output shapes are unchanged. Gradients with respect to the sub-pixel offset still match finite differences away from the interpolation kinks. Adds tests/test_pixel_kernel_grid.py: total charge equals the pad-sum within 1e-3 at 20x20 offsets, with and without transverse diffusion. It fails before this change.
This branch has not been deployed
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.
Pixel response NPZ tables (larnd-sim's, and config/pixel_response.npz) sample the quadrant at bin centres, x_k = (k + 1/2) * bin from the pixel centre. interpolate_pixel_response_kernel read bin k at x = k * bin, so every lookup was half a bin too far out. Charge on pixel edges was lost. With 10 bins per pitch and diffusion off, the total charge collected by all output pixels averaged 0.81 of the pad-sum (0.9 per axis), and fell to 0.016 near a pixel corner.
The table format and output shapes are unchanged. Gradients with respect to the sub-pixel offset still match finite differences away from the interpolation kinks.
Adds tests/test_pixel_kernel_grid.py: total charge equals the pad-sum within 1e-3 at 20x20 offsets, with and without transverse diffusion. It fails before this change.