34 #include "G3toG4DetectorConstruction.hh" 35 #include "G3toG4ActionInitialization.hh" 38 #ifdef G4MULTITHREADED 39 #include "G4MTRunManager.hh" 41 #include "G4RunManager.hh" 44 #include "FTFP_BERT.hh" 45 #include "G3VolTable.hh" 46 #include "G4UImanager.hh" 49 #include "G4VisExecutive.hh" 50 #include "G4UIExecutive.hh" 56 G4cerr <<
" Usage: " << G4endl;
58 <<
"clGeometry <call_list_file> [-m macro ] [-u UIsession] [-t nThreads]" 61 <<
" note: -t option is available only for multi-threaded mode." 68 int main(
int argc,
char** argv)
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
int main(int argc, char **argv)