#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#include "DetectorConstruction.hh"
#include "PhysicsList.hh"
#include "PrimaryGeneratorAction.hh"
#include "SteppingAction.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 jour3a.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 PrimaryGeneratorAction* primary = new PrimaryGeneratorAction(detector); 00044 runManager->SetUserAction(primary); 00045 00046 //set user action classes 00047 // 00048 SteppingAction* step_action = new SteppingAction(detector); 00049 runManager->SetUserAction(step_action); 00050 00051 00052 //Initialize Geant4 kernel 00053 // 00054 runManager->Initialize(); 00055 00056 //get the pointer to the User Interface manager 00057 G4UImanager* UI = G4UImanager::GetUIpointer(); 00058 00059 if (argc!=1) { // Batch mode 00060 G4String command = "/control/execute "; 00061 G4String fileName = argv[1]; 00062 UI->ApplyCommand(command+fileName); 00063 } 00064 00065 else { // Define UI terminal for interactive mode 00066 00067 #ifdef G4VIS_USE 00068 G4VisManager* visManager = new G4VisExecutive; 00069 visManager->Initialize(); 00070 #endif 00071 00072 G4UIsession* session = 0; 00073 #ifdef G4UI_USE_TCSH 00074 session = new G4UIterminal(new G4UItcsh); 00075 #else 00076 session = new G4UIterminal(); 00077 #endif 00078 UI->ApplyCommand( "/control/execute vis.mac"); 00079 session->SessionStart(); 00080 delete session; 00081 00082 #ifdef G4VIS_USE 00083 delete visManager; 00084 #endif 00085 } 00086 00087 //job termination 00088 // 00089 delete runManager; 00090 return 0; 00091 }