Main program of the optical/OpNovice2 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 "DetectorConstruction.hh"
#include "ActionInitialization.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/OpNovice2 example.
Definition in file OpNovice2.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 56 of file OpNovice2.cc.
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);