detector change might work - might
This commit is contained in:
+20
-14
@@ -1,7 +1,11 @@
|
||||
|
||||
#include "G4System.hh"
|
||||
|
||||
void G4System::init(ConstructionWrapper &CW, bool gui){
|
||||
void G4System::init(ConstructionWrapper &CW){
|
||||
|
||||
if(CW.isAssigned()){
|
||||
throw std::runtime_error("ConstructionWrapper already assigned");
|
||||
}
|
||||
|
||||
char* argv[]={(char*)"dummy"};
|
||||
|
||||
@@ -16,12 +20,11 @@ void G4System::init(ConstructionWrapper &CW, bool gui){
|
||||
}
|
||||
else{
|
||||
// Abort the current run
|
||||
runManager->AbortRun(true);
|
||||
|
||||
// Clear any pending events
|
||||
runManager->Clear();
|
||||
G4RunManager::GetRunManager()->AbortRun(true);
|
||||
first_init = false;
|
||||
|
||||
//delete actionInitialization;
|
||||
//delete detConstruction;
|
||||
//delete actionInitialization;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,24 +40,27 @@ void G4System::init(ConstructionWrapper &CW, bool gui){
|
||||
|
||||
runManager->SetUserInitialization(detConstruction);
|
||||
|
||||
auto physicsList = new FTFP_BERT;
|
||||
runManager->SetUserInitialization(physicsList);
|
||||
if(first_init){
|
||||
auto physicsList = new FTFP_BERT;
|
||||
runManager->SetUserInitialization(physicsList);
|
||||
|
||||
|
||||
actionInitialization = new B4a::ActionInitialization(detConstruction);
|
||||
runManager->SetUserInitialization(actionInitialization);
|
||||
|
||||
}
|
||||
if(! first_init){
|
||||
runManager->GeometryHasBeenModified();
|
||||
runManager->ReinitializeGeometry();
|
||||
runManager->PhysicsHasBeenModified();
|
||||
runManager->ReinitializePhysics();
|
||||
G4RunManager::GetRunManager()->GeometryHasBeenModified();
|
||||
G4RunManager::GetRunManager()->ReinitializeGeometry();
|
||||
}
|
||||
|
||||
// Initialize visualization
|
||||
if(visManager == nullptr){
|
||||
// Initialize visualization
|
||||
//
|
||||
visManager = new G4VisExecutive;
|
||||
// G4VisExecutive can take a verbosity argument - see /vis/verbose guidance.
|
||||
// G4VisManager* visManager = new G4VisExecutive("Quiet");
|
||||
|
||||
}
|
||||
visManager->Initialize();
|
||||
|
||||
// Get the pointer to the User Interface manager
|
||||
|
||||
Reference in New Issue
Block a user