Main program of the electromagnetic/TestEm3 example.
More...
#include "G4Types.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "ActionInitialization.hh"
#include "SteppingVerbose.hh"
#include "G4UIExecutive.hh"
#include "G4VisExecutive.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Main program of the electromagnetic/TestEm3 example.
Definition in file TestEm3.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 53 of file TestEm3.cc.
56 G4UIExecutive* ui =
nullptr;
57 if (argc == 1) { ui =
new G4UIExecutive(argc,argv); }
60 G4VSteppingVerbose::SetInstance(
new SteppingVerbose);
63 #ifdef G4MULTITHREADED 64 G4MTRunManager* runManager =
new G4MTRunManager;
69 nThreads = G4Threading::G4GetNumberOfCores();
71 nThreads = G4UIcommand::ConvertToInt(argv[2]);
76 if (nThreads > 0) { runManager->SetNumberOfThreads(nThreads); }
77 G4cout <<
"===== TestEm3 is started with " 78 << runManager->GetNumberOfThreads() <<
" threads =====" << G4endl;
80 G4RunManager* runManager =
new G4RunManager;
85 runManager->SetUserInitialization(detector);
89 runManager->SetUserInitialization(
new ActionInitialization(detector));
92 G4VisManager* visManager =
nullptr;
95 G4UImanager* UImanager = G4UImanager::GetUIpointer();
99 visManager =
new G4VisExecutive();
100 visManager->Initialize();
105 G4String command =
"/control/execute ";
107 UImanager->ApplyCommand(command+fileName);