83 Command* commandLine(0);
85 #ifdef G4MULTITHREADED 86 G4RunManager* runManager(0);
87 if ((commandLine =
parser->GetCommandIfActive(
"-mt")))
89 runManager =
new G4MTRunManager;
91 const G4String& option = commandLine->GetOption();
94 nThreads = G4UIcommand::ConvertToInt(commandLine->GetDefaultOption());
96 else if(option ==
"NMAX")
98 nThreads = G4Threading::G4GetNumberOfCores();
102 nThreads = G4UIcommand::ConvertToInt(option);
105 G4cout <<
"===== Chem3 is started with " 106 << ((G4MTRunManager*) runManager)->GetNumberOfThreads()
107 <<
" threads =====" << G4endl;
109 ((G4MTRunManager*) runManager)->SetNumberOfThreads(nThreads);
113 runManager =
new G4RunManager();
116 G4RunManager* runManager =
new G4RunManager();
123 runManager->SetUserInitialization(
new PhysicsList);
124 runManager->SetUserInitialization(detector);
125 runManager->SetUserInitialization(
new ActionInitialization());
128 runManager->Initialize();
131 G4VisManager* visManager =
new G4VisExecutive;
134 visManager->Initialize();
137 G4UImanager* UImanager = G4UImanager::GetUIpointer();
138 G4UIExecutive* ui(0);
141 if ((commandLine =
parser->GetCommandIfActive(
"-gui")))
143 ui =
new G4UIExecutive(argc, argv, commandLine->GetOption());
145 if (
parser->GetCommandIfActive(
"-novis") == 0)
148 if ((commandLine =
parser->GetCommandIfActive(
"-vis")))
151 UImanager->ApplyCommand(
152 G4String(
"/vis/open ") + commandLine->GetOption());
157 UImanager->ApplyCommand(
"/vis/open OGL 800x600-0+0");
159 UImanager->ApplyCommand(
"/control/execute vis.mac");
162 if (ui->IsGUI()) UImanager->ApplyCommand(
"/control/execute gui.mac");
169 if ((commandLine =
parser->GetCommandIfActive(
"-vis")))
171 UImanager->ApplyCommand(
172 G4String(
"/vis/open ") + commandLine->GetOption());
173 UImanager->ApplyCommand(
"/control/execute vis.mac");
177 if ((commandLine =
parser->GetCommandIfActive(
"-mac")))
179 G4String command =
"/control/execute ";
180 UImanager->ApplyCommand(command + commandLine->GetOption());
184 UImanager->ApplyCommand(
"/control/execute beam.in");
187 if ((commandLine =
parser->GetCommandIfActive(
"-gui")))
190 G4UIQt* UIQt =
static_cast<G4UIQt*
> (UImanager->GetG4UIWindow());
192 UIQt->AddViewerTabFromFile(
"README",
"README from "+
G4String(argv[0]));
207 CommandLineParser::DeleteInstance();
void Parse(int &argc, char **argv)
CommandLineParser * parser(0)