Hello Geanters,
my question is in principle quite simple, but I haven’t found an answer.
I implemented a simple class to read LUND format files (pure ASCII). Perhaps I am re-inventing the wheel, but I see it as an programming exercise.
Everything works fine, open, reads and closes when finished the run. But the caveat is that it works, if the number of events in the file is same or smaller than the number of events invoked. So, I want to implement a condition to stop the run if the reader finds an eof.
I tried to call the RunManager and AbortRun(), but, at least in serial mode (for me the best for debugging), it moves to the event (which it found the eof), stop.
I just tried to declare the readfile method as bool, and return false for eof, so more or less works, but not enough.
For instance, my file has 2 events, I run/beamOn 5 events, the code process 0 and 1, try to read the file, starts 2, practically empty, and stop the run.
I would like to know if there is a way to stop the run (and the event) as soon the code finds the eof condition.
Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!
Geant4 Version: geant4-11-02
Operating System: Fedora Linux 40
Compiler/Version: gcc (GCC) 14.2.1 20240912
CMake Version: cmake version 3.30.5