Outputting the number of decays


I’m building a radioactive decay simulation. I have a few questions about nuclear decay in Geant4. If I place a certain number of radioactive nuclei that will decay into a radioactive daughter, does the run end when all the parent nuclei decayed or when all the daughter isotopes decay? I’ve been doing two kinds of runs: placing the parent isotopes and getting the “granddaughter” isotope’s energy spectrum and placing the daughter isotope directly and having it decay. For the first version, I’m always getting more “granddaughter” counts than the second version, which I don’t understand.

To troubleshoot, I tried seeing how many daughter and granddaughter isotopes were present in the simulation by looking at GetParticleName and incrementing a variable each time a particle corresponds to the condition. I think this is called for each step, but I’d like to get it for each decay event. How could I go about doing this? Is there a way of knowing how many nuclear decays happen in simulation? Thanks in advance!

By default, Geant4 follows the whole decay chain, with all the daughters, and all the secondaries (de-excitation gammas, Auger electrons, whatever), until there are no tracks left. You can disable the decay-chain following if you want; see the rdecay examples.

That explains a lot. Thank you!