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

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

#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "RunAction.hh"
Include dependency graph for TestEm0.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the electromagnetic/TestEm0 example.

Definition in file TestEm0.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 49 of file TestEm0.cc.

49  {
50 
51  // Construct the default run manager
52  G4RunManager * runManager = new G4RunManager;
53 
54  // set mandatory initialization classes
57  runManager->SetUserInitialization(det = new DetectorConstruction);
58  runManager->SetUserInitialization(new PhysicsList);
59  runManager->SetUserAction(prim = new PrimaryGeneratorAction(det));
60 
61  // set user action classes
62  runManager->SetUserAction(new RunAction(det,prim));
63 
64  if (argc!=1) // batch mode
65  {
66  G4String command = "/control/execute ";
67  G4String fileName = argv[1];
68  G4UImanager::GetUIpointer()->ApplyCommand(command+fileName);
69  }
70 
71  else // define UI terminal for interactive mode
72  {
73 #ifdef G4UI_USE
74  G4UIExecutive * ui = new G4UIExecutive(argc,argv);
75  ui->SessionStart();
76  delete ui;
77 #endif
78  }
79  // job termination
80  //
81  delete runManager;
82 
83  return 0;
84 }
The primary generator action class with particle gun.
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
Detector construction class to define materials and geometry.
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: