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

Add positron correction for SB sampling #247

Merged
merged 6 commits into from Jun 3, 2021

Conversation

sethrj
Copy link
Member

@sethrj sethrj commented Jun 1, 2021

This refactors the SB energy distribution into two parts:

  • a non-templated component that sets up the energy sampling function and calculates the bounding cross section; and
  • a component templated on a "correction factor" that samples an energy, gets the cross section at that energy from the non-template component and multiplies by a scaling factor (1 for electrons, the result of SBPositronXsCorrector for positrons), and rejects based on a random number and the maximum (scaled) cross section.

I added tests that demonstrate:

  • nothing about the electron sampling changes
  • the sampling efficiency does not change for a constant non-unity value for the scaling factor
  • the sampling efficiency decreases slightly for positrons (since the scaled cross section shape is more pronounced/less flat)

@sethrj sethrj added the physics Particles, processes, and stepping algorithms label Jun 1, 2021
@sethrj sethrj added this to In progress in v0.1.0 via automation Jun 1, 2021
Copy link
Contributor

@amandalund amandalund left a comment

Choose a reason for hiding this comment

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

Nice, @sethrj! Looks good to me once the build passes.

src/physics/em/detail/SeltzerBergerInteractor.i.hh Outdated Show resolved Hide resolved
Copy link
Contributor

@vrpascuzzi vrpascuzzi left a comment

Choose a reason for hiding this comment

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

Looks good! +1 to @amandalund's suggestion.

v0.1.0 automation moved this from In progress to Review in progress Jun 2, 2021
@sethrj sethrj merged commit 1729c78 into celeritas-project:master Jun 3, 2021
v0.1.0 automation moved this from Review in progress to Done Jun 3, 2021
@sethrj sethrj deleted the sb-positron-correction branch June 3, 2021 19:24
@sethrj sethrj mentioned this pull request Jun 10, 2021
6 tasks
@sethrj sethrj added the enhancement New feature or request label Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request physics Particles, processes, and stepping algorithms
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants