LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
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"

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
71  CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
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
88  G4UImanager* UImanager = G4UImanager::GetUIpointer();
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 }
TConfigurablePhysicsList< ModularPhysicsList > PhysicsList
Definition: PhysicsList.h:86