35 #ifdef G4MULTITHREADED 36 #include "G4MTRunManager.hh" 38 #include "G4RunManager.hh" 41 #include "G4UImanager.hh" 43 #include "G4UIExecutive.hh" 44 #include "G4VisExecutive.hh" 46 #include "GeometryConstruction.hh" 48 #include "ActionInitialization.hh" 52 int main(
int argc,
char** argv) {
55 G4UIExecutive* ui =
nullptr;
56 if (argc == 1) ui =
new G4UIExecutive(argc,argv);
59 #ifdef G4MULTITHREADED 60 G4MTRunManager * runManager =
new G4MTRunManager;
61 G4int nThreads = G4Threading::G4GetNumberOfCores();
62 if (argc==3) nThreads = G4UIcommand::ConvertToInt(argv[2]);
63 runManager->SetNumberOfThreads(nThreads);
65 G4RunManager * runManager =
new G4RunManager;
69 GeometryConstruction* detector =
new GeometryConstruction;
70 runManager->SetUserInitialization(detector);
73 runManager->SetUserInitialization(
new ActionInitialization);
76 G4VisManager* visManager =
nullptr;
79 G4UImanager* UImanager = G4UImanager::GetUIpointer();
83 visManager =
new G4VisExecutive;
84 visManager->Initialize();
85 UImanager->ApplyCommand(
"/control/execute vis.mac");
91 G4String command =
"/control/execute ";
93 UImanager->ApplyCommand(command+fileName);
int main(int argc, char **argv)