34 #ifdef G4MULTITHREADED 35 #include "G4MTRunManager.hh" 37 #include "G4RunManager.hh" 40 #include "G4UImanager.hh" 41 #include "Randomize.hh" 45 #include "ActionInitialization.hh" 46 #include "SteppingVerbose.hh" 48 #include "G4UIExecutive.hh" 49 #include "G4VisExecutive.hh" 53 int main(
int argc,
char** argv) {
56 G4UIExecutive* ui =
nullptr;
57 if (argc == 1) { ui =
new G4UIExecutive(argc,argv); }
60 G4VSteppingVerbose::SetInstance(
new SteppingVerbose);
63 #ifdef G4MULTITHREADED 64 G4MTRunManager* runManager =
new G4MTRunManager;
69 nThreads = G4Threading::G4GetNumberOfCores();
71 nThreads = G4UIcommand::ConvertToInt(argv[2]);
76 if (nThreads > 0) { runManager->SetNumberOfThreads(nThreads); }
77 G4cout <<
"===== TestEm3 is started with " 78 << runManager->GetNumberOfThreads() <<
" threads =====" << G4endl;
80 G4RunManager* runManager =
new G4RunManager;
85 runManager->SetUserInitialization(detector);
89 runManager->SetUserInitialization(
new ActionInitialization(detector));
92 G4VisManager* visManager =
nullptr;
95 G4UImanager* UImanager = G4UImanager::GetUIpointer();
99 visManager =
new G4VisExecutive();
100 visManager->Initialize();
105 G4String command =
"/control/execute ";
107 UImanager->ApplyCommand(command+fileName);
int main(int argc, char **argv)