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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions source/actions/DefaultEventAction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ REGISTER_CLASS(DefaultEventAction, G4UserEventAction)
Trajectory* trj = dynamic_cast<Trajectory*>((*tc)[0]);
if (trj == nullptr){
G4Exception("[DefaultEventAction]", "EndOfEventAction()", FatalException,
"DefaultTrackingAction is required when using DefaultEventAction");
"The trajectory container is empty. If you are simulating optical photons as primary particles,"
" and not using OpticalTrackingAction, you should use the G4 default event action.");
}
for (unsigned int i=0; i<tc->size(); ++i) {
Trajectory* tr = dynamic_cast<Trajectory*>((*tc)[i]);
Expand All @@ -100,7 +101,9 @@ REGISTER_CLASS(DefaultEventAction, G4UserEventAction)
}
else {
G4Exception("[DefaultEventAction]", "EndOfEventAction()", FatalException,
"DefaultTrackingAction is required when using DefaultEventAction");
"The trajectory container doesn't exist. Check that you are using DefaultTrackingAction."
" Notice that, if you are simulating optical photons as primary particles, "
"and not using OpticalTrackingAction, you should not specify any event actions.");
}

PersistencyManager* pm = dynamic_cast<PersistencyManager*>
Expand Down
Loading