celeritas icon indicating copy to clipboard operation
celeritas copied to clipboard

Support decay in stepping loop

Open amandalund opened this issue 2 months ago • 3 comments

This adds initial support for decay in the stepping loop. Muon decay is currently the only decay channel supported, but adding additional channels should be straightforward now.

To easily support the different decay channel types (which may not have fixed daughter particle types, or may have an arbitrary number of daughters), this moves from using channel-specific data (e.g. MuDecayData) to the generic DecayChannelData and DecayTableData. Daughter particle IDs are passed to the interactor and are expected to be in a specific order (this should be validated in the DecayChannel constructor).

Changes include:

  • Add decay input structs
  • Import decay tables from Geant4 for particles that have the decay process enabled
  • Rename Process to InteractionProcess and add a new DecayProcess (used for all particle types that decay)
  • Add DecayChannel which extends from CoreStepActionInterface, responsible for validating decay table input and launching kernels for interactors
  • Add MuDecayChannel derived class
  • Refactor MuDecayInteractor to use generic decay data
  • Store decay tables and mapping from channel ID to action ID in physics data
  • Include decay as a step limiter, calculating cross section from decay constant
  • Sample decay process from among other discrete processes in select_discrete_interaction
  • If decay is selected, sample decay channel according to branching ratios

I haven't added any tests yet (only checked that running celer-g4 on a simple problem with muon decay imports the data and interacts by decay without any failures), but otherwise this should be ready for a first look.

See #1375

amandalund avatar Sep 27 '25 14:09 amandalund

Test summary

 4 576 files   7 305 suites   14m 23s :stopwatch:  1 993 tests  1 975 :white_check_mark: 18 :zzz: 0 :x: 25 456 runs  25 361 :white_check_mark: 95 :zzz: 0 :x:

Results for commit 08a2f1f0.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Sep 27 '25 15:09 github-actions[bot]

@amandalund I am mostly off this week, but I can catch up on this MR later if a second review is needed.

whokion avatar Sep 29 '25 15:09 whokion

Thanks @sethrj for the comments! I'll look over the rest soon, but just to clarify it's one step action per channel, not per channel per particle type (I don't think we'd want that!)

@whokion no worries, enjoy the time off! If you have a chance when you're back I'd definitely appreciate your review to make sure I've got the physics right.

amandalund avatar Sep 29 '25 16:09 amandalund