46 #ifdef G4MULTITHREADED 47 #include "G4MTRunManager.hh" 49 #include "G4RunManager.hh" 52 #include "G4UImanager.hh" 53 #include "Randomize.hh" 55 #include "G4UIExecutive.hh" 56 #include "G4VisExecutive.hh" 60 #include "ActionInitialization.hh" 65 int main(
int argc,
char** argv) {
68 G4UIExecutive* ui =
nullptr;
69 if (argc == 1) ui =
new G4UIExecutive(argc,argv);
72 G4Random::setTheEngine(
new CLHEP::RanecuEngine);
75 #ifdef G4MULTITHREADED 76 G4MTRunManager* runManager =
new G4MTRunManager;
77 G4int nThreads = std::min(G4Threading::G4GetNumberOfCores(),2);
78 if (argc==3) nThreads = G4UIcommand::ConvertToInt(argv[2]);
79 runManager->SetNumberOfThreads(nThreads);
80 G4cout <<
"===== GammaTherapy is started with " 81 << runManager->GetNumberOfThreads() <<
" threads =====" << G4endl;
83 G4RunManager* runManager =
new G4RunManager();
88 runManager->SetUserInitialization(det);
90 runManager->SetUserInitialization(
new PhysicsList());
93 runManager->SetUserInitialization(
new ActionInitialization(det));
96 G4VisManager* visManager =
nullptr;
99 G4UImanager* UImanager = G4UImanager::GetUIpointer();
103 visManager =
new G4VisExecutive;
104 visManager->Initialize();
105 UImanager->ApplyCommand(
"/control/execute vis.mac");
111 G4String command =
"/control/execute ";
113 UImanager->ApplyCommand(command+fileName);
TConfigurablePhysicsList< ModularPhysicsList > PhysicsList
int main(int argc, char **argv)