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

Main program of the electromagnetic/TestEm10 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 "StackingAction.hh"
Include dependency graph for TestEm10.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the electromagnetic/TestEm10 example.

Definition in file TestEm10.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 57 of file TestEm10.cc.

58 {
59 
60  //choose the Random engine
61 
63 
64  // Construct the default run manager
65 
66  G4RunManager * runManager = new G4RunManager;
67 
68  // set mandatory initialization classes
69 
70  DetectorConstruction* detector;
71  detector = new DetectorConstruction;
72 
73  // ALICEDetectorConstruction* detector;
74  // detector = new ALICEDetectorConstruction;
75 
76  runManager->SetUserInitialization(detector);
77  runManager->SetUserInitialization(new PhysicsList(detector));
78 
79  // set user action classes
80  runManager->SetUserAction(new PrimaryGeneratorAction());
81 
82  RunAction* runAction = new RunAction;
83  runManager->SetUserAction(runAction);
84 
85  EventAction* eventAction = new EventAction(runAction);
86  runManager->SetUserAction(eventAction);
87 
88  runManager->SetUserAction( new StackingAction );
89 
90 
92 
93  if (argc!=1) // batch mode
94  {
95  G4String command = "/control/execute ";
96  G4String fileName = argv[1];
97  UI->ApplyCommand(command+fileName);
98  }
99 
100  else //define visualization and UI terminal for interactive mode
101  {
102 #ifdef G4VIS_USE
103  G4VisManager* visManager = new G4VisExecutive;
104  visManager->Initialize();
105 #endif
106 
107 #ifdef G4UI_USE
108  G4UIExecutive * ui = new G4UIExecutive(argc,argv);
109  ui->SessionStart();
110  delete ui;
111 #endif
112 
113 #ifdef G4VIS_USE
114  delete visManager;
115 #endif
116  }
117 
118  // job termination
119  //
120  delete runManager;
121 
122  return 0;
123 }
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: