81 Command* commandLine(0);
86 #ifdef G4MULTITHREADED 87 G4MTRunManager* runManager=
new G4MTRunManager();
89 if((commandLine =
parser->GetCommandIfActive(
"-mt")))
92 if(commandLine->GetOption() ==
"NMAX")
94 nThreads = G4Threading::G4GetNumberOfCores();
98 nThreads = G4UIcommand::ConvertToInt(commandLine->GetOption());
101 runManager->SetNumberOfThreads(nThreads);
104 G4cout <<
"**************************************************************" 105 <<
"******\n===== Chem5 is started with " 106 << runManager->GetNumberOfThreads() <<
" of " 107 << G4Threading::G4GetNumberOfCores()
108 <<
" available threads =====\n\n*************************************" 109 <<
"*******************************" 112 G4RunManager* runManager =
new G4RunManager();
116 runManager->SetUserInitialization(
new PhysicsList());
118 runManager->SetUserInitialization(
new ActionInitialization());
121 runManager->Initialize();
124 G4VisManager* visManager =
new G4VisExecutive();
127 visManager->Initialize();
130 G4UImanager* UImanager = G4UImanager::GetUIpointer();
131 G4UIExecutive* ui(0);
134 if((commandLine =
parser->GetCommandIfActive(
"-gui")))
136 ui =
new G4UIExecutive(argc, argv, commandLine->GetOption());
138 if (ui->IsGUI()) UImanager->ApplyCommand(
"/control/execute gui.mac");
140 if (
parser->GetCommandIfActive(
"-novis") == 0)
143 if ((commandLine =
parser->GetCommandIfActive(
"-vis")))
146 UImanager->ApplyCommand
147 (
G4String(
"/vis/open ") + commandLine->GetOption());
152 UImanager->ApplyCommand(
"/vis/open OGL 800x600-0+0");
154 UImanager->ApplyCommand(
"/control/execute vis.mac");
162 if((commandLine =
parser->GetCommandIfActive(
"-vis")))
164 UImanager->ApplyCommand(
G4String(
"/vis/open ")
165 + commandLine->GetOption());
166 UImanager->ApplyCommand(
"/control/execute vis.mac");
170 if((commandLine =
parser->GetCommandIfActive(
"-mac")))
172 G4String command =
"/control/execute ";
173 UImanager->ApplyCommand(command + commandLine->GetOption());
177 UImanager->ApplyCommand(
"/control/execute beam.in");
180 if((commandLine =
parser->GetCommandIfActive(
"-gui")))
192 CommandLineParser::DeleteInstance();
void Parse(int &argc, char **argv)
TConfigurablePhysicsList< ModularPhysicsList > PhysicsList
CommandLineParser * parser(0)