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"
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 77 of file clGeometry.cc.
References in, PrintUsage(), and session.
81 G4cout <<
"argc " << argc << G4endl;
82 if ( argc < 2 || argc > 8 ) {
90 #ifdef G4MULTITHREADED 96 G4cout <<
"Geometry data file: " << inFile << G4endl;
97 std::ifstream
in(inFile);
99 G4cerr <<
"Cannot open input file \"" << inFile <<
"\"" << G4endl;
104 for ( G4int i=2; i<argc; i=i+2 ) {
105 G4cout <<
"evaluating " << argv[i] << G4endl;
106 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
107 else if (
G4String(argv[i]) ==
"-u" ) session = argv[i+1];
108 #ifdef G4MULTITHREADED 109 else if (
G4String(argv[i]) ==
"-t" ) {
110 nofThreads = G4UIcommand::ConvertToInt(argv[i+1]);
120 #ifdef G4MULTITHREADED 121 G4MTRunManager* runManager =
new G4MTRunManager;
122 runManager->SetNumberOfThreads(nofThreads);
124 G4RunManager* runManager =
new G4RunManager;
130 runManager->SetUserInitialization(
new G3toG4DetectorConstruction(inFile));
133 runManager->SetUserInitialization(
new FTFP_BERT);
136 runManager->SetUserInitialization(
new G3toG4ActionInitialization());
140 runManager->Initialize();
148 G4VisManager* visManager =
new G4VisExecutive;
151 visManager->Initialize();
155 G4UImanager* uiManager = G4UImanager::GetUIpointer();
157 if ( macro.size() ) {
159 G4String command =
"/control/execute ";
160 uiManager->ApplyCommand(command+macro);
165 G4UIExecutive* ui =
new G4UIExecutive(argc, argv, session);
167 uiManager->ApplyCommand(
"/control/execute init_vis.mac");
169 uiManager->ApplyCommand(
"/control/execute init.mac");
static G4UIterminal * session