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

Correct the sampling of discrete interactions for energy loss #209

Merged
merged 3 commits into from Apr 15, 2021

Conversation

amandalund
Copy link
Contributor

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 energy E. At the end of the step, if that process is selected, the cross section is recalculated at the post-step energy E' and the discrete interaction occurs with probability xs(E') / xs_max.

@amandalund amandalund requested a review from sethrj April 9, 2021 03:05
@amandalund amandalund added the physics Particles, processes, and stepping algorithms label Apr 9, 2021
@sethrj sethrj requested a review from whokion April 9, 2021 07:19
Copy link
Contributor

@whokion whokion left a comment

Choose a reason for hiding this comment

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

Good extension!

src/physics/base/PhysicsParams.cc Outdated Show resolved Hide resolved
src/physics/base/PhysicsParams.hh Outdated Show resolved Hide resolved
src/physics/base/PhysicsStepUtils.i.hh Outdated Show resolved Hide resolved
src/physics/base/PhysicsStepUtils.i.hh Outdated Show resolved Hide resolved
src/physics/base/PhysicsTrackView.i.hh Outdated Show resolved Hide resolved
src/physics/base/PhysicsTrackView.i.hh Outdated Show resolved Hide resolved
src/physics/base/PhysicsTrackView.i.hh Outdated Show resolved Hide resolved
src/physics/base/PhysicsTrackView.i.hh Show resolved Hide resolved
Copy link
Member

@sethrj sethrj left a 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.

src/physics/base/PhysicsParams.cc Outdated Show resolved Hide resolved
src/physics/base/PhysicsParams.cc Outdated Show resolved Hide resolved
src/physics/base/PhysicsParams.hh Outdated Show resolved Hide resolved
src/physics/base/PhysicsStepUtils.i.hh Outdated Show resolved Hide resolved
src/physics/base/PhysicsTrackView.i.hh Outdated Show resolved Hide resolved
src/physics/base/PhysicsTrackView.hh Outdated Show resolved Hide resolved
src/physics/base/PhysicsInterface.hh Outdated Show resolved Hide resolved
test/physics/base/Physics.test.cc Show resolved Hide resolved
@sethrj sethrj mentioned this pull request Apr 11, 2021
23 tasks
@sethrj sethrj added this to In progress in v0.1.0 via automation Apr 11, 2021
@sethrj sethrj moved this from In progress to Review in progress in v0.1.0 Apr 11, 2021
Copy link
Contributor

@whokion whokion left a 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.

src/physics/base/PhysicsTrackView.i.hh Outdated Show resolved Hide resolved
Copy link
Member

@sethrj sethrj left a 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!

@sethrj sethrj merged commit 79814fb into celeritas-project:master Apr 15, 2021
v0.1.0 automation moved this from Review in progress to Done Apr 15, 2021
@amandalund
Copy link
Contributor Author

Thanks @whokion and @sethrj for the reviews!

@amandalund amandalund deleted the integral branch February 17, 2022 21:37
@sethrj sethrj added the bug Something isn't working label Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working physics Particles, processes, and stepping algorithms
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants