Main program of the OpNovice example.
More...
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "OpNovicePhysicsList.hh"
#include "OpNoviceDetectorConstruction.hh"
#include "OpNoviceActionInitialization.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Main program of the OpNovice example.
Definition in file OpNovice.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 80 of file OpNovice.cc.
References PrintUsage(), and session.
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