#include "G4ios.hh" #include #include "IVBDetectorConstruction.hh" #include "IVBPhysicsList.hh" #include "IVBPrimaryGeneratorAction.hh" #include "IVBVisManager.hh" #include "IVBScintillatorHit.hh" #include "IVBScintillatorSD.hh" #include "G4RunManager.hh" #include "G4UImanager.hh" #include "G4UIterminal.hh" #include "G4UItcsh.hh" #ifdef G4UI_USE_XM #include "G4UIXm.hh" #endif #ifdef G4VIS_USE #include "IVBVisManager.hh" #endif #include "IVBEventAction.hh" #include "IVBDetectorConstruction.hh" #include "IVBPhysicsList.hh" #include "IVBPrimaryGeneratorAction.hh" #include "G4SDManager.hh" #include "IVBRunAction.hh" #include "Randomize.hh" #include "G4SDManager.hh" #include "G4UImanager.hh" #include "G4UImessenger.hh" int main(int argc ,char ** argv) { HepRandom::setTheEngine(new RanecuEngine); G4int seed = time(0); HepRandom :: setTheSeed(seed); G4RunManager* runManager = new G4RunManager; IVBDetectorConstruction *pDetectorConstruction = new IVBDetectorConstruction(); runManager->SetUserInitialization(pDetectorConstruction); runManager->SetUserInitialization(new IVBPhysicsList); runManager->SetUserAction(new IVBPrimaryGeneratorAction); #ifdef G4VIS_USE // visualization manager G4VisManager* visManager = new IVBVisManager; visManager->Initialize(); #endif // output environment variables: #ifdef G4ANALYSIS_USE G4cout << G4endl << G4endl << G4endl << " User Environment " << G4endl << " Using AIDA 3.0 analysis " << G4endl; # else G4cout << G4endl << G4endl << G4endl << " User Environment " << G4endl << " G4ANALYSIS_USE environment variable not set, NO ANALYSIS " << G4endl; #endif G4UIsession* session = 0; if (argc == 1) // Define UI session for interactive mode. { session = new G4UIterminal(); } IVBEventAction *pEventAction = new IVBEventAction(); runManager ->SetUserAction(pEventAction ); IVBRunAction *pRunAction = new IVBRunAction(); runManager->SetUserAction(pRunAction); //Initialize G4 kernel runManager->Initialize(); // get the pointer to the User Interface manager G4UImanager* UI = G4UImanager::GetUIpointer(); if (session) // Define UI session for interactive mode. { G4cout<<" UI session starts ..."<< G4endl; session->SessionStart(); delete session; } else // Batch mode { G4String command = "/control/execute "; G4String fileName = argv[1]; UI->ApplyCommand(command+fileName); } // Job termination #ifdef G4VIS_USE delete visManager; #endif delete runManager; return 0; }