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

Main program of the electromagnetic/TestEm9 example. More...

#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "RunAction.hh"
#include "EventAction.hh"
#include "SteppingAction.hh"
#include "TrackingAction.hh"
Include dependency graph for TestEm9.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the electromagnetic/TestEm9 example.

Definition in file TestEm9.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 58 of file TestEm9.cc.

58  {
59 
60  //choose the Random engine
62  //CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
63 
64  //Construct the default run manager
65  G4RunManager * runManager = new G4RunManager;
66 
67  //set mandatory initialization classes
69  PhysicsList* phys;
71  runManager->SetUserInitialization(det);
72  runManager->SetUserInitialization(phys = new PhysicsList);
73  runManager->SetUserAction(kin = new PrimaryGeneratorAction(det));
74 
75  //set user action classes
76  runManager->SetUserAction(new RunAction());
77  runManager->SetUserAction(new EventAction());
78  runManager->SetUserAction(new TrackingAction());
79  runManager->SetUserAction(new SteppingAction());
80 
81  //get the pointer to the User Interface manager
83 
84  if (argc!=1) // batch mode
85  {
86  G4String command = "/control/execute ";
87  G4String fileName = argv[1];
88  UI->ApplyCommand(command+fileName);
89  }
90 
91  else //define visualization and UI terminal for interactive mode
92  {
93 #ifdef G4VIS_USE
94  G4VisManager* visManager = new G4VisExecutive;
95  visManager->Initialize();
96 #endif
97 
98 #ifdef G4UI_USE
99  G4UIExecutive * ui = new G4UIExecutive(argc,argv);
100  ui->SessionStart();
101  delete ui;
102 #endif
103 
104 #ifdef G4VIS_USE
105  delete visManager;
106 #endif
107  }
108 
109  //job termination
110  //
111  delete runManager;
112 
113  return 0;
114 }
The primary generator action class with particle gun.
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
Event action class.
Definition: EventAction.hh:45
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: