From cee740716c81e91260de78345f761719d841da9b Mon Sep 17 00:00:00 2001 From: Jan Kieseler Date: Thu, 21 Sep 2023 00:10:37 +0200 Subject: [PATCH] changing geometry now seems to work --- src/G4System.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/G4System.cc b/src/G4System.cc index fa3b4e4..49c5220 100644 --- a/src/G4System.cc +++ b/src/G4System.cc @@ -38,10 +38,8 @@ void G4System::init(ConstructionWrapper &CW){ // detConstruction = new B4::DetectorConstruction(&CW); - - runManager->SetUserInitialization(detConstruction); - if(first_init){ + runManager->SetUserInitialization(detConstruction); auto physicsList = new FTFP_BERT; runManager->SetUserInitialization(physicsList); @@ -52,7 +50,8 @@ void G4System::init(ConstructionWrapper &CW){ actionInitialization->setDetectorConstruction(detConstruction); G4RunManager::GetRunManager()->GeometryHasBeenModified(); - G4RunManager::GetRunManager()->ReinitializeGeometry(); + G4RunManager::GetRunManager()->ReinitializeGeometry(true); + //runManager->SetUserInitialization(detConstruction); } if(visManager == nullptr){ @@ -134,6 +133,7 @@ void G4System::run_gui(){ } void G4System::run_batch(int nEvents,const std::string& partSpecies, double minEnergy, double maxEnergy){ + check(); G4String partSpec = partSpecies; G4cout << "running with particle species " << partSpec << G4endl; UImanager->ApplyCommand("/run/initialize");