37 #ifdef G4MULTITHREADED 38 #include "G4MTRunManager.hh" 40 #include "G4RunManager.hh" 43 #include "G4UImanager.hh" 45 #include "Randomize.hh" 47 #include "WLSPhysicsList.hh" 48 #include "WLSDetectorConstruction.hh" 50 #include "WLSActionInitialization.hh" 53 #include "G4VisExecutive.hh" 57 #include "G4UIExecutive.hh" 67 int main(
int argc,
char** argv)
69 #ifdef G4MULTITHREADED 70 G4MTRunManager * runManager =
new G4MTRunManager;
73 if (argc > 2) seed = atoi(argv[argc-1]);
77 G4Random::setTheEngine(
new CLHEP::RanecuEngine);
78 G4Random::setTheSeed(seed);
80 G4RunManager * runManager =
new G4RunManager;
87 while ((c=getopt(argc,argv,
"p")) != -1)
93 G4cout <<
"Physics List used is " << physName << G4endl;
97 "Option -%c requires an operand\n", optopt);
101 "Unrecognised option: -%c\n", optopt);
109 WLSDetectorConstruction* detector =
new WLSDetectorConstruction();
110 runManager->SetUserInitialization(detector);
112 runManager->SetUserInitialization(
new WLSPhysicsList(physName));
114 runManager->SetUserInitialization(
new WLSActionInitialization(detector));
119 G4VisManager* visManager =
new G4VisExecutive;
122 visManager->Initialize();
127 G4UImanager * UImanager = G4UImanager::GetUIpointer();
131 if (argc > 2) { optmax = optmax-1; }
135 G4String command =
"/control/execute ";
136 for ( ; optind < optmax; optind++)
138 G4String macroFilename = argv[optind];
139 UImanager->ApplyCommand(command+macroFilename);
142 #else // Simple UI for Windows runs, no possibility of additional arguments 145 G4String command =
"/control/execute ";
147 UImanager->ApplyCommand(command+fileName);
153 G4UIExecutive * ui =
new G4UIExecutive(argc,argv);
155 UImanager->ApplyCommand(
"/control/execute init.in");
158 UImanager->ApplyCommand(
"/control/execute gui.mac");
int main(int argc, char **argv)