Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GunGPS.cc File Reference
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "Randomize.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorGPS.hh"
#include "PrimaryGeneratorGun1.hh"
#include "PrimaryGeneratorGun2.hh"
#include "RunAction.hh"
#include "TrackingAction.hh"
#include "SteppingVerbose.hh"
Include dependency graph for GunGPS.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

int main ( int  argc,
char **  argv 
)

PrimaryGeneratorGPS* prim = new PrimaryGeneratorGPS();

PrimaryGeneratorGun2* prim = new PrimaryGeneratorGun2();

Definition at line 58 of file GunGPS.cc.

58  {
59 
60  //choose the Random engine
62 
63  //my Verbose output class
65 
66  // Construct the default run manager
67  G4RunManager * runManager = new G4RunManager;
68 
69  // set mandatory initialization classes
70  //
72  runManager->SetUserInitialization(detector);
73  runManager->SetUserInitialization(new PhysicsList);
74 
75  // set user action classes
76  //
77  RunAction* run = new RunAction();
81  TrackingAction* track = new TrackingAction();
82 
83  runManager->SetUserAction(run);
84  runManager->SetUserAction(prim);
85  runManager->SetUserAction(track);
86 
87  //Initialize G4 kernel
88  runManager->Initialize();
89 
90  // get the pointer to the User Interface manager
92 
93 #ifdef G4VIS_USE
94  G4VisManager* visManager = new G4VisExecutive;
95  visManager->Initialize();
96 #endif
97 
98  if (argc!=1) // batch mode
99  {
100  G4String command = "/control/execute ";
101  G4String fileName = argv[1];
102  UI->ApplyCommand(command+fileName);
103  }
104 
105  else // define visualization and UI terminal for interactive mode
106  {
107 #ifdef G4UI_USE
108  G4UIExecutive * ui = new G4UIExecutive(argc,argv);
109 #ifdef G4VIS_USE
110  UI->ApplyCommand("/control/execute vis.mac");
111 #endif
112  ui->SessionStart();
113  delete ui;
114 #endif
115 
116 #ifdef G4VIS_USE
117  delete visManager;
118 #endif
119  }
120 
121  // job termination
122  //
123  delete runManager;
124 
125  return 0;
126 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
void Initialize()
static void SetInstance(G4VSteppingVerbose *Instance)
virtual 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: