34 #ifdef G4MULTITHREADED 35 #include "G4MTRunManager.hh" 37 #include "G4RunManager.hh" 40 #include "G4UImanager.hh" 41 #include "G4String.hh" 43 #include "FTFP_BERT.hh" 44 #include "G4OpticalPhysics.hh" 45 #include "G4EmStandardPhysics_option4.hh" 49 #include "ActionInitialization.hh" 51 #include "G4VisExecutive.hh" 52 #include "G4UIExecutive.hh" 56 int main(
int argc,
char** argv)
60 G4UIExecutive* ui =
nullptr;
61 if (argc == 1) ui =
new G4UIExecutive(argc,argv);
63 #ifdef G4MULTITHREADED 64 G4MTRunManager * runManager =
new G4MTRunManager;
65 G4int nThreads = std::min(G4Threading::G4GetNumberOfCores(), 4);
66 runManager->SetNumberOfThreads(nThreads);
67 G4cout <<
"===== OpNovice2 is started with " 68 << runManager->GetNumberOfThreads() <<
" threads =====" << G4endl;
70 G4RunManager * runManager =
new G4RunManager;
74 runManager->SetUserInitialization(detector);
76 G4VModularPhysicsList* physicsList =
new FTFP_BERT;
77 physicsList->ReplacePhysics(
new G4EmStandardPhysics_option4());
78 G4OpticalPhysics* opticalPhysics =
new G4OpticalPhysics();
80 physicsList->RegisterPhysics(opticalPhysics);
81 runManager->SetUserInitialization(physicsList);
83 runManager->SetUserInitialization(
new ActionInitialization());
86 G4VisManager* visManager =
new G4VisExecutive;
87 visManager->Initialize();
90 G4UImanager* UImanager = G4UImanager::GetUIpointer();
94 UImanager->ApplyCommand(
"/control/execute vis.mac");
100 G4String command =
"/control/execute ";
102 UImanager->ApplyCommand(command+fileName);
int main(int argc, char **argv)