Main program of the hadronic/Hadr00 example.
More...
#include "G4RunManager.hh"
#include "G4MTRunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "G4PhysListFactory.hh"
#include "G4VModularPhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "ActionInitialization.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 hadronic/Hadr00 example.
Definition in file Hadr00.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 62 of file Hadr00.cc.
65 G4UIExecutive* ui =
nullptr;
66 if (argc == 1) { ui =
new G4UIExecutive(argc,argv); }
68 #ifdef G4MULTITHREADED 69 G4MTRunManager * runManager =
new G4MTRunManager();
73 G4int nThreads = G4UIcommand::ConvertToInt(argv[3]);
74 runManager->SetNumberOfThreads(nThreads);
76 G4cout <<
"##### Hadr00 started for " << runManager->GetNumberOfThreads()
77 <<
" threads" <<
" #####" << G4endl;
79 G4RunManager * runManager =
new G4RunManager();
80 G4cout <<
"##### Hadr00 started in sequential mode" 81 <<
" #####" << G4endl;
86 runManager->SetUserInitialization(det);
88 G4PhysListFactory factory;
89 G4VModularPhysicsList* phys =
nullptr;
93 if (argc>=3) { physName = argv[2]; }
97 char* path = std::getenv(
"PHYSLIST");
98 if (path) { physName =
G4String(path); }
102 if(
"" == physName || !factory.IsReferencePhysList(physName)) {
103 physName =
"FTFP_BERT";
107 phys = factory.GetReferencePhysList(physName);
109 runManager->SetUserInitialization(phys);
110 det->SetPhysicsList(phys);
113 runManager->SetUserInitialization(
new ActionInitialization(det));
116 G4VisManager* visManager =
nullptr;
119 G4UImanager* UImanager = G4UImanager::GetUIpointer();
123 visManager =
new G4VisExecutive;
124 visManager->Initialize();
129 G4String command =
"/control/execute ";
131 UImanager->ApplyCommand(command+fileName);