I have a question about the G4cout output using the Qt GUI.
If I have some G4cout in my code, for example in the SteppingAction and other classes, when I execute the command /run/beamOn the simulation starts, but all the cout are printed in the GUI at the end of the run.
And also, the GUI is like “frozen” during the Run (Windows say “not responds”).
Hi Andrea
I’m afraid the situation is exactly as you describe at the moment with the Qt GUI. In the past I have worked around it either by using std::out instead of G4cout or by writing to a file, which I can inspect even during a run (e.g., “less” in Unix). But be aware that for either of these workarounds in multithreading mode you have to do the mutex locking yourself (it is done for you in G4cout), as below.
Thanks a lot for this information, it will be very useful, specially for output to file!
I have found that in MT mode the G4cout works fine with the Qt GUI, in fact the output is printed during the simulation in the terminal window (I don’t know why not in the Qt GUI as in sequential mode, but that’s ok).