Main program of the basic B5 example.
More...
#include "DetectorConstruction.hh"
#include "ActionInitialization.hh"
#include "G4RunManagerFactory.hh"
#include "G4SteppingVerbose.hh"
#include "G4UImanager.hh"
#include "FTFP_BERT.hh"
#include "G4StepLimiterPhysics.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 basic B5 example.
Definition in file exampleB5.cc.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 44 of file exampleB5.cc.
45{
46
47
50
51
52 G4int precision = 4;
53 G4SteppingVerbose::UseBestUnit(precision);
54
55
56
57 auto runManager =
58 G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default);
59
60
62
65 runManager->SetUserInitialization(physicsList);
66
67
69
70
72
73
74 visManager->Initialize();
75
76
77 auto UImanager = G4UImanager::GetUIpointer();
78
79 if ( !ui ) {
80
81 G4String command =
"/control/execute ";
83 UImanager->ApplyCommand(command+fileName);
84 }
85 else {
86 UImanager->ApplyCommand("/control/execute init_vis.mac");
87 if (ui->IsGUI()) {
88 UImanager->ApplyCommand("/control/execute gui.mac");
89 }
90
91 ui->SessionStart();
92 delete ui;
93 }
94
95
96
97
98
99
100 delete visManager;
101 delete runManager;
102}
Action initialization class.