82 Command* commandLine(0);
84 #ifdef G4MULTITHREADED 85 G4RunManager* runManager(0);
86 if ((commandLine =
parser->GetCommandIfActive(
"-mt")))
88 runManager =
new G4MTRunManager;
90 const G4String& option = commandLine->GetOption();
93 nThreads = G4UIcommand::ConvertToInt(commandLine->GetDefaultOption());
95 else if(option ==
"NMAX")
97 nThreads = G4Threading::G4GetNumberOfCores();
101 nThreads = G4UIcommand::ConvertToInt(option);
104 G4cout <<
"===== Chem3 is started with " 105 << ((G4MTRunManager*) runManager)->GetNumberOfThreads()
106 <<
" threads =====" << G4endl;
108 ((G4MTRunManager*) runManager)->SetNumberOfThreads(nThreads);
112 runManager =
new G4RunManager();
115 G4RunManager* runManager =
new G4RunManager();
122 runManager->SetUserInitialization(
new PhysicsList);
123 runManager->SetUserInitialization(detector);
124 runManager->SetUserInitialization(
new ActionInitialization());
127 runManager->Initialize();
130 G4VisManager* visManager =
new G4VisExecutive;
133 visManager->Initialize();
136 G4UImanager* UImanager = G4UImanager::GetUIpointer();
137 G4UIExecutive* ui(0);
140 if ((commandLine =
parser->GetCommandIfActive(
"-gui")))
142 ui =
new G4UIExecutive(argc, argv, commandLine->GetOption());
144 if (
parser->GetCommandIfActive(
"-novis") == 0)
147 if ((commandLine =
parser->GetCommandIfActive(
"-vis")))
150 UImanager->ApplyCommand(
151 G4String(
"/vis/open ") + commandLine->GetOption());
156 UImanager->ApplyCommand(
"/vis/open OGL 800x600-0+0");
158 UImanager->ApplyCommand(
"/control/execute vis.mac");
161 if (ui->IsGUI()) UImanager->ApplyCommand(
"/control/execute gui.mac");
168 if ((commandLine =
parser->GetCommandIfActive(
"-vis")))
170 UImanager->ApplyCommand(
171 G4String(
"/vis/open ") + commandLine->GetOption());
172 UImanager->ApplyCommand(
"/control/execute vis.mac");
176 if ((commandLine =
parser->GetCommandIfActive(
"-mac")))
178 G4String command =
"/control/execute ";
179 UImanager->ApplyCommand(command + commandLine->GetOption());
183 UImanager->ApplyCommand(
"/control/execute beam.in");
186 if ((commandLine =
parser->GetCommandIfActive(
"-gui")))
189 G4UIQt* UIQt =
static_cast<G4UIQt*
> (UImanager->GetG4UIWindow());
191 UIQt->AddViewerTabFromFile(
"README",
"README from "+
G4String(argv[0]));
206 CommandLineParser::DeleteInstance();
void Parse(int &argc, char **argv)
CommandLineParser * parser(0)