Main program of the eventgenerator/exgps example.
More...
#include "G4Types.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIExecutive.hh"
#include "G4VisExecutive.hh"
#include "GeometryConstruction.hh"
#include "PhysicsList.hh"
#include "ActionInitialization.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Main program of the eventgenerator/exgps example.
Definition in file exgps.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 52 of file exgps.cc.
55 G4UIExecutive* ui =
nullptr;
56 if (argc == 1) ui =
new G4UIExecutive(argc,argv);
59 #ifdef G4MULTITHREADED 60 G4MTRunManager * runManager =
new G4MTRunManager;
61 G4int nThreads = G4Threading::G4GetNumberOfCores();
62 if (argc==3) nThreads = G4UIcommand::ConvertToInt(argv[2]);
63 runManager->SetNumberOfThreads(nThreads);
65 G4RunManager * runManager =
new G4RunManager;
69 GeometryConstruction* detector =
new GeometryConstruction;
70 runManager->SetUserInitialization(detector);
73 runManager->SetUserInitialization(
new ActionInitialization);
76 G4VisManager* visManager =
nullptr;
79 G4UImanager* UImanager = G4UImanager::GetUIpointer();
83 visManager =
new G4VisExecutive;
84 visManager->Initialize();
85 UImanager->ApplyCommand(
"/control/execute vis.mac");
91 G4String command =
"/control/execute ";
93 UImanager->ApplyCommand(command+fileName);