Skip to content

Bound the LUT-smearing profile loop instead of scanning it - #343

Open
madantimalsina wants to merge 1 commit into
developfrom
fix/lut-smearing-loop
Open

madantimalsina wants to merge 1 commit into
developfrom
fix/lut-smearing-loop

Conversation

@madantimalsina

Copy link
Copy Markdown
Collaborator

In sum_light_signals the ENABLE_LUT_SMEARING branch iterated over every bin of the LUT time profile to find the bins landing inside the current time tick. The acceptance window is one tick wide (LIGHT_TICK_SIZE = 0.001 us = 1 ns) and profile bins are spaced 1 ns apart, so at most one bin can qualify: the loop ran ~100 iterations per surviving (detector, tick, track) to locate a single contributing bin.

Solve the acceptance condition for iprof and iterate only that range. The original predicate is retained inside the narrowed loop, so the bounds can only skip iterations the previous code already rejected and the selected bins are unchanged. Bounds are padded by one bin on each side so rounding in the division cannot clip an edge bin.

In sum_light_signals the ENABLE_LUT_SMEARING branch iterated over every
bin of the LUT time profile to find the bins landing inside the current
time tick. The acceptance window is one tick wide (LIGHT_TICK_SIZE =
0.001 us = 1 ns) and profile bins are spaced 1 ns apart, so at most one
bin can qualify: the loop ran ~100 iterations per surviving
(detector, tick, track) to locate a single contributing bin.

Solve the acceptance condition for iprof and iterate only that range.
The original predicate is retained inside the narrowed loop, so the
bounds can only skip iterations the previous code already rejected and
the selected bins are unchanged. Bounds are padded by one bin on each
side so rounding in the division cannot clip an edge bin.

This branch has not been deployed

No deployments
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.

1 participant