38 #ifdef G4MULTITHREADED 39 #include "G4MTRunManager.hh" 41 #include "G4RunManager.hh" 44 #include "G4UImanager.hh" 46 #include "FTFP_BERT.hh" 47 #include "G4OpticalPhysics.hh" 48 #include "G4EmStandardPhysics_option4.hh" 50 #include "WLSDetectorConstruction.hh" 52 #include "WLSActionInitialization.hh" 54 #include "G4VisExecutive.hh" 55 #include "G4UIExecutive.hh" 64 int main(
int argc,
char** argv)
67 G4UIExecutive* ui =
nullptr;
69 ui =
new G4UIExecutive(argc, argv);
72 #ifdef G4MULTITHREADED 73 G4MTRunManager * runManager =
new G4MTRunManager;
76 if (argc > 2) seed = atoi(argv[argc-1]);
80 G4Random::setTheEngine(
new CLHEP::RanecuEngine);
81 G4Random::setTheSeed(seed);
83 G4RunManager * runManager =
new G4RunManager;
89 WLSDetectorConstruction* detector =
new WLSDetectorConstruction();
90 runManager->SetUserInitialization(detector);
93 G4VModularPhysicsList* physicsList =
new FTFP_BERT;
94 physicsList->ReplacePhysics(
new G4EmStandardPhysics_option4());
95 G4OpticalPhysics* opticalPhysics =
new G4OpticalPhysics();
96 physicsList->RegisterPhysics(opticalPhysics);
97 runManager->SetUserInitialization(physicsList);
100 runManager->SetUserInitialization(
new WLSActionInitialization(detector));
103 G4VisManager* visManager =
new G4VisExecutive;
104 visManager->Initialize();
108 G4UImanager * UImanager = G4UImanager::GetUIpointer();
112 if (argc > 2) { optmax = optmax-1; }
116 G4String command =
"/control/execute ";
117 for ( ; optind < optmax; optind++)
119 G4String macroFilename = argv[optind];
120 UImanager->ApplyCommand(command+macroFilename);
123 #else // Simple UI for Windows runs, no possibility of additional arguments 126 G4String command =
"/control/execute ";
128 UImanager->ApplyCommand(command+fileName);
133 UImanager->ApplyCommand(
"/control/execute init.in");
135 UImanager->ApplyCommand(
"/control/execute gui.mac");
int main(int argc, char **argv)