musr.cc File Reference

#include "alc01DetectorConstruction.hh"
#include "alc01PhysicsList.hh"
#include "alc01PrimaryGeneratorAction.hh"
#include "alc01RunAction.hh"
#include "alc01EventAction.hh"
#include "alc01SteppingAction.hh"
#include "alc01SteppingVerbose.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4UIterminal.hh"
#include "G4UItcsh.hh"
#include "Randomize.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)


Function Documentation

int main int  argc,
char **  argv
 

Definition at line 21 of file musr.cc.

00021                                {
00022 
00023   // choose the Random engine
00024   HepRandom::setTheEngine(new RanecuEngine);
00025 
00026   //my Verbose output class
00027   G4VSteppingVerbose::SetInstance(new alc01SteppingVerbose);
00028   
00029   // Run manager
00030   G4RunManager * runManager = new G4RunManager;
00031 
00032   // UserInitialization classes (mandatory)
00033   alc01DetectorConstruction* alc01detector = new alc01DetectorConstruction;
00034   runManager->SetUserInitialization(alc01detector);
00035   runManager->SetUserInitialization(new alc01PhysicsList);
00036   
00037 #ifdef G4VIS_USE
00038   // Visualization, if you choose to have it!
00039   G4VisManager* visManager = new alc01VisManager;
00040   visManager->Initialize();
00041 #endif
00042    
00043   // UserAction classes
00044   runManager->SetUserAction(new alc01PrimaryGeneratorAction(alc01detector));
00045   runManager->SetUserAction(new alc01RunAction);  
00046   runManager->SetUserAction(new alc01EventAction);
00047   runManager->SetUserAction(new alc01SteppingAction);
00048 
00049   //Initialize G4 kernel
00050   runManager->Initialize();
00051       
00052   //get the pointer to the User Interface manager 
00053   G4UImanager * UI = G4UImanager::GetUIpointer();  
00054 
00055   if(argc==1)
00056   // Define (G)UI terminal for interactive mode  
00057   { 
00058     // G4UIterminal is a (dumb) terminal.
00059     G4UIsession * session = 0;
00060 #ifdef G4UI_USE_TCSH
00061       session = new G4UIterminal(new G4UItcsh);      
00062 #else
00063       session = new G4UIterminal();
00064 #endif    
00065 
00066     UI->ApplyCommand("/control/execute vis.mac");    
00067     session->SessionStart();
00068     delete session;
00069   }
00070   else
00071   // Batch mode
00072   { 
00073     G4String command = "/control/execute ";
00074     G4String fileName = argv[1];
00075     UI->ApplyCommand(command+fileName);
00076   }
00077 
00078 #ifdef G4VIS_USE
00079   delete visManager;
00080 #endif
00081   delete runManager;
00082 
00083   return 0;
00084 }


Generated on Mon Mar 27 12:19:54 2006 for MUSR by  doxygen 1.4.6