#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "GPSPrimaryGeneratorAction.hh"
#include "SteppingVerbose.hh"
Go to the source code of this file.
Functions | |
int | main (int argc, char **argv) |
int main | ( | int | argc, | |
char ** | argv | |||
) |
Definition at line 27 of file jour2e.cc.
00027 { 00028 00029 //my Verbose output class 00030 G4VSteppingVerbose::SetInstance(new SteppingVerbose); 00031 00032 //Construct the default run manager 00033 G4RunManager* runManager = new G4RunManager; 00034 00035 //set mandatory initialization classes 00036 // 00037 DetectorConstruction* detector = new DetectorConstruction(); 00038 runManager->SetUserInitialization(detector); 00039 00040 PhysicsList* physics = new PhysicsList(); 00041 runManager->SetUserInitialization(physics); 00042 00043 GPSPrimaryGeneratorAction* primary = new GPSPrimaryGeneratorAction(); 00044 runManager->SetUserAction(primary); 00045 00046 //Initialize Geant4 kernel 00047 // 00048 runManager->Initialize(); 00049 00050 //get the pointer to the User Interface manager 00051 G4UImanager* UI = G4UImanager::GetUIpointer(); 00052 00053 if (argc!=1) { // Batch mode 00054 G4String command = "/control/execute "; 00055 G4String fileName = argv[1]; 00056 UI->ApplyCommand(command+fileName); 00057 } 00058 00059 else { // Define UI terminal for interactive mode 00060 00061 #ifdef G4VIS_USE 00062 G4VisManager* visManager = new G4VisExecutive; 00063 visManager->Initialize(); 00064 #endif 00065 00066 G4UIsession* session = 0; 00067 #ifdef G4UI_USE_TCSH 00068 session = new G4UIterminal(new G4UItcsh); 00069 #else 00070 session = new G4UIterminal(); 00071 #endif 00072 UI->ApplyCommand( "/control/execute vis.mac"); 00073 session->SessionStart(); 00074 delete session; 00075 00076 #ifdef G4VIS_USE 00077 delete visManager; 00078 #endif 00079 } 00080 00081 //job termination 00082 // 00083 delete runManager; 00084 return 0; 00085 }