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 "UrQMD.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 71 of file Hadr02.cc.
74 CLHEP::HepRandom::setTheEngine(
new CLHEP::RanecuEngine());
77 G4RunManager * runManager =
new G4RunManager();
82 G4PhysListFactory factory;
83 G4VModularPhysicsList* phys = 0;
89 if (argc==3) { physName = argv[2]; }
91 char* path = getenv(
"PHYSLIST");
92 if (path) { physName =
G4String(path); }
94 if ( physName ==
"UrQMD" ) { phys =
new UrQMD; }
95 else { phys = factory.GetReferencePhysList(physName); }
99 G4cout <<
"Hadr02 FATAL ERROR: Physics List is not defined" 103 runManager->SetUserInitialization(phys);
104 HistoManager::GetPointer()->SetPhysicsList(phys);
109 runManager->SetUserAction(
new RunAction());
110 runManager->SetUserAction(
new EventAction());
111 runManager->SetUserAction(
new StackingAction());
114 G4UImanager* UImanager = G4UImanager::GetUIpointer();
116 G4VisManager* visManager = 0;
123 visManager =
new G4VisExecutive;
124 visManager->Initialize();
127 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);
134 G4String command =
"/control/execute ";
136 UImanager->ApplyCommand(command+fileName);