Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent crash when reloading LIGHT_GAIN #108

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

mjkramer
Copy link
Member

@mjkramer mjkramer commented Dec 3, 2022

Previously, if set_light_properties were called a second time on a detector with a different number of optical channels as on the first call, loading of LIGHT_GAIN could crash as the "default" for detprop.get would be np.full(OP_CHANNEL_EFFICIENCY.shape, LIGHT_GAIN), where LIGHT_GAIN is an array with all of the channels of the first call, so the broadcast into OP_CHANNEL_EFFICIENCY.shape fails.

This was causing larnd-display to fail when configured with more than one geometry, since set_light_properties was getting called for both detectors.

Previously, if set_light_properties were called a second time on a
detector with a different number of optical channels as on the first call,
loading of LIGHT_GAIN could crash as the "default" for detprop.get would
be np.full(OP_CHANNEL_EFFICIENCY.shape, LIGHT_GAIN), where LIGHT_GAIN is
an array with all of the channels of the first call, so the broadcast
into OP_CHANNEL_EFFICIENCY.shape fails.
Copy link
Member

@krwood krwood left a comment

Choose a reason for hiding this comment

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

Confirmed this fixes the issues seen with the event display, but not clear if it effects the results of larnd-sim simulations or not.

larndsim/consts/light.py Show resolved Hide resolved
@krwood krwood merged commit b9ce41f into DUNE:master Feb 13, 2023
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