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

Improve the error message when using opt photons as primary #251

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

paolafer
Copy link
Contributor

Optical photons' trajectories are not stored in the simulation when using DefaultTrackingAction, to avoid creating huge output files. If one wants to save them, OpticalTrackingAction should be used instead, only for small productions and debugging.
On the other hand, DefaultEventAction tries to access the trajectory container, to look for the hits associated with every particle and make a cut on the total deposited energy.
As a consequence, the combination of DefaultTrackingAction and DefaultEventAction produces a segmentation fault in simulations of optical photons as primary particles, since no other particles are present in the simulation.
For the same reason, using DefaultEventAction but not DefaultTrackingAction in standard simulations also causes a segmentation fault.
This PR tries to improve the error message to cover these two cases, which are the most common causes of that particular segmentation fault.

@paolafer paolafer requested a review from Aretno March 22, 2024 15:29
Copy link
Contributor

@Aretno Aretno left a comment

Choose a reason for hiding this comment

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

The error message is now much clearer and points directly to the issue. Nice!

@paolafer paolafer merged commit e74209a into next-exp:master Mar 25, 2024
1 check passed
@paolafer paolafer deleted the improve-msg branch March 25, 2024 09:22
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