How to deal with vast amount of tracks due to atomic deexcitation processes when starting with high energy primary particles


I hope that I am in the correct category with my question.

So, in our simulation, we are interested in very low energy signals in our detectors, i.e. energy depositions even down to eV-Scale. Therefore, we set the lower production cut limit to the recommended low energy applicability limit of 250 eV in our PhysicsList via G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(250eV, 1GeV). Additionally, we activate atomic deexcitation processes (fluo, auger, augerCascade, pixe) and choose to ignore the production cut for them via ‘/process/em/deexcitationIgnoreCut true’.

Now, if we simulate high energy particles (e.g. particles of the leptonic component of cosmic rays), which could sometimes lead to low energy secondaries (giving a signal in the detector), it can of course also happen that a very high energetic particle traverses our sensitive volumes, and this seems to pose some problems for our simulation (regarding memory usage).

An event with a GeV primary e- can sometimes lead to a few million tracks created in a single event (easily leading to as many hits as well). As these data are kept in memory to be written to a root tree in a designated output file at the end of the event, the random access memory used during the simulation of such an event can quickly rise up to ~10 GB (although after writing all the data to the tree, the tree may only have ~10-100 MB), which often leads to the simulation being killed.

So, one question would be: Is a memory consumption of ~10 GB normal in such an event?

If we set ‘/process/em/deexcitationIgnoreCut false’, the same events which gave a few million tracks before, only give a few 10.000 events, which would basically solve most of the problem, but may lead to us losing some information.

Do you have any other suggestions for the settings of such a simulation?
Maybe we could define different regions with different production cuts (and deexcitation processes)? This may still pose a problem, if a high energy particle traverses a detector, though. So, maybe an additional biasing in the SteppingAction would have to be introduced, which kills high energy particles that enter a detector.

I am looking forward to your suggestions or hints.

Best regards,