Skip to content

Adds a debug stacking action with reproducible seeds

Miha Muskinja requested to merge mmuskinj/athena:21.0-debug-stacking into 21.0

This MR adds a debug version of the AthenaStackingAction with the purpose of using it for Russian Roulette algorithm validation. In the default stacking action, Geant4 seed changes when we remove a particle with the Russian Roulette for the subsequent particles which causes fluctuations in the distributions.

The debug stacking action moves the 'rouletted' particles at the end of the stack to keep the seeds of other particles the same and removes fluctuations. This is shown in the plots below:

Neutorn Russian Roulette:

Photon Russian Roulette

Implemented by using the AthenaStackingAction as a base class for the AthenaDebugStackingAction. Only the ClassifyNewTrack function is modified to allow for this seed control.

Three new simulation flags are added to accommodate configuration for this:

  • DebugStackingAction
  • ApplyNRR
  • ApplyPRR

This allows for the following configurations:

  1. Run NRR/PRR with the default stacking action (to be used in production)
--preInclude SimulationJobOptions/
  1. Run NRR/PRR with the debug stacking action
--preInclude SimulationJobOptions/
--preExec "EVNTtoHITS:simFlags.DebugStackingAction.set_Value_and_Lock(True)"
  1. Run NRR/PRR with the debug stacking action, but keep all particles
--preInclude SimulationJobOptions/
--preExec "EVNTtoHITS:simFlags.DebugStackingAction.set_Value_and_Lock(True)"
--preExec "EVNTtoHITS:simFlags.ApplyPRR.set_Value_and_Lock(False)"
Edited by Miha Muskinja

Merge request reports