GammaToMuons "Invalid Command"

I’m trying to invoke the Gamma conversion to Muons feature in Geant4 10.03 using the command: /physics_list/em/GammaToMuons true . I am applying this command im my macro before the /initialise phase, however i get an error message back saying that the command is not recognised/is invalid. I need to invoke this seperately, as i also need the physics provided by the reference physics lists. Does anyone know why it is not recognising this command?

I believe the correct command is (from G4EmMessenger.cc)

/physics_lists/em/GammaToMuons true

Please note the s at the end of physics_lists.

Thanks for the response, this didn’t work either

Using a series of grep searches in the source code, it appears this command derives from G4EmExtraPhysics, which is included by default only in the QBBC physics list.

If you’re not using QBBC, and you have not manually added G4EmExtraPhysics to your chosen physics list (via the physlist->RegisterPhysics() action), then the GammaToMuons command won’t be available to you.

Hello,

I agree with Mike, that this UI command is available only in PhysicsList , in which constructor G4EmExtraPhysics is added. Note, that G4EmExtraPhysics is a part of any Reference PhysicsLists.

VI

Hi,

Thanks for the responses.

so do i need to edit the physics list i am using (FTFP_BERT_LIV) and add:
physlist->RegisterPhysics(G4EmExtraPhysics)
to the code somewhere?

Apologies for my lack of knowledge as i am new to Geant4 and Linux

Hello,

if you are using any of reference Physics Lists you do not need addition of G4EmExtraPhysics, because it is already there.I would suggest you to try out this UI command in simple example, like $G4INSTALL/examples/extended/hadronic/Hadr01

VI

Hello,

I am still having trouble turning on the GammaToMuon conversions. My code in the main file currently looks like this:
G4PhysListFactory;
G4ModularPhysicsList*physicsList=factory.ReferencePhysicsLists();
physicsList->SetVerboseLevel(1);
runManager->SetUserInitialization(physicsList);

The after this, i attempt to add the Muon processes using:
physicsList->RegisterPhysics(new G4EmExtraPhysics)
/physics_lists/em/GammaToMuons true
runManager->Initialize();

When i run this, i get the error “expected primary expression before /”
The simulations run fine without the addition of the Muon lines, however it is crucial to my work that i get this process working.

Any suggestions would be great,

Thanks, Jamie

If I understand this correctly, you inserted the line /physics_lists/em/GammaToMuons true in your source “.cc” code and the code does not compile. To correct this, change the code to

physicsList->RegisterPhysics(new G4EmExtraPhysics);
runManager->Initialize();
G4UImanager* uiManager = G4UImanager::GetUIpointer();
uiManager->ApplyCommand("/physics_lists/em/GammaToMuons true");

And hopefully it will work.

Seems to be resolved.