41 #include "ExUCNPhysicsList.hh" 42 #include "ExUCNDetectorConstruction.hh" 43 #include "ExUCNActionInitialization.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" 68 G4cerr <<
" Usage: " << G4endl;
69 G4cerr <<
" ExUCN [-m macro ] [-u UIsession] [-t nThreads] [-r seed] " 71 G4cerr <<
" note: -t option is available only for multi-threaded mode." 78 int main(
int argc,
char** argv)
89 #ifdef G4MULTITHREADED 94 for ( G4int i=1; i<argc; i=i+2 ) {
95 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
96 else if (
G4String(argv[i]) ==
"-u" ) session = argv[i+1];
97 else if (
G4String(argv[i]) ==
"-r" ) myseed = atoi(argv[i+1]);
98 #ifdef G4MULTITHREADED 99 else if (
G4String(argv[i]) ==
"-t" ) {
100 nThreads = G4UIcommand::ConvertToInt(argv[i+1]);
111 G4Random::setTheEngine(
new CLHEP::RanecuEngine);
115 #ifdef G4MULTITHREADED 116 G4MTRunManager * runManager =
new G4MTRunManager;
117 if ( nThreads > 0 ) runManager->SetNumberOfThreads(nThreads);
119 G4RunManager * runManager =
new G4RunManager;
123 G4Random::setTheSeed(myseed);
128 runManager->SetUserInitialization(
new ExUCNDetectorConstruction());
130 runManager->SetUserInitialization(
new ExUCNPhysicsList());
132 runManager->SetUserInitialization(
new ExUCNActionInitialization());
136 runManager->Initialize();
141 G4VisManager* visManager =
new G4VisExecutive;
144 visManager->Initialize();
149 G4UImanager* UImanager = G4UImanager::GetUIpointer();
151 if ( macro.size() ) {
153 G4String command =
"/control/execute ";
154 UImanager->ApplyCommand(command+macro);
159 G4UIExecutive* ui =
new G4UIExecutive(argc, argv, session);
161 UImanager->ApplyCommand(
"/control/execute vis.mac");
163 UImanager->ApplyCommand(
"/control/execute ExUCN.in");
166 UImanager->ApplyCommand(
"/control/execute gui.mac");
static G4UIterminal * session
int main(int argc, char **argv)