Main program of the B4d example.
More...
#include "B4dDetectorConstruction.hh"
#include "B4dActionInitialization.hh"
#include "B4Analysis.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "FTFP_BERT.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"
#include "Randomize.hh"
#include "G4TScoreNtupleWriter.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Main program of the B4d example.
Definition in file exampleB4d.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 60 of file exampleB4d.cc.
References PrintUsage(), and session.
71 #ifdef G4MULTITHREADED 74 for ( G4int i=1; i<argc; i=i+2 ) {
75 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
76 else if (
G4String(argv[i]) ==
"-u" ) session = argv[i+1];
77 #ifdef G4MULTITHREADED 78 else if (
G4String(argv[i]) ==
"-t" ) {
79 nThreads = G4UIcommand::ConvertToInt(argv[i+1]);
90 G4UIExecutive* ui =
nullptr;
91 if ( ! macro.size() ) {
92 ui =
new G4UIExecutive(argc, argv, session);
101 #ifdef G4MULTITHREADED 102 auto runManager =
new G4MTRunManager;
103 if ( nThreads > 0 ) {
104 runManager->SetNumberOfThreads(nThreads);
107 auto runManager =
new G4RunManager;
112 auto detConstruction =
new B4dDetectorConstruction();
113 runManager->SetUserInitialization(detConstruction);
115 auto physicsList =
new FTFP_BERT;
116 runManager->SetUserInitialization(physicsList);
118 auto actionInitialization =
new B4dActionInitialization();
119 runManager->SetUserInitialization(actionInitialization);
122 auto visManager =
new G4VisExecutive;
125 visManager->Initialize();
128 auto UImanager = G4UImanager::GetUIpointer();
132 G4TScoreNtupleWriter<G4AnalysisManager> scoreNtupleWriter;
140 if ( macro.size() ) {
142 G4String command =
"/control/execute ";
143 UImanager->ApplyCommand(command+macro);
147 UImanager->ApplyCommand(
"/control/execute init_vis.mac");
149 UImanager->ApplyCommand(
"/control/execute gui.mac");
static G4UIterminal * session