Main program of the persistency/P02 example.
More...
#include "ExP02DetectorConstruction.hh"
#include "ExP02DetConstrReader.hh"
#include "ExP02PrimaryGeneratorAction.hh"
#include "FTFP_BERT.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Main program of the persistency/P02 example.
Definition in file exampleP02.cc.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 56 of file exampleP02.cc.
61 G4cout <<
"Please give 'write' or 'read' as argument " << G4endl;
65 G4VUserDetectorConstruction* det;
67 if(std::string(argv[1]) ==
"read")
69 det =
new ExP02DetConstrReader;
71 else if(std::string(argv[1]) ==
"write")
73 det =
new ExP02DetectorConstruction;
77 G4cout <<
"Wrong argument!" << G4endl;
82 G4RunManager * runManager =
new G4RunManager;
85 runManager->SetUserInitialization(det);
87 G4VModularPhysicsList* physicsList =
new FTFP_BERT;
88 runManager->SetUserInitialization(physicsList);
92 G4VisManager* visManager =
new G4VisExecutive;
93 visManager->Initialize();
97 runManager->SetUserAction(
new ExP02PrimaryGeneratorAction());
100 runManager->Initialize();
103 G4UImanager * UImanager = G4UImanager::GetUIpointer();
106 G4UIExecutive* ui =
new G4UIExecutive(argc, argv);
108 UImanager->ApplyCommand(
"/control/execute vis.mac");