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

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

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

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the electromagnetic/TestEm17 example.

Definition in file TestEm17.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 59 of file TestEm17.cc.

59  {
60 
61  //choose the Random engine
63 
64  //my Verbose output class
66 
67  // Construct the default run manager
68  G4RunManager * runManager = new G4RunManager;
69 
70  // set mandatory initialization classes
73  runManager->SetUserInitialization(det = new DetectorConstruction);
74  runManager->SetUserInitialization(new PhysicsList);
75  runManager->SetUserAction(prim = new PrimaryGeneratorAction(det));
76 
77  HistoManager* histo = new HistoManager();
78 
79  // set user action classes
80  RunAction* run;
81  runManager->SetUserAction(run = new RunAction(det,prim,histo));
82  runManager->SetUserAction(new SteppingAction(run,histo));
83  runManager->SetUserAction(new StackingAction);
84 
85  // Start execution
86  //
87  if (argc > 1) { // execute an argument macro file if exist
88  G4String command = "/control/execute ";
89  G4String fileName = argv[1];
90  G4UImanager::GetUIpointer()->ApplyCommand(command+fileName);
91 
92  } else { // start interactive session
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 histo;
112  delete runManager;
113 
114  return 0;
115 }
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: