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" 47 #include "LXeDetectorConstruction.hh" 48 #include "LXeActionInitialization.hh" 50 #include "G4VisExecutive.hh" 51 #include "G4UIExecutive.hh" 55 int main(
int argc,
char** argv)
58 G4UIExecutive* ui =
nullptr;
59 if (argc == 1) { ui =
new G4UIExecutive(argc,argv); }
61 #ifdef G4MULTITHREADED 62 G4MTRunManager * runManager =
new G4MTRunManager;
63 G4int nThreads = std::min(G4Threading::G4GetNumberOfCores(), 4);
64 runManager->SetNumberOfThreads(nThreads);
65 G4cout <<
"===== LXe is started with " 66 << runManager->GetNumberOfThreads() <<
" threads =====" << G4endl;
68 G4RunManager * runManager =
new G4RunManager;
70 LXeDetectorConstruction* det =
new LXeDetectorConstruction();
71 runManager->SetUserInitialization(det);
73 G4VModularPhysicsList* physicsList =
new FTFP_BERT;
74 physicsList->ReplacePhysics(
new G4EmStandardPhysics_option4());
75 G4OpticalPhysics* opticalPhysics =
new G4OpticalPhysics();
76 opticalPhysics->SetWLSTimeProfile(
"delta");
78 opticalPhysics->SetScintillationYieldFactor(1.0);
79 opticalPhysics->SetScintillationExcitationRatio(0.0);
81 opticalPhysics->SetMaxNumPhotonsPerStep(100);
82 opticalPhysics->SetMaxBetaChangePerStep(10.0);
84 opticalPhysics->SetTrackSecondariesFirst(kCerenkov,
true);
85 opticalPhysics->SetTrackSecondariesFirst(kScintillation,
true);
87 physicsList->RegisterPhysics(opticalPhysics);
88 runManager->SetUserInitialization(physicsList);
90 runManager->SetUserInitialization(
new LXeActionInitialization(det));
93 G4VisManager* visManager =
new G4VisExecutive;
94 visManager->Initialize();
97 G4UImanager* UImanager = G4UImanager::GetUIpointer();
101 UImanager->ApplyCommand(
"/control/execute vis.mac");
103 UImanager->ApplyCommand(
"/control/execute gui.mac");
109 G4String command =
"/control/execute ";
111 UImanager->ApplyCommand(command+fileName);
int main(int argc, char **argv)