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

Main program of the geometry/transforms example. More...

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

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the geometry/transforms example.

Definition in file transforms.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 54 of file transforms.cc.

54  {
55 
56  //choose the Random engine
58 
59  //my Verbose output class
61 
62  // Construct the default run manager
63  G4RunManager * runManager = new G4RunManager;
64 
65  // set mandatory initialization classes
67  runManager->SetUserInitialization(new PhysicsList);
68 
69  // set user action classes
70  runManager->SetUserAction(new PrimaryGeneratorAction);
71 
72  //Initialize G4 kernel
73  runManager->Initialize();
74 
75  // get the pointer to the User Interface manager
77 
78  if (argc!=1) // batch mode
79  {
80  G4String command = "/control/execute ";
81  G4String fileName = argv[1];
82  UI->ApplyCommand(command+fileName);
83  }
84 
85  else // define visualization and UI terminal for interactive mode
86  {
87 #ifdef G4VIS_USE
88  G4VisManager* visManager = new G4VisExecutive;
89  visManager->Initialize();
90 #endif
91 
92 #ifdef G4UI_USE
93  G4UIExecutive * ui = new G4UIExecutive(argc,argv);
94 #ifdef G4VIS_USE
95  UI->ApplyCommand("/control/execute vis.mac");
96 #endif
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)
virtual void Initialize()
Detector construction class to define materials and geometry.
static void setTheEngine(HepRandomEngine *theNewEngine)
Definition: Random.cc:270
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: