6 #include "GaudiKernel/ServiceHandle.h"
9 #include "G4VUserPhysicsList.hh"
10 #include "G4VModularPhysicsList.hh"
11 #include "G4ParallelWorldPhysics.hh"
12 #include "G4RunManager.hh"
15 : base_class(
name,pSvcLocator)
24 auto* rm = G4RunManager::GetRunManager();
27 return StatusCode::FAILURE;
31 if (!
m_isMT && rm->ConfirmBeamOnCondition()) {
32 rm->RunInitialization();
41 G4VModularPhysicsList* thePhysicsList=
dynamic_cast<G4VModularPhysicsList*
>(
m_physicsListSvc->GetPhysicsList());
42 if (!thePhysicsList) {
43 ATH_MSG_FATAL(
"Failed dynamic_cast!! this is not a G4VModularPhysicsList!");
44 return StatusCode::FAILURE;
46 #if G4VERSION_NUMBER >= 1010
47 std::vector<std::string>& parallelWorldNames=
m_detGeoSvc->GetParallelWorldNames();
48 for (
auto&
it: parallelWorldNames) {
49 thePhysicsList->RegisterPhysics(
new G4ParallelWorldPhysics(
it,
true));
54 return StatusCode::SUCCESS;