Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
exampleP01.cc File Reference

Main program of the persistency/P01 example. More...

Include dependency graph for exampleP01.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the persistency/P01 example.

Definition in file exampleP01.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 58 of file exampleP01.cc.

58  {
59 
60  //my Verbose output class
62 
63  // Run manager
64  G4RunManager * runManager = new G4RunManager;
65 
66  // UserInitialization classes (mandatory)
68  runManager->SetUserInitialization(ExP01detector);
69 
70  G4VModularPhysicsList* physicsList = new FTFP_BERT;
71  runManager->SetUserInitialization(physicsList);
72 
73 #ifdef G4VIS_USE
74  // Visualization, if you choose to have it!
75  G4VisManager* visManager = new G4VisExecutive;
76  visManager->Initialize();
77 #endif
78 
79  // UserAction classes
80  runManager->SetUserAction(new ExP01PrimaryGeneratorAction(ExP01detector));
81  runManager->SetUserAction(new ExP01RunAction);
82  runManager->SetUserAction(new ExP01EventAction);
83  runManager->SetUserAction(new ExP01SteppingAction);
84 
85  //Initialize G4 kernel
86  runManager->Initialize();
87 
88  //get the pointer to the User Interface manager
89  G4UImanager * UImanager = G4UImanager::GetUIpointer();
90 
91  if(argc==1)
92  // Define (G)UI terminal for interactive mode
93  {
94 #ifdef G4UI_USE
95  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
96 #ifdef G4VIS_USE
97  UImanager->ApplyCommand("/control/execute vis.mac");
98 #endif
99  ui->SessionStart();
100  delete ui;
101 #endif
102  }
103  else
104  // Batch mode
105  {
106  G4String command = "/control/execute ";
107  G4String fileName = argv[1];
108  UImanager->ApplyCommand(command+fileName);
109  }
110 
111 #ifdef G4VIS_USE
112  delete visManager;
113 #endif
114 
115  delete runManager;
116 
117  return 0;
118 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
Detector Construction for the persistency example.
Stepping verbose for the persistency example.
Run action for the persistency example.
void Initialize()
TFTFP_BERT< G4VModularPhysicsList > FTFP_BERT
Definition: FTFP_BERT.hh:63
static void SetInstance(G4VSteppingVerbose *Instance)
Primary generator action for the persistency example.
virtual void Initialize()
Event action for the persistency example.
Stepping action for the persistency example.
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447
virtual void SetUserAction(G4UserRunAction *userAction)

Here is the call graph for this function: