33 #include "G4RunManager.hh" 34 #include "G4MTRunManager.hh" 35 #include "G4UImanager.hh" 36 #include "G4UIcommand.hh" 37 #include "Randomize.hh" 41 #include "ActionInitialization.hh" 43 #include "G4UIExecutive.hh" 44 #include "G4VisExecutive.hh" 48 int main(
int argc,
char** argv) {
51 G4UIExecutive* ui =
nullptr;
52 if (argc == 1) { ui =
new G4UIExecutive(argc,argv); }
55 CLHEP::HepRandom::setTheEngine(
new CLHEP::MixMaxRng);
57 #ifdef G4MULTITHREADED 58 G4MTRunManager* runManager =
new G4MTRunManager;
63 nThreads = G4Threading::G4GetNumberOfCores();
65 nThreads = G4UIcommand::ConvertToInt(argv[2]);
70 if (nThreads > 0) { runManager->SetNumberOfThreads(nThreads); }
71 G4cout <<
"===== TestEm8 is started with " 72 << runManager->GetNumberOfThreads() <<
" threads =====" << G4endl;
74 G4RunManager* runManager =
new G4RunManager;
79 runManager->SetUserInitialization(det);
80 runManager->SetUserInitialization(
new PhysicsList(det));
83 runManager->SetUserInitialization(
new ActionInitialization());
86 G4VisManager* visManager =
nullptr;
89 G4UImanager* UImanager = G4UImanager::GetUIpointer();
93 visManager =
new G4VisExecutive();
94 visManager->Initialize();
99 G4String command =
"/control/execute ";
101 UImanager->ApplyCommand(command+fileName);
TConfigurablePhysicsList< ModularPhysicsList > PhysicsList
int main(int argc, char **argv)