Skip to content

Conversation

@nvaytet
Copy link
Member

@nvaytet nvaytet commented Jan 31, 2026

Some monitors can be placed between choppers and even before the first choppers.
Until now, we only covered a range of distances in the tof lookup table that started after the last chopper in the cascade.

This PR generalizes the mechanism so we can build LUTs for the full beamline range.
For Odin, it now looks as follows:
Figure 1 (26)

Note that the SimulationResults class has changed, it is now a dict of event readings at various places along the beamline. Each reading is now essentially what the SimulationResults used to be before.
Note however that despite this change, no updates to the workflow that computes a LUT were necessary (e.g. notebooks for Odin and Dream).

The only small difference (apart from widening the LtotalRange) is that it is likely that we need to increase the LookupTableRelativeErrorThreshold parameter in these notebooks, as the mixing of wavelengths is high at small distances, before the first choppers.

lut_wf[time_of_flight.NumberOfSimulatedNeutrons] = 10_000
lut_wf[time_of_flight.LtotalRange] = (
sc.scalar(0.0, unit="m"),
sc.scalar(20.0, unit="m"),
Copy link
Member Author

Choose a reason for hiding this comment

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

Using 0 here raised the "No simulation reading found for distance -0.2m." error

# according to which component reading to use, we simply loop over distances one
# by one here.
for dist in distances:
# Find the correct simulation reading
Copy link
Member Author

Choose a reason for hiding this comment

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

Could optimize here instead of starting the search from the beginning every time, but not sure the added complexity (probably involving keeping track of an index for the relevant component reading) is worth the (probably minimal) performance gain?

@nvaytet nvaytet marked this pull request as ready for review January 31, 2026 23:25
@nvaytet nvaytet requested a review from SimonHeybrock January 31, 2026 23:25
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