Main program of the optical/LXe example.
More...
#include "G4Types.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4String.hh"
#include "FTFP_BERT.hh"
#include "G4OpticalPhysics.hh"
#include "G4EmStandardPhysics_option4.hh"
#include "LXeDetectorConstruction.hh"
#include "LXeActionInitialization.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Main program of the optical/LXe example.
Definition in file LXe.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 55 of file LXe.cc.
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);