Main program of the field/field06 example.
More...
#include <unistd.h>
#include "F06PhysicsList.hh"
#include "F06DetectorConstruction.hh"
#include "F06ActionInitialization.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 field/field06 example.
Definition in file field06.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 77 of file field06.cc.
References PrintUsage(), and session.
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