Main program of the field/field06 example.
More...
#include <unistd.h>
#include "G4Types.hh"
#include "F06PhysicsList.hh"
#include "G4Transportation.hh"
#include "F06DetectorConstruction.hh"
#include "F06ActionInitialization.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIcommand.hh"
#include "Randomize.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.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 75 of file field06.cc.
References PrintUsage(), and session.
86 #ifdef G4MULTITHREADED 90 G4long randomSeed = 1234;
91 for ( G4int i=1; i<argc; i=i+2 ) {
92 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
93 else if (
G4String(argv[i]) ==
"-u" ) session = argv[i+1];
94 else if (
G4String(argv[i]) ==
"-r" ) randomSeed = atoi(argv[i+1]);
95 #ifdef G4MULTITHREADED 96 else if (
G4String(argv[i]) ==
"-t" ) {
97 nThreads = G4UIcommand::ConvertToInt(argv[i+1]);
107 G4UIExecutive* ui =
nullptr;
108 if ( macro.size() == 0 ) {
109 ui =
new G4UIExecutive(argc, argv, session);
114 G4Random::setTheEngine(
new CLHEP::RanecuEngine);
118 #ifdef G4MULTITHREADED 119 G4MTRunManager * runManager =
new G4MTRunManager;
120 if ( nThreads > 0 ) runManager->SetNumberOfThreads(nThreads);
122 G4RunManager * runManager =
new G4RunManager;
126 G4Random::setTheSeed(randomSeed);
131 runManager->SetUserInitialization(
new F06DetectorConstruction());
133 runManager->SetUserInitialization(
new F06PhysicsList());
136 G4Transportation::EnableGravity(
true);
139 runManager->SetUserInitialization(
new F06ActionInitialization());
143 G4VisManager* visManager =
new G4VisExecutive;
146 visManager->Initialize();
150 G4UImanager* UImanager = G4UImanager::GetUIpointer();
154 G4String command =
"/control/execute ";
155 UImanager->ApplyCommand(command+macro);
159 UImanager->ApplyCommand(
"/control/execute init_vis.mac");
161 UImanager->ApplyCommand(
"/control/execute gui.mac");
static G4UIterminal * session