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

Main program of the persistency/gdml/G03 example. More...

#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "globals.hh"
#include "QGSP_BERT.hh"
#include "G03DetectorConstruction.hh"
#include "G03PrimaryGeneratorAction.hh"
#include "G03RunAction.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"
Include dependency graph for gdml_ext.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the persistency/gdml/G03 example.

Definition in file gdml_ext.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 59 of file gdml_ext.cc.

60 {
61 
62  // Construct the default run manager
63  //
64  G4RunManager* runManager = new G4RunManager;
65 
66  // Set mandatory initialization and user action classes
67  //
69  runManager->SetUserInitialization(detector);
70  runManager->SetUserInitialization(new QGSP_BERT);
72  G03RunAction* runAction = new G03RunAction;
73  runManager->SetUserAction(runAction);
74 
75  // Initialisation of runManager via macro for the interactive mode
76  // This gives possibility to give different names for GDML file to READ
77 
78  // Initialize visualization
79  //
80  G4VisManager* visManager = new G4VisExecutive;
81  visManager->Initialize();
82 
83  // Run initialisation macro
84  //
86 
87  if ( argc==1 ) // Define UI session for interactive mode.
88  {
89  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
90  UImanager->ApplyCommand("/control/execute vis.mac");
91  ui->SessionStart();
92  delete ui;
93  }
94  else // Batch mode
95  {
96  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
97  G4String command = "/control/execute ";
98  G4String fileName = argv[1];
99  UImanager->ApplyCommand(command+fileName);
100  ui->SessionStart();
101  delete ui;
102  }
103 
104  // Job termination
105  //
106  delete visManager;
107  delete runManager;
108 
109  return 0;
110 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
void Initialize()
Run action for the GDML extension example.
Definition: G03RunAction.hh:50
Detector construction for the GDML extensions example.
Primary generator action for the GDML extension example.
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447
virtual void SetUserAction(G4UserRunAction *userAction)

Here is the call graph for this function: