Main program of the B1 example.
More...
#include "DetectorConstruction.hh"
#include "ActionInitialization.hh"
#include "G4RunManagerFactory.hh"
#include "G4SteppingVerbose.hh"
#include "G4UImanager.hh"
#include "QBBC.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"
#include "Randomize.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Main program of the B1 example.
Definition in file exampleB1.cc.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 47 of file exampleB1.cc.
48{
49
50
53
54
55
56
57
58 G4int precision = 4;
59 G4SteppingVerbose::UseBestUnit(precision);
60
61
62
63 auto runManager =
64 G4RunManagerFactory::CreateRunManager(G4RunManagerType::Default);
65
66
67
68
70
71
72 auto physicsList =
new QBBC;
73 physicsList->SetVerboseLevel(1);
74 runManager->SetUserInitialization(physicsList);
75
76
78
79
81
82
83
84
85
86 visManager->Initialize();
87
88
89 auto UImanager = G4UImanager::GetUIpointer();
90
91
92
93 if ( ! ui ) {
94
95 G4String command =
"/control/execute ";
97 UImanager->ApplyCommand(command+fileName);
98 }
99 else {
100
101 UImanager->ApplyCommand("/control/execute init_vis.mac");
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 and geometry.