Main program of the exoticphysics/ucn example.
More...
#include <unistd.h>
#include "G4Types.hh"
#include "ExUCNPhysicsList.hh"
#include "ExUCNDetectorConstruction.hh"
#include "ExUCNActionInitialization.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 exoticphysics/ucn example.
Definition in file ExUCN.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 74 of file ExUCN.cc.
References PrintUsage(), and session.
85 #ifdef G4MULTITHREADED 90 for ( G4int i=1; i<argc; i=i+2 ) {
91 if (
G4String(argv[i]) ==
"-m" ) macro = argv[i+1];
92 else if (
G4String(argv[i]) ==
"-u" ) session = argv[i+1];
93 else if (
G4String(argv[i]) ==
"-r" ) myseed = atoi(argv[i+1]);
94 #ifdef G4MULTITHREADED 95 else if (
G4String(argv[i]) ==
"-t" ) {
96 nThreads = G4UIcommand::ConvertToInt(argv[i+1]);
106 G4UIExecutive* ui =
nullptr;
108 ui =
new G4UIExecutive(argc, argv);
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 ExUCNDetectorConstruction());
132 runManager->SetUserInitialization(
new ExUCNPhysicsList());
134 runManager->SetUserInitialization(
new ExUCNActionInitialization());
138 runManager->Initialize();
142 G4VisManager* visManager =
new G4VisExecutive;
145 visManager->Initialize();
149 G4UImanager* UImanager = G4UImanager::GetUIpointer();
151 if ( macro.size() ) {
153 G4String command =
"/control/execute ";
154 UImanager->ApplyCommand(command+macro);
158 UImanager->ApplyCommand(
"/control/execute vis.mac");
160 UImanager->ApplyCommand(
"/control/execute gui.mac");
static G4UIterminal * session