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

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

#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "globals.hh"
#include "QGSP_BERT.hh"
#include "G02DetectorConstruction.hh"
#include "G02PrimaryGeneratorAction.hh"
#include "G02RunAction.hh"
#include "G4VisExecutive.hh"
#include "G4UIExecutive.hh"
Include dependency graph for geotest.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the persistency/gdml/G02 example.

Definition in file geotest.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 59 of file geotest.cc.

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

Here is the call graph for this function: