35 #include "G3toG4DetectorConstruction.hh" 36 #include "G3toG4ActionInitialization.hh" 39 #ifdef G4MULTITHREADED 40 #include "G4MTRunManager.hh" 42 #include "G4RunManager.hh" 45 #include "FTFP_BERT.hh" 46 #include "G3VolTable.hh" 47 #include "G4RunManager.hh" 48 #include "G4UImanager.hh" 53 #include "G4VisExecutive.hh" 58 #include "G4UIExecutive.hh" 65 G4cerr <<
" Usage: " << G4endl;
67 <<
"clGeometry <call_list_file> [-m macro ] [-u UIsession] [-t nThreads]" 70 <<
" note: -t option is available only for multi-threaded mode." 77 int main(
int argc,
char** argv)
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
int main(int argc, char **argv)