Geant4  10.02.p03
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 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

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 62 of file geotest.cc.

63 {
64 
65  // Construct the default run manager
66  //
67  G4RunManager* runManager = new G4RunManager;
68 
69  // Set mandatory initialization and user action classes
70  //
72  runManager->SetUserInitialization(detector);
73  runManager->SetUserInitialization(new QGSP_BERT);
75  G02RunAction* runAction = new G02RunAction;
76  runManager->SetUserAction(runAction);
77 
78  // Initialisation of runManager via macro for the interactive mode
79  // This gives possibility to give different names for GDML file to READ
80 
81 #ifdef G4VIS_USE
82  G4VisManager* visManager = new G4VisExecutive;
83  visManager->Initialize();
84 #endif
85 
86  // Open a UI session: will stay there until the user types "exit"
87  //
88  G4UImanager* UImanager = G4UImanager::GetUIpointer();
89 
90  if ( argc==1 ) // Automatically run default macro for writing...
91  {
92 #ifdef G4UI_USE
93  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
94 #ifdef G4VIS_USE
95  UImanager->ApplyCommand("/control/execute vis.mac");
96 #endif
97  ui->SessionStart();
98  delete ui;
99 #endif
100  } else { // Provides macro in input
101 #ifdef G4UI_USE
102  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
103  G4String command = "/control/execute ";
104  G4String fileName = argv[1];
105  UImanager->ApplyCommand(command+fileName);
106  ui->SessionStart();
107  delete ui;
108 #endif
109  }
110 
111 #ifdef G4VIS_USE
112  delete visManager;
113 #endif
114 
115  // Job termination
116  //
117  delete runManager;
118 
119  return 0;
120 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
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:446
virtual void SetUserAction(G4UserRunAction *userAction)
Here is the call graph for this function: