Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
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"

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.

References G4UImanager::ApplyCommand(), G4UImanager::GetUIpointer(), G4RunManager::Initialize(), G4VisManager::Initialize(), G4UIExecutive::SessionStart(), G4VSteppingVerbose::SetInstance(), CLHEP::HepRandom::setTheEngine(), G4RunManager::SetUserAction(), and G4RunManager::SetUserInitialization().

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 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
void Initialize()
static void SetInstance(G4VSteppingVerbose *Instance)
virtual void Initialize()
static void setTheEngine(HepRandomEngine *theNewEngine)
Definition: Random.cc:170
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:419
virtual void SetUserAction(G4UserRunAction *userAction)