Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
rdecay02.cc File Reference

Main program of the radioactivedecay/rdecay02 example. More...

#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "exrdmDetectorConstruction.hh"
#include "exrdmPhysicsList.hh"
#include "exrdmEventAction.hh"
#include "exrdmRunAction.hh"
#include "exrdmSteppingAction.hh"
#include "exrdmPrimaryGeneratorAction.hh"
#include "exrdmAnalysisManager.hh"
#include "Randomize.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the radioactivedecay/rdecay02 example.

Definition in file rdecay02.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 51 of file rdecay02.cc.

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

52 {
53  // random engine
55 
56  // Construct the default run manager
57  G4RunManager* runManager = new G4RunManager;
58 
59  // Creation of the analysis manager
61 
62  // set mandatory initialization classes
63 
65  runManager->SetUserInitialization(Detector);
66  runManager->SetUserInitialization(new exrdmPhysicsList);
67 
68  // set mandatory user action class
70  runManager->SetUserAction(new exrdmRunAction);
71  runManager->SetUserAction(new exrdmEventAction);
72  runManager->SetUserAction(new exrdmSteppingAction);
73 
74 #ifdef G4VIS_USE
75  // visualization manager
76  G4VisManager* visManager = new G4VisExecutive;
77  visManager->Initialize();
78 #endif
79 
80  // Initialize G4 kernel
81  // do this at run time so the geometry/physics can be changed
82  // runManager->Initialize();
83 
84  // get the pointer to the User Interface manager
85  G4UImanager* UImanager = G4UImanager::GetUIpointer();
86 
87  if (argc == 1) // Define UI session for interactive mode.
88  {
89 #ifdef G4UI_USE
90  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
91  ui->SessionStart();
92  delete ui;
93 #endif
94  }
95  else // Batch mode
96  {
97  G4String command = "/control/execute ";
98  G4String fileName = argv[1];
99  UImanager->ApplyCommand(command+fileName);
100  }
101 
102  // job termination
103 #ifdef G4VIS_USE
104  delete visManager;
105 #endif
107  delete runManager;
108 
109  return 0;
110 }
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
void Initialize()
static exrdmAnalysisManager * GetInstance()
static void setTheEngine(HepRandomEngine *theNewEngine)
Definition: Random.cc:170
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:419
virtual void SetUserAction(G4UserRunAction *userAction)