I am a very beginner user of Geant4 and this is my first post on the forum.
I received a ready-made macro to run the simulation.
However, it lacks the implementation of the hadronic interaction. I added the hadronic interaction in the PhysicsList.cc file.
My question is: where, apart from the PhysicsList.cc file, do I need to change the code so that the simulation takes into account the hadronic interaction?
An easy and direct way to do this is directly include FTFB_BERT in your main cc file. Here is the link for your reference (FTFP_BERT β Geant4 Documentation 11.2 documentation)
Example B5 has implemented it, you can check that one.
auto physicsList = new FTFP_BERT;
physicsList->RegisterPhysics(new G4StepLimiterPhysics());
runManager->SetUserInitialization(physicsList);
My impression is that the hadronic physics data libraries are not set correctly. Or that particles are defined (e.g. pions) but no physics processes are instantiated. Could you please use a pre-built physics list of Geant4? e.g. QGSP_BIC_HP or any other one.
Thank you very much. I think I understand what this list is about now. I added it to simPion.mac /physics_list/select QGSP_BIC
before /run/initialize.
When I run the simulation I now get an error message:
/physics_list/select QGSP_BIC
***** COMMAND NOT FOUND </physics_list/select QGSP_BIC> *****
***** Batch is interrupted!! *****
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception: UIMAN0123
issued by: G4UImanager::ApplyCommand
Command aborted (100)
Error code : 100
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
I have to use Geant4 10.7.4 because only this version is compatible with my macro. Why the command
/physics_list/select QGSP_BIC is not correct?
but the message will be the same.
I had to replace GetReferencePhysicsList with GetReferencePhysList.
Maybe this command is not supported in Geant4 10.7.4?
It looks like it isnβt (my mistake in reading your earlier message). I had to go to the Geant4 sources to find out. In G4 10.7, the G4PhysListFactoryMessenger class creates a β/physics_lists/β directory (note the plural), which does not include commands to select a physics list at run time.
I cannot find a /physics_list/... command directory anywhere in the G4 source, not in G4 10.* nor in G4 11.*. Did you get that from one of the Geant4 examples?