Main program of the hadronic/Hadr02 example.
More...
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "G4PhysListFactory.hh"
#include "G4VModularPhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "RunAction.hh"
#include "EventAction.hh"
#include "StackingAction.hh"
#include "HistoManager.hh"
#include "G4UIExecutive.hh"
#include "G4VisExecutive.hh"
#include "UrQMD.hh"
#include "CRMC_FTFP_BERT.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Main program of the hadronic/Hadr02 example.
Definition in file Hadr02.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 59 of file Hadr02.cc.
62 G4UIExecutive* ui =
nullptr;
63 if (argc == 1) ui =
new G4UIExecutive(argc,argv);
66 CLHEP::HepRandom::setTheEngine(
new CLHEP::RanecuEngine());
69 G4RunManager * runManager =
new G4RunManager();
74 G4PhysListFactory factory;
75 G4VModularPhysicsList* phys = 0;
81 if (argc==3) { physName = argv[2]; }
83 char* path = std::getenv(
"PHYSLIST");
84 if (path) { physName =
G4String(path); }
86 if ( physName ==
"UrQMD" ) {
88 }
else if ( physName ==
"CRMC_FTFP_BERT" ) {
89 phys =
new CRMC_FTFP_BERT;
91 phys = factory.GetReferencePhysList( physName );
96 G4cout <<
"Hadr02 FATAL ERROR: Physics List is not defined" 100 runManager->SetUserInitialization(phys);
101 HistoManager::GetPointer()->SetPhysicsList(phys);
106 runManager->SetUserAction(
new RunAction());
107 runManager->SetUserAction(
new EventAction());
108 runManager->SetUserAction(
new StackingAction());
111 G4VisManager* visManager =
new G4VisExecutive;
112 visManager->Initialize();
115 G4UImanager* UImanager = G4UImanager::GetUIpointer();
124 G4String command =
"/control/execute ";
126 UImanager->ApplyCommand(command+fileName);