G4 doesn't run in graphics mode when physics list specified

Hi all,

as per subject line. Runs fine in batch mode. Code is based on TestEm7.

Any ideas why?

Regards

Tim

?? More details please. ??

Hi John,

how’s your lockdown going? I’m running out of real work. Of the paying variety.

Error message isn’t very helpful I’m afraid:

#/testem/phys/addPhysics local
#/testem/phys/addPhysics standard
#/testem/phys/addPhysics emstandard_opt3
/testem/phys/addPhysics QGSP_BIC
***** Illegal application state </testem/phys/addPhysics QGSP_BIC> *****
***** Batch is interrupted!! *****

As mentioned, in batch mode it’s fine.

Whilst on this subject if a physics list isn’t specified what does G4 default to?

Regards from Warrington,

Tim

Hi Tim

From sunny Hebden Bridge…I’m finding my Geant4 colleagues are being even more industrious than usual in these unusual times!!!

The problem is that in interactive mode vis.mac is executed and, within vis.mac, the run is initialised (/run/initialize). The workaround is to delete/comment out

UImanager->ApplyCommand("/control/execute vis.mac");

in TestEm7.cc, which will give you chance to addPhysics, then you can invoke vis.mac “manually” with /control/execute vis.mac.

We are looking into the wisdom of this design and may decide to split the macro in future.

As for your second question, you always have to supply a physics list, but there are umpteen “reference physics lists” - see http://geant4-userdoc.web.cern.ch/geant4-userdoc/UsersGuides/PhysicsListGuide/html/index.html - and all you have to do is, for example (see examples/basic/b2/B2a/exampleB2a.cc):

#include “FTFP_BERT.hh”

G4VModularPhysicsList* physicsList = new FTFP_BERT;

runManager->SetUserInitialization(physicsList);

Take care

John

Thanks John. I’ll give that a bash.

T

Cheers mate. Worked a treat. I owe you a beer.

T