81 Command* commandLine(0);
83 #ifdef G4MULTITHREADED 84 G4RunManager* runManager(0);
85 if ((commandLine =
parser->GetCommandIfActive(
"-mt")))
87 runManager =
new G4MTRunManager;
89 const G4String& option = commandLine->GetOption();
92 nThreads = G4UIcommand::ConvertToInt(commandLine->GetDefaultOption());
94 else if(option ==
"NMAX")
96 nThreads = G4Threading::G4GetNumberOfCores();
100 nThreads = G4UIcommand::ConvertToInt(option);
103 G4cout <<
"===== Chem2 is started with " 104 << ((G4MTRunManager*) runManager)->GetNumberOfThreads()
105 <<
" threads =====" << G4endl;
107 ((G4MTRunManager*) runManager)->SetNumberOfThreads(nThreads);
111 runManager =
new G4RunManager();
114 G4RunManager* runManager =
new G4RunManager();
121 runManager->SetUserInitialization(
new PhysicsList);
122 runManager->SetUserInitialization(detector);
123 runManager->SetUserInitialization(
new ActionInitialization());
126 runManager->Initialize();
129 G4VisManager* visManager =
new G4VisExecutive;
132 visManager->Initialize();
135 G4UImanager* UImanager = G4UImanager::GetUIpointer();
136 G4UIExecutive* ui(0);
139 if ((commandLine =
parser->GetCommandIfActive(
"-gui")))
141 ui =
new G4UIExecutive(argc, argv,
142 commandLine->GetOption());
144 if(
parser->GetCommandIfActive(
"-novis") == 0)
147 if((commandLine =
parser->GetCommandIfActive(
"-vis")))
150 UImanager->ApplyCommand(
G4String(
"/vis/open ")+
151 commandLine->GetOption());
156 UImanager->ApplyCommand(
"/vis/open OGL 800x600-0+0");
158 UImanager->ApplyCommand(
"/control/execute vis.mac");
162 UImanager->ApplyCommand(
"/control/execute gui.mac");
169 if ((commandLine =
parser->GetCommandIfActive(
"-vis")))
171 UImanager->ApplyCommand(
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")))
200 CommandLineParser::DeleteInstance();
void Parse(int &argc, char **argv)
CommandLineParser * parser(0)