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