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

Main program of the medical/GammaTherapy example. More...

#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "TrackingAction.hh"
#include "RunAction.hh"
#include "Histo.hh"
Include dependency graph for GammaTherapy.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the medical/GammaTherapy example.

Definition in file GammaTherapy.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 68 of file GammaTherapy.cc.

68  {
69 
70  //choose the Random engine
72 
73  // Construct the default run manager
74  G4RunManager * runManager = new G4RunManager();
75 
76  // set mandatory initialization classes
78  runManager->SetUserInitialization(det);
79 
80  runManager->SetUserInitialization(new PhysicsList());
81 
82  // set user action classes
83  runManager->SetUserAction(new PrimaryGeneratorAction(det));
84  runManager->SetUserAction(new RunAction());
85  runManager->SetUserAction(new TrackingAction());
86 
87  // get the pointer to the User Interface manager
89 
90 #ifdef G4VIS_USE
91  G4VisManager* visManager = new G4VisExecutive("Quiet");
92  visManager->Initialize();
93 #endif
94 
95  if (argc==1) // Define UI terminal for interactive mode
96  {
97 #ifdef G4UI_USE
98  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
99 #ifdef G4VIS_USE
100  UImanager->ApplyCommand("/control/execute vis.mac");
101 #endif
102  ui->SessionStart();
103  delete ui;
104 #endif
105  }
106  else if (argc>1) // Batch mode with 1 or more files
107  {
108  G4String command = "/control/execute ";
109  G4String fileName = argv[1];
110  UImanager->ApplyCommand(command+fileName);
111  }
112 
113 #ifdef G4VIS_USE
114  delete visManager;
115 #endif
116 
117  // job termination
118  delete runManager;
119 
120  return 0;
121 }
The primary generator action class with particle gun.
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
void Initialize()
Detector construction class to define materials and geometry.
static void setTheEngine(HepRandomEngine *theNewEngine)
Definition: Random.cc:270
Run action class.
Definition: RunAction.hh:45
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447
virtual void SetUserAction(G4UserRunAction *userAction)
Physics list class.
Definition: PhysicsList.hh:47

Here is the call graph for this function: