G4ErrorRunManagerHelper Class Reference

#include <G4ErrorRunManagerHelper.hh>


Public Member Functions

 G4ErrorRunManagerHelper ()
virtual ~G4ErrorRunManagerHelper ()
void SetUserInitialization (G4VUserDetectorConstruction *userInit)
void SetUserInitialization (G4VPhysicalVolume *userInit)
void SetUserInitialization (G4VUserPhysicsList *userInit)
void SetUserAction (G4UserTrackingAction *userAction)
void SetUserAction (G4UserSteppingAction *userAction)
void RunInitialization ()
void InitializeGeometry ()
void InitializePhysics ()
void RunTermination ()
G4VUserPhysicsList * GetUserPhysicsList () const

Static Public Member Functions

static G4ErrorRunManagerHelper * GetRunManagerKernel ()


Detailed Description

Definition at line 51 of file G4ErrorRunManagerHelper.hh.


Constructor & Destructor Documentation

G4ErrorRunManagerHelper::G4ErrorRunManagerHelper (  ) 

Definition at line 55 of file G4ErrorRunManagerHelper.cc.

References FatalException, G4cout, G4endl, G4Exception(), G4RunManagerKernel::GetRunManagerKernel(), and G4RunManagerKernel::SetVerboseLevel().

00056 {
00057   if(fRunManagerKernel) {
00058     G4Exception("G4ErrorRunManagerHelper::G4ErrorRunManagerHelper()",
00059                 "InvalidSetup", FatalException,
00060                 "G4eRunManageKernel constructed twice.");
00061   }
00062   fRunManagerKernel = this;
00063 
00064   //----- Look if somebody has created a G4RunManagerKernel
00065   theG4RunManagerKernel = G4RunManagerKernel::GetRunManagerKernel();
00066   if( theG4RunManagerKernel == 0 ) {
00067     //--- if not create it
00068     theG4RunManagerKernel = new G4RunManagerKernel();
00069     G4cout << " creating G4RunManagerKernel " <<  theG4RunManagerKernel << G4endl;
00070   }
00071     
00072   theG4RunManagerKernel->SetVerboseLevel(2);
00073   theUserPhysicsList = 0;
00074   theUserWorld = 0;
00075 
00076 }

G4ErrorRunManagerHelper::~G4ErrorRunManagerHelper (  )  [virtual]

Definition at line 80 of file G4ErrorRunManagerHelper.cc.

00081 {
00082 }


Member Function Documentation

G4ErrorRunManagerHelper * G4ErrorRunManagerHelper::GetRunManagerKernel (  )  [static]

Definition at line 50 of file G4ErrorRunManagerHelper.cc.

00051 { return fRunManagerKernel; }

G4VUserPhysicsList* G4ErrorRunManagerHelper::GetUserPhysicsList (  )  const [inline]

Definition at line 87 of file G4ErrorRunManagerHelper.hh.

Referenced by InitializePhysics().

00088     { return theUserPhysicsList; }

void G4ErrorRunManagerHelper::InitializeGeometry (  ) 

Definition at line 107 of file G4ErrorRunManagerHelper.cc.

References G4RunManagerKernel::DefineWorldVolume(), FatalException, G4Exception(), and G4TransportationManager::GetTransportationManager().

Referenced by G4ErrorPropagatorManager::InitGeant4e().

00108 {
00109   //check if user world has been directly called or someone initialized the world volume already 
00110   //----- First option: geometry has been defined to GEANT4e 
00111   if( theUserWorld != 0 ) {
00112     theG4RunManagerKernel->DefineWorldVolume( theUserWorld );
00113     
00114     //----- Second option: geometry has been defined to GEANT4, do nothing GEANT4 should take care 
00115   } else {
00116     //  G4cerr << "G4 TM " << G4TransportationManager::GetTransportationManager() 
00117     //      << " NAV " << G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking() 
00118     //      << " WORLD " << G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume() << G4endl;
00119     //--- Check that indeed geometry has been defined to GEANT4
00120     if ( G4TransportationManager::GetTransportationManager()
00121          ->GetNavigatorForTracking()->GetWorldVolume() == 0 ) {
00122       G4Exception("G4ErrorRunManagerHelper::InitializeGeometry()",
00123                   "InvalisSetup", FatalException,
00124                   "No world defined in your geometry!" );
00125     }
00126     
00127   }
00128 }

void G4ErrorRunManagerHelper::InitializePhysics (  ) 

Definition at line 132 of file G4ErrorRunManagerHelper.cc.

References G4cerr, G4cout, G4endl, G4RunManager::GetRunManager(), GetUserPhysicsList(), G4RunManagerKernel::InitializePhysics(), and G4RunManagerKernel::SetPhysics().

Referenced by G4ErrorPropagatorManager::InitGeant4e().

00133 {
00134 
00135   G4cout << "  G4ErrorRunManagerHelper::InitializePhysics "  << G4endl;
00136 
00137   //----- First option: physics list has been defined to GEANT4e 
00138   if( theUserPhysicsList != 0 ) {
00139     theG4RunManagerKernel->SetPhysics(theUserPhysicsList);
00140     theG4RunManagerKernel->InitializePhysics();
00141   }else {
00142   //----- Second option: physics list has been defined to GEANT4, do nothing GEANT4 should take care 
00143     if( G4RunManager::GetRunManager() != 0 && G4RunManager::GetRunManager()->GetUserPhysicsList() != 0 ){ 
00144       //--- Physics should be G4ErrorPhysicsList, else send a warning
00145       if( static_cast<const G4ErrorPhysicsList*>(G4RunManager::GetRunManager()->GetUserPhysicsList()) == 0 ) {
00146         G4cerr << " WARNING G4ErrorRunManagerHelper::InitializePhysics() physics list is not G4ErrorPhysicsList. Are you sure? " << G4endl;
00147       }
00148     } else {
00149       //----- Third option: no physics list has been defined, define a G4ErrorPhysicsList
00150       theG4RunManagerKernel->SetPhysics(new G4ErrorPhysicsList);
00151       //    theG4RunManagerKernel->SetPhysics(new ExN02PhysicsList);
00152       theG4RunManagerKernel->InitializePhysics();
00153     }
00154   }
00155  
00156 }

void G4ErrorRunManagerHelper::RunInitialization (  ) 

Definition at line 160 of file G4ErrorRunManagerHelper.cc.

References G4RunManagerKernel::RunInitialization().

Referenced by G4ErrorPropagatorManager::InitGeant4e().

00161 {
00162   theG4RunManagerKernel->RunInitialization();
00163 }

void G4ErrorRunManagerHelper::RunTermination (  ) 

Definition at line 182 of file G4ErrorRunManagerHelper.cc.

References G4RunManagerKernel::RunTermination().

Referenced by G4ErrorPropagatorManager::RunTermination().

00183 {
00184   theG4RunManagerKernel->RunTermination();
00185 }

void G4ErrorRunManagerHelper::SetUserAction ( G4UserSteppingAction *  userAction  ) 

Definition at line 175 of file G4ErrorRunManagerHelper.cc.

References G4EventManager::GetEventManager(), and G4EventManager::SetUserAction().

00176 {
00177   G4EventManager::GetEventManager()->SetUserAction( userAction );
00178 }

void G4ErrorRunManagerHelper::SetUserAction ( G4UserTrackingAction *  userAction  ) 

Definition at line 167 of file G4ErrorRunManagerHelper.cc.

References G4EventManager::GetEventManager(), and G4EventManager::SetUserAction().

00168 {
00169 
00170   G4EventManager::GetEventManager()->SetUserAction( userAction );
00171 }

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VUserPhysicsList *  userInit  ) 

Definition at line 100 of file G4ErrorRunManagerHelper.cc.

00101 {
00102   theUserPhysicsList = userInit;
00103 }

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VPhysicalVolume *  userInit  ) 

Definition at line 93 of file G4ErrorRunManagerHelper.cc.

00094 {
00095   theUserWorld = userInit;
00096 }

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VUserDetectorConstruction *  userInit  ) 

Definition at line 86 of file G4ErrorRunManagerHelper.cc.

References G4VUserDetectorConstruction::Construct().

Referenced by G4ErrorPropagatorManager::SetUserInitialization().

00087 { 
00088   theUserWorld = userInit->Construct();
00089 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:51:55 2013 for Geant4 by  doxygen 1.4.7