Crash After Opening Root Analysis File

Quite new to using the analysis manager in Geant4. Trying to use it to output energy deposition of hits in ntuples in a root file format. My executable builds without any errors, but when I use the command /run/beamOn to start a run I get the following issue, where a root file is opened, and then the executable is exited.

GeDetectorCrashAfterOpeningFile

There are no errors or anything, the program just exits. I can’t imagine what the problem is, I’ve made sure to include the Write() and CloseFile() methods.

Any help would be much appreciated.

Hello,

It is not easy to guess what gets wrong from the information you provide. Can you confirm that your application runs ok when you inactivate the analysis code (by commenting out the relevant lines)?

If so, can you add a printing (with G4cout) just after OpenFile() call, to see that the program crash really happens a this line?

Or, if you can run in a debugger, providing a back-trace could also help.

Best regards,

Hi Ivana,

Thank you for the reply. I managed to resolve the issue.