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

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

#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "SteppingVerbose.hh"
#include "RunAction.hh"
#include "SteppingAction.hh"
Include dependency graph for TestEm15.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the electromagnetic/TestEm15 example.

Definition in file TestEm15.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 55 of file TestEm15.cc.

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