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

Fix Geant4 setup when single Coulomb scattering is enabled #1392

Merged
merged 10 commits into from
Sep 10, 2024

Conversation

amandalund
Copy link
Contributor

@amandalund amandalund commented Sep 5, 2024

This fixes a few little issues I encountered when trying to run celer-sim with Coulomb scattering enabled (but not the problems with the model limits described in #1391):

  • Construct G4Proton in the celer EM physics list when Coulomb scattering is enabled (fixes Geant4 error: G4ParticleDefinition should be created in PreInit state G4ParticleDefintion::G4ParticleDefinition(): 'PART101' failed)
  • Always construct G4eCoulombScatteringModel with the default value of isCombined (avoiding all zero cross sections).
  • Set the polar angle limit between SS and MSC to zero if single Coulomb scattering is used.

Fails for positrons with `src/celeritas/random/distribution/RejectionSampler.hh:90:
celeritas: precondition failed: fmax_ >= f_"`
- Construct proton when Coulomb scattering is enabled:
  `Geant4 error: G4ParticleDefinition should be created in PreInit state
  G4ParticleDefintion::G4ParticleDefinition(): 'PART101' failed`
- Always construct Coulomb scattering model with `isCombined=true` (cross
  sections are zero otherwise)
- Set polar angle limit between SS and MSC to zero if single Coulomb scattering
  is used
@amandalund amandalund added bug Something isn't working physics Particles, processes, and stepping algorithms labels Sep 5, 2024
@amandalund amandalund requested a review from sethrj September 5, 2024 19:30
@sethrj sethrj changed the title Fix a few issues when Coulomb scattering is enabled Fix Geant4 setup when single Coulomb scattering is enabled Sep 10, 2024
@sethrj sethrj enabled auto-merge (squash) September 10, 2024 16:20
@sethrj sethrj merged commit ff41203 into celeritas-project:develop Sep 10, 2024
31 checks passed
@amandalund amandalund deleted the coulomb-fixes branch September 10, 2024 20:22
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
None yet
Development

Successfully merging this pull request may close these issues.

2 participants