Short version: Is there a way I can look up ion information (especially half-life) before starting the GeneratePrimaries
(ideally at BeginOfRunAction
)?
I am simulating a coincidence detector measuring gas activity that detects for a finite amount of time (on scale of ~10s of hours). I would like to have the amount of activity (and which isotopes are present) be configurable at runtime. Right now I do this by filtering events that take place (in global time) after the measurement time in my event code in EventAction::EndOfEventAction()
, killing secondaries generated with a global time > my measurement time in a StackingAction
, using (abusing?) TimeThresholdForRadioactiveDecay
in my hadronic physics. This works all right for relatively small activities, but when the numbers get large (or the half lives get long) it understandably slows down.
I’d like to speed this up by pre-calculating the number of decays based on input activity, and filtering based on event time. This should allow me to run fewer source particles.
The problem is that I would like to go from activity to number of decays but I don’t know (at compile time) which isotopes will be present in the sample. As of right now I look them up in the particle table at PrimaryGenerator::GeneratePrimaries
but if I’m pre-generating decay numbers then I think I need to use the half-life values before I begin to generate primary particles. That means that the ion table isn’t ready to use.
Is there a way I can look up ion information (especially half-life) before starting the GeneratePrimaries
(ideally at BeginOfRunAction
)?
Thanks
JR
Geant4 Version: 11.2.0
Operating System: macOS 14.4.1 | Ubuntu 22.04
Compiler/Version: Clang 15.0.0 | gcc 11.4.0
CMake Version: 3.28.1 | 3.22.1