Main program of the g3tog4/clGeometry example.
More...
#include "G3toG4DetectorConstruction.hh"
#include "G3toG4ActionInitialization.hh"
#include "G4RunManager.hh"
#include "FTFP_BERT.hh"
#include "G3VolTable.hh"
#include "G4UImanager.hh"
#include "G4ios.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 g3tog4/clGeometry example.
Definition in file clGeometry.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 68 of file clGeometry.cc.
References in, PrintUsage(), and session.
72 G4cout <<
"argc " << argc << G4endl;
73 if ( argc < 2 || argc > 8 ) {
81 #ifdef G4MULTITHREADED 87 G4cout <<
"Geometry data file: " << inFile << G4endl;
88 std::ifstream
in(inFile);
90 G4cerr <<
"Cannot open input file \"" << inFile <<
"\"" << G4endl;
95 for ( G4int i=2; i<argc; i=i+2 ) {
96 G4cout <<
"evaluating " << argv[i] << G4endl;
97 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
98 else if (
G4String(argv[i]) ==
"-u" ) session = argv[i+1];
99 #ifdef G4MULTITHREADED 100 else if (
G4String(argv[i]) ==
"-t" ) {
101 nofThreads = G4UIcommand::ConvertToInt(argv[i+1]);
112 G4UIExecutive* ui =
nullptr;
113 if ( ! macro.size() ) {
114 ui =
new G4UIExecutive(argc, argv, session);
118 #ifdef G4MULTITHREADED 119 G4MTRunManager* runManager =
new G4MTRunManager;
120 runManager->SetNumberOfThreads(nofThreads);
122 G4RunManager* runManager =
new G4RunManager;
128 runManager->SetUserInitialization(
new G3toG4DetectorConstruction(inFile));
131 runManager->SetUserInitialization(
new FTFP_BERT);
134 runManager->SetUserInitialization(
new G3toG4ActionInitialization());
138 auto visManager =
new G4VisExecutive;
141 visManager->Initialize();
144 auto UImanager = G4UImanager::GetUIpointer();
148 if ( macro.size() ) {
150 G4String command =
"/control/execute ";
151 UImanager->ApplyCommand(command+macro);
155 UImanager->ApplyCommand(
"/control/execute init_vis.mac");
static G4UIterminal * session