Main program of the exoticphysics/ucn example.
More...
#include <unistd.h>
#include "ExUCNPhysicsList.hh"
#include "ExUCNDetectorConstruction.hh"
#include "ExUCNActionInitialization.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIcommand.hh"
#include "Randomize.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Main program of the exoticphysics/ucn example.
Definition in file ExUCN.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 78 of file ExUCN.cc.
References PrintUsage(), and session.
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