Main program of the B2b 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 "Randomize.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 B2b example.
Definition in file exampleB2b.cc.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 46 of file exampleB2b.cc.
47{
48
49
52
53
54
55
56
57 G4int precision = 4;
58 G4SteppingVerbose::UseBestUnit(precision);
59
60
61
62 auto runManager =
63 G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default);
64
65
66
68
71 runManager->SetUserInitialization(physicsList);
72
73
75
76
78
79
80
81
82
83 visManager->Initialize();
84
85
86 auto UImanager = G4UImanager::GetUIpointer();
87
88
89
90 if ( ! ui ) {
91
92 G4String command =
"/control/execute ";
94 UImanager->ApplyCommand(command+fileName);
95 }
96 else {
97
98 UImanager->ApplyCommand("/control/execute init_vis.mac");
99 if (ui->IsGUI()) {
100 UImanager->ApplyCommand("/control/execute gui.mac");
101 }
102 ui->SessionStart();
103 delete ui;
104 }
105
106
107
108
109
110
111 delete visManager;
112 delete runManager;
113}
Action initialization class.
Detector construction class to define materials, geometry and global uniform magnetic field.