46 #ifdef G4MULTITHREADED 47 #include "G4MTRunManager.hh" 49 #include "G4RunManager.hh" 52 #include "G4UImanager.hh" 54 #include "OpNovicePhysicsList.hh" 55 #include "OpNoviceDetectorConstruction.hh" 57 #include "OpNoviceActionInitialization.hh" 60 #include "G4VisExecutive.hh" 64 #include "G4UIExecutive.hh" 70 G4cerr <<
" Usage: " << G4endl;
71 G4cerr <<
" OpNovice [-m macro ] [-u UIsession] [-t nThreads] [-r seed] " 73 G4cerr <<
" note: -t option is available only for multi-threaded mode." 80 int main(
int argc,
char** argv)
91 #ifdef G4MULTITHREADED 95 G4long myseed = 345354;
96 for ( G4int i=1; i<argc; i=i+2 ) {
97 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
98 else if (
G4String(argv[i]) ==
"-u" ) session = argv[i+1];
99 else if (
G4String(argv[i]) ==
"-r" ) myseed = atoi(argv[i+1]);
100 #ifdef G4MULTITHREADED 101 else if (
G4String(argv[i]) ==
"-t" ) {
102 nThreads = G4UIcommand::ConvertToInt(argv[i+1]);
113 G4Random::setTheEngine(
new CLHEP::RanecuEngine);
117 #ifdef G4MULTITHREADED 118 G4MTRunManager * runManager =
new G4MTRunManager;
119 if ( nThreads > 0 ) runManager->SetNumberOfThreads(nThreads);
121 G4RunManager * runManager =
new G4RunManager;
125 G4Random::setTheSeed(myseed);
130 runManager-> SetUserInitialization(
new OpNoviceDetectorConstruction());
132 runManager-> SetUserInitialization(
new OpNovicePhysicsList());
134 runManager->SetUserInitialization(
new OpNoviceActionInitialization());
138 runManager->Initialize();
143 G4VisManager* visManager =
new G4VisExecutive;
146 visManager->Initialize();
151 G4UImanager* UImanager = G4UImanager::GetUIpointer();
153 if ( macro.size() ) {
155 G4String command =
"/control/execute ";
156 UImanager->ApplyCommand(command+macro);
161 G4UIExecutive * ui =
new G4UIExecutive(argc,argv,session);
163 UImanager->ApplyCommand(
"/control/execute vis.mac");
165 UImanager->ApplyCommand(
"/control/execute OpNovice.in");
168 UImanager->ApplyCommand(
"/control/execute gui.mac");
static G4UIterminal * session
int main(int argc, char **argv)