I’m trying to decrease the level of verbosity of my program, related to the the following output messages about the physics list used by my model (G4HadronElasticPhysicsHP, G4HadronPhysicsQGSP_BERT_HP, G4EmStandardPhysics, G4EmExtraPhysics, G4DecayPhysics, G4StoppingPhysics, G4IonPhysics, G4RadioactiveDecayPhysics):
Thank you very much! I used your function and it works well. The problem is that I noticed that the time spent by the simulation is the same in both cases, enabled or disabled stdout. Indeed, I want to reduce the time of the simulation lost by the verbosity.
In that case, you should compile Geant4 with -DGEANT4_BUILD_VERBOSE_CODE=OFF as suggested in the other Forum post (maybe also -DGEANT4_BUILD_STORE_TRAJECTORY if that’s enabled for you). Although for the initialization part, the options above will not change much. If you want to turn off most output from that, you can try adding this to your code (right after you create your run manager):
Ok thanks for your suggestion! I tried all the solutions provided, but Geant4 still works at the same speed with or without verbosity. At this point, I think it is a problem that should be fixed in the next versions of the code.
In case it helps, the verbosity level can be passed as a parameter to the PhyscisList constructor. If you don’t want any output from the physics list just instantiate it like this example:
int verboseLevel = 0; // set to zero for non-verbosity
G4VModularPhysicsList* phys = new QGSP_BERT_HP(verboseLevel);