41 #include "F06PhysicsList.hh" 42 #include "F06DetectorConstruction.hh" 43 #include "F06ActionInitialization.hh" 45 #ifdef G4MULTITHREADED 46 #include "G4MTRunManager.hh" 48 #include "G4RunManager.hh" 51 #include "G4UImanager.hh" 52 #include "G4UIcommand.hh" 54 #include "Randomize.hh" 57 #include "G4VisExecutive.hh" 61 #include "G4UIExecutive.hh" 67 G4cerr <<
" Usage: " << G4endl;
68 G4cerr <<
" field06 [-m macro ] [-u UIsession] [-t nThreads] [-r seed] " 70 G4cerr <<
" note: -t option is available only for multi-threaded mode." 77 int main(
int argc,
char** argv)
88 #ifdef G4MULTITHREADED 93 for ( G4int i=1; i<argc; i=i+2 ) {
94 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
95 else if (
G4String(argv[i]) ==
"-u" ) session = argv[i+1];
96 else if (
G4String(argv[i]) ==
"-r" ) myseed = atoi(argv[i+1]);
97 #ifdef G4MULTITHREADED 98 else if (
G4String(argv[i]) ==
"-t" ) {
99 nThreads = G4UIcommand::ConvertToInt(argv[i+1]);
110 G4Random::setTheEngine(
new CLHEP::RanecuEngine);
114 #ifdef G4MULTITHREADED 115 G4MTRunManager * runManager =
new G4MTRunManager;
116 if ( nThreads > 0 ) runManager->SetNumberOfThreads(nThreads);
118 G4RunManager * runManager =
new G4RunManager;
122 G4Random::setTheSeed(myseed);
127 runManager->SetUserInitialization(
new F06DetectorConstruction());
129 runManager->SetUserInitialization(
new F06PhysicsList());
131 runManager->SetUserInitialization(
new F06ActionInitialization());
135 runManager->Initialize();
140 G4VisManager* visManager =
new G4VisExecutive;
143 visManager->Initialize();
148 G4UImanager* UImanager = G4UImanager::GetUIpointer();
150 if ( macro.size() ) {
152 G4String command =
"/control/execute ";
153 UImanager->ApplyCommand(command+macro);
158 G4UIExecutive* ui =
new G4UIExecutive(argc, argv, session);
160 UImanager->ApplyCommand(
"/control/execute vis.mac");
162 UImanager->ApplyCommand(
"/control/execute field06.in");
165 UImanager->ApplyCommand(
"/control/execute gui.mac");
static G4UIterminal * session
int main(int argc, char **argv)