Error when running too many events in Geant4

_Geant4 Version: 11.2.1
_Operating System: MacOS 14.4

Dear Everyone,

I am running my Geant4 project successfully with no errors. I need to run a proton gun for more than 10^6 protons. I am using run.mac to do /run/beamOn 50000
Which is working properly and without any crashes. But as soon as I go above 50723 events for whatever reason, I get this error:

WARNING - Attempt to delete the physical volume store while geometry closed !
WARNING - Attempt to delete the logical volume store while geometry closed !
WARNING - Attempt to delete the solid store while geometry closed !
WARNING - Attempt to delete the region store while geometry closed !

Is there a particular reason behind it? Is there a bug in the code or very little storage space? Has someone else ever faced such an error message?

Thank you,
Khalil

You should be looking at the log file before that point. What error messages do you see?

Those lines happen if something calls ::exit() without calling the Geant4 “cleanup”/end-of-job code. Nothing in Geant4 itself does that. Do you have an if-block where you put in an ::exit(2) statement or an assert() condition?

Hello! Thank you for the suggestion, I have looked into the code and apparently, I am using a rootmanager class that has a maximum number of PannelHits assigned to it. I was able to extend the maximum number and it all worked out.

Thank you so much for the help.