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

Main program of the polarisation/Pol01 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 "SteppingAction.hh"
Include dependency graph for Pol01.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the polarisation/Pol01 example.

Definition in file Pol01.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 56 of file Pol01.cc.

56  {
57 
58  //choose the Random engine
59  // CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine);
61 
62  // Construct the default run manager
63  G4RunManager * runManager = new G4RunManager;
64 
65  // set mandatory initialization classes
68  runManager->SetUserInitialization(det = new DetectorConstruction);
69  runManager->SetUserInitialization(new PhysicsList);
70  runManager->SetUserAction(prim = new PrimaryGeneratorAction(det));
71 
72 #ifdef G4VIS_USE
73  G4VisManager* visManager = 0;
74 #endif
75 
76  // set user action classes
77  RunAction* run;
78  runManager->SetUserAction(run = new RunAction(det,prim));
79  runManager->SetUserAction(new EventAction(run));
80  runManager->SetUserAction(new SteppingAction(det,prim,run));
81 
82  // get the pointer to the User Interface manager
83  G4UImanager* UImanager = G4UImanager::GetUIpointer();
84 
85  if (argc==1) // Define UI terminal for interactive mode
86  {
87 #ifdef G4VIS_USE
88  visManager = new G4VisExecutive;
89  visManager->Initialize();
90 #endif
91 #ifdef G4UI_USE
92  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
93  ui->SessionStart();
94  delete ui;
95 #endif
96  }
97  else // Batch mode
98  {
99  G4String command = "/control/execute ";
100  G4String fileName = argv[1];
101  UImanager->ApplyCommand(command+fileName);
102  }
103 
104  // job termination
105 #ifdef G4VIS_USE
106  delete visManager;
107 #endif
108  delete runManager;
109 
110  return 0;
111 }
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: