#include "FTFP_BERT.hh" //Recommended for HEP applications #include "QGSP_BIC_HP.hh" //Recommended for medical applications #include "QGSP_BIC.hh" //No HP models for neutrons #include "G4EmPenelopePhysics.hh" //standard #include "DecayPhysics.hh" //custom #include "OpticalPhotonPhysics.hh" //custom #include "MyModularPhysicsList.hh" //custom PhysicsList derived from G4VModularPhysicsList #include "PhysicsList.hh" //custom PhysicsList derived from G4VUserPhysicsList // ... //In you main, when you have to set the mandatory initialization classes: G4bool IWantMPL = false; if (IWantMPL) { //Select a modular physics list (has the RegisterPhysics method): //method 1: Use the G4PhysListFactory and GetReferencePhysList method //G4PhysListFactory* physListFactory = new G4PhysListFactory(); //G4VModularPhysicsList* physicsList = physListFactory->GetReferencePhysList("QGSP_BIC_HP"); //method 2: call the constructor of the required ModularPhysicsList //QGSP_BIC* physicsList = new QGSP_BIC(); MyModularPhysicsList* physicsList = new MyModularPhysicsList(); //register new (custom) modules physicsList->RegisterPhysics(new DecayPhysics()); physicsList->RegisterPhysics(new OpticalPhotonPhysics()); //replace the defualt EM module of QGSP_BIC ((physicsList->ReplacePhysics(new G4EmPenelopePhysics()); runManager->SetUserInitialization(physicsList); } else { //select user PhysicsList runManager->SetUserInitialization(new PhysicsList()); } // ...