I would like to turn off the effects of neutrons in my simulation (to quickly scope out the magnitude of those effects). Off hand, it seems to me there would be 2 ways to do this: A) prevent created neutrons from interacting with anything (creating secondaries) after said neutrons are created, or B) turn off the production of neutrons altogether by any process.
For A), I assume I can simply kill the neutrons using track->SetTrackStatus(fStopAndKill) as in the forum post: How to kill particles below a given energy threshold for faster performance
(For my simulation purposes I think it is fine if energy is not conserved due to killing a particle). Would this be the way to achieve A?
Second, I am using geant4 v11.2.2 with the QBBC_EMZ physics list. I see the docs for this list discuss toggling neutrons via G4HadronicParameters. Does that mean I would achieve B) by calling SetEnableNeutronGeneralProcess(False)? Or does that do something different?
What kind of simulation are you running where you are generating a lot of neutrons? Computational time tends to be in the initial production rather than the tracking. Neutrons do not experience nearly as many interactions as electrons/positrons, gammas, and especially protons. Usually its at rest/low energy processes that can require a lot of steps to calculate for neutrons. That can be tuned with Neutron Killer processes that kill neutrons based on lifetime (such as 1 second).
Killing the track in the pre user tracking action probably the easiest. By far the biggest CPU gains would come from production cuts of charged secondaries which, for neutrons, would be protons (ions).
there is a third possibility :
/process/inactivate hadElastic
/process/inactivate neutronInelastic
/process/inactivate nCapture
/process/inactivate nFission
However, I am not sure that these commands still work with NeutronGeneralProcess …
Thank you very much for your replies! I tried to keep original post brief, so here’s more detail: I am running simulations for an xray detector in space. The neutrons do not directly affect the detector signal; they have an indirect effect in that secondaries they may create (or which are also created in the process where the neutron itself is created). I am just now coming to this project, inheriting it from others.
The move from a v10 of geant4 to a v11 results in a significant change in simulation results, which includes significantly more neutrons being produced. The increase in neutrons may or may not be related to the change in simulated signal we see. So the motivation for eliminating neutrons is not to save CPU time. Rather, I am looking for a quick way to vet or at least sniff out whether the new treatment of neutrons in v11 may be the possible cause for changes in our simulated signal between these geant4 versions.