Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
RE01.cc File Reference

Main program of the runAndEvent/RE01 example. More...

#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "RE01DetectorConstruction.hh"
#include "RE01PhysicsList.hh"
#include "QGSP_BERT.hh"
#include "RE01ActionInitialization.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the runAndEvent/RE01 example.

Definition in file RE01.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 65 of file RE01.cc.

References G4UImanager::ApplyCommand(), G4UImanager::GetUIpointer(), G4RunManager::Initialize(), G4VisManager::Initialize(), G4UIExecutive::SessionStart(), and G4RunManager::SetUserInitialization().

66 {
67 #ifdef G4MULTITHREADED
68  G4MTRunManager * runManager = new G4MTRunManager;
69  //runManager->SetNumberOfThreads(4);
70 #else
71  G4RunManager * runManager = new G4RunManager;
72 #endif
73 
74 #ifdef G4VIS_USE
75  // Visualization manager construction
76  G4VisManager* visManager = new G4VisExecutive;
77  visManager->Initialize();
78 #endif
79 
81  runManager->SetUserInitialization(new RE01PhysicsList);
82  //runManager->SetUserInitialization(new QGSP_BERT);
83 
85 
86  runManager->Initialize();
87 
88  if(argc==1)
89  {
90 #ifdef G4UI_USE
91  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
92  ui->SessionStart();
93  delete ui;
94 #endif
95  }
96  else
97  {
98  G4UImanager* UImanager = G4UImanager::GetUIpointer();
99  G4String command = "/control/execute ";
100  G4String fileName = argv[1];
101  UImanager->ApplyCommand(command+fileName);
102  }
103 
104 #ifdef G4VIS_USE
105  delete visManager;
106 #endif
107 
108  delete runManager;
109 
110  return 0;
111 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
void Initialize()
virtual void Initialize()
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:419