Main program of the OpNovice example.
More...
#include "G4Types.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "FTFP_BERT.hh"
#include "G4OpticalPhysics.hh"
#include "G4EmStandardPhysics_option4.hh"
#include "OpNoviceDetectorConstruction.hh"
#include "OpNoviceActionInitialization.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 OpNovice example.
Definition in file OpNovice.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 79 of file OpNovice.cc.
References PrintUsage(), and session.
90 #ifdef G4MULTITHREADED 94 G4long myseed = 345354;
95 for ( G4int i=1; i<argc; i=i+2 ) {
96 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
97 else if (
G4String(argv[i]) ==
"-u" ) session = argv[i+1];
98 else if (
G4String(argv[i]) ==
"-r" ) myseed = atoi(argv[i+1]);
99 #ifdef G4MULTITHREADED 100 else if (
G4String(argv[i]) ==
"-t" ) {
101 nThreads = G4UIcommand::ConvertToInt(argv[i+1]);
111 G4UIExecutive* ui =
nullptr;
112 if ( macro.size() == 0 ) {
113 ui =
new G4UIExecutive(argc, argv);
118 G4Random::setTheEngine(
new CLHEP::RanecuEngine);
122 #ifdef G4MULTITHREADED 123 G4MTRunManager * runManager =
new G4MTRunManager;
124 if ( nThreads > 0 ) runManager->SetNumberOfThreads(nThreads);
126 G4RunManager * runManager =
new G4RunManager;
130 G4Random::setTheSeed(myseed);
135 runManager-> SetUserInitialization(
new OpNoviceDetectorConstruction());
137 G4VModularPhysicsList* physicsList =
new FTFP_BERT;
138 physicsList->ReplacePhysics(
new G4EmStandardPhysics_option4());
139 G4OpticalPhysics* opticalPhysics =
new G4OpticalPhysics();
140 physicsList->RegisterPhysics(opticalPhysics);
141 runManager-> SetUserInitialization(physicsList);
144 runManager->SetUserInitialization(
new OpNoviceActionInitialization());
148 G4VisManager* visManager =
new G4VisExecutive(
"Quiet");
149 visManager->Initialize();
152 G4UImanager* UImanager = G4UImanager::GetUIpointer();
154 if ( macro.size() ) {
156 G4String command =
"/control/execute ";
157 UImanager->ApplyCommand(command+macro);
161 UImanager->ApplyCommand(
"/control/execute vis.mac");
163 UImanager->ApplyCommand(
"/control/execute gui.mac");
static G4UIterminal * session