80 Command* commandLine(
nullptr);
82 #ifdef G4MULTITHREADED 83 G4MTRunManager* runManager=
new G4MTRunManager;
84 if ((commandLine =
parser->GetCommandIfActive(
"-mt")))
87 if(commandLine->GetOption() ==
"NMAX")
89 nThreads = G4Threading::G4GetNumberOfCores();
93 nThreads = G4UIcommand::ConvertToInt(commandLine->GetOption());
95 G4cout <<
"===== Chem1 is started with " << nThreads
96 <<
" threads =====" << G4endl;
98 runManager->SetNumberOfThreads(nThreads);
101 G4RunManager* runManager =
new G4RunManager();
109 runManager->SetUserInitialization(
new PhysicsList);
110 runManager->SetUserInitialization(detector);
111 runManager->SetUserInitialization(
new ActionInitialization());
114 G4VisManager* visManager =
nullptr;
117 G4UImanager* UImanager = G4UImanager::GetUIpointer();
118 G4UIExecutive* ui(
nullptr);
121 if ((commandLine =
parser->GetCommandIfActive(
"-gui")))
123 visManager =
new G4VisExecutive;
124 visManager->Initialize();
126 ui =
new G4UIExecutive(argc, argv, commandLine->GetOption());
128 if(
parser->GetCommandIfActive(
"-novis") == 0)
131 if((commandLine =
parser->GetCommandIfActive(
"-vis")))
134 UImanager->ApplyCommand(
G4String(
"/vis/open ")+
135 commandLine->GetOption());
140 UImanager->ApplyCommand(
"/vis/open OGL 800x600-0+0");
142 UImanager->ApplyCommand(
"/control/execute vis.mac");
147 UImanager->ApplyCommand(
"/control/execute gui.mac");
150 else if ((commandLine =
parser->GetCommandIfActive(
"-vis")))
155 visManager =
new G4VisExecutive;
156 visManager->Initialize();
158 ui =
new G4UIExecutive(argc, argv, commandLine->GetOption());
159 UImanager->ApplyCommand(
G4String(
"/vis/open ")+commandLine->GetOption());
160 UImanager->ApplyCommand(
"/control/execute vis.mac");
163 if ((commandLine =
parser->GetCommandIfActive(
"-mac")))
165 G4String command =
"/control/execute ";
166 UImanager->ApplyCommand(command + commandLine->GetOption());
170 UImanager->ApplyCommand(
"/control/execute beam.in");
187 CommandLineParser::DeleteInstance();
void Parse(int &argc, char **argv)
CommandLineParser * parser(0)