-
Notifications
You must be signed in to change notification settings - Fork 36
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
Correct the sampling of discrete interactions for energy loss #209
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good extension!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice new capability and very nice implementation and testing! I have a couple of comments for discussion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my side, this MR is good to be merged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, Amanda! Nice work!
For energy loss processes the post-step energy will be different from the pre-step energy, so the assumption that the cross section is constant along the step is no longer valid. To correctly sample the interaction length, Geant4 uses the "integral approach", which uses MC integration to sample from the exact distribution. At the start of the step, the maximum cross section over the step
xs_max
is estimated and used for the process instead of the cross section at the pre-step energyE
. At the end of the step, if that process is selected, the cross section is recalculated at the post-step energyE'
and the discrete interaction occurs with probabilityxs(E') / xs_max
.