Geant4-11
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
G4ErrorRunManagerHelper Class Reference

#include <G4ErrorRunManagerHelper.hh>

Public Member Functions

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

Static Public Member Functions

static G4ErrorRunManagerHelperGetRunManagerKernel ()
 

Private Attributes

G4RunManagerKerneltheG4RunManagerKernel
 
G4VUserPhysicsListtheUserPhysicsList
 
G4VPhysicalVolumetheUserWorld
 

Static Private Attributes

static G4ThreadLocal G4ErrorRunManagerHelperfRunManagerKernel = 0
 

Detailed Description

Definition at line 52 of file G4ErrorRunManagerHelper.hh.

Constructor & Destructor Documentation

◆ G4ErrorRunManagerHelper()

G4ErrorRunManagerHelper::G4ErrorRunManagerHelper ( )

Definition at line 56 of file G4ErrorRunManagerHelper.cc.

57{
59 {
60 G4Exception("G4ErrorRunManagerHelper::G4ErrorRunManagerHelper()",
61 "InvalidSetup", FatalException,
62 "G4eRunManageKernel constructed twice.");
63 }
64 fRunManagerKernel = this;
65
66 //----- Look if somebody has created a G4RunManagerKernel
69 {
70 //--- if not create it
72 G4cout << " creating G4RunManagerKernel " << theG4RunManagerKernel
73 << G4endl;
74 }
75
78 theUserWorld = 0;
79}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4RunManagerKernel * theG4RunManagerKernel
G4VUserPhysicsList * theUserPhysicsList
static G4ThreadLocal G4ErrorRunManagerHelper * fRunManagerKernel
G4VPhysicalVolume * theUserWorld
static G4RunManagerKernel * GetRunManagerKernel()
void SetVerboseLevel(G4int vl)

References FatalException, fRunManagerKernel, G4cout, G4endl, G4Exception(), G4RunManagerKernel::GetRunManagerKernel(), G4RunManagerKernel::SetVerboseLevel(), theG4RunManagerKernel, theUserPhysicsList, and theUserWorld.

◆ ~G4ErrorRunManagerHelper()

G4ErrorRunManagerHelper::~G4ErrorRunManagerHelper ( )
virtual

Definition at line 82 of file G4ErrorRunManagerHelper.cc.

82{}

Member Function Documentation

◆ GetRunManagerKernel()

G4ErrorRunManagerHelper * G4ErrorRunManagerHelper::GetRunManagerKernel ( )
static

Definition at line 50 of file G4ErrorRunManagerHelper.cc.

51{
52 return fRunManagerKernel;
53}

References fRunManagerKernel.

Referenced by G4ErrorPropagatorManager::StartG4ErrorRunManagerHelper().

◆ GetUserPhysicsList()

G4VUserPhysicsList * G4ErrorRunManagerHelper::GetUserPhysicsList ( ) const
inline

Definition at line 86 of file G4ErrorRunManagerHelper.hh.

86{ return theUserPhysicsList; }

References theUserPhysicsList.

Referenced by InitializePhysics().

◆ InitializeGeometry()

void G4ErrorRunManagerHelper::InitializeGeometry ( )

Definition at line 105 of file G4ErrorRunManagerHelper.cc.

106{
107 // check if user world has been directly called or someone initialized the
108 // world volume already
109 //----- First option: geometry has been defined to GEANT4e
110 if(theUserWorld != 0)
111 {
113
114 //----- Second option: geometry has been defined to GEANT4, do nothing
115 //GEANT4 should take care
116 }
117 else
118 {
119 //--- Check that indeed geometry has been defined to GEANT4
121 ->GetNavigatorForTracking()
122 ->GetWorldVolume() == 0)
123 {
124 G4Exception("G4ErrorRunManagerHelper::InitializeGeometry()",
125 "InvalisSetup", FatalException,
126 "No world defined in your geometry!");
127 }
128 }
129}
void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
static G4TransportationManager * GetTransportationManager()

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

Referenced by G4ErrorPropagatorManager::InitGeant4e().

◆ InitializePhysics()

void G4ErrorRunManagerHelper::InitializePhysics ( )

Definition at line 132 of file G4ErrorRunManagerHelper.cc.

133{
134 G4cout << " G4ErrorRunManagerHelper::InitializePhysics " << G4endl;
135
136 //----- First option: physics list has been defined to GEANT4e
137 if(theUserPhysicsList != 0)
138 {
141 }
142 else
143 {
144 //----- Second option: physics list has been defined to GEANT4, do nothing
145 //GEANT4 should take care
146 if(G4RunManager::GetRunManager() != 0 &&
148 {
149 //--- Physics should be G4ErrorPhysicsList, else send a warning
150 if(static_cast<const G4ErrorPhysicsList*>(
152 {
153 std::ostringstream message;
154 message << "Physics list is not G4ErrorPhysicsList. Are you sure?";
155 G4Exception("G4ErrorRunManagerHelper::InitializePhysics()",
156 "GEANT4e-Notification", JustWarning, message);
157 }
158 }
159 else
160 {
161 //----- Third option: no physics list has been defined, define a
162 //G4ErrorPhysicsList
164 // theG4RunManagerKernel->SetPhysics(new ExN02PhysicsList);
166 }
167 }
168}
@ JustWarning
G4VUserPhysicsList * GetUserPhysicsList() const
void SetPhysics(G4VUserPhysicsList *uPhys)
static G4RunManager * GetRunManager()

References G4cout, G4endl, G4Exception(), G4RunManager::GetRunManager(), GetUserPhysicsList(), G4RunManagerKernel::InitializePhysics(), JustWarning, G4RunManagerKernel::SetPhysics(), theG4RunManagerKernel, and theUserPhysicsList.

Referenced by G4ErrorPropagatorManager::InitGeant4e().

◆ RunInitialization()

void G4ErrorRunManagerHelper::RunInitialization ( )

◆ RunTermination()

void G4ErrorRunManagerHelper::RunTermination ( )

◆ SetUserAction() [1/2]

void G4ErrorRunManagerHelper::SetUserAction ( G4UserSteppingAction userAction)

Definition at line 183 of file G4ErrorRunManagerHelper.cc.

184{
186}
void SetUserAction(G4UserEventAction *userAction)
static G4EventManager * GetEventManager()

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

◆ SetUserAction() [2/2]

void G4ErrorRunManagerHelper::SetUserAction ( G4UserTrackingAction userAction)

◆ SetUserInitialization() [1/3]

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VPhysicalVolume userInit)

Definition at line 92 of file G4ErrorRunManagerHelper.cc.

93{
94 theUserWorld = userInit;
95}

References theUserWorld.

◆ SetUserInitialization() [2/3]

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VUserDetectorConstruction userInit)

Definition at line 85 of file G4ErrorRunManagerHelper.cc.

87{
88 theUserWorld = userInit->Construct();
89}
virtual G4VPhysicalVolume * Construct()=0

References G4VUserDetectorConstruction::Construct(), and theUserWorld.

Referenced by G4ErrorPropagatorManager::SetUserInitialization().

◆ SetUserInitialization() [3/3]

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VUserPhysicsList userInit)

Definition at line 98 of file G4ErrorRunManagerHelper.cc.

100{
101 theUserPhysicsList = userInit;
102}

References theUserPhysicsList.

Field Documentation

◆ fRunManagerKernel

G4ThreadLocal G4ErrorRunManagerHelper * G4ErrorRunManagerHelper::fRunManagerKernel = 0
staticprivate

Definition at line 89 of file G4ErrorRunManagerHelper.hh.

Referenced by G4ErrorRunManagerHelper(), and GetRunManagerKernel().

◆ theG4RunManagerKernel

G4RunManagerKernel* G4ErrorRunManagerHelper::theG4RunManagerKernel
private

◆ theUserPhysicsList

G4VUserPhysicsList* G4ErrorRunManagerHelper::theUserPhysicsList
private

◆ theUserWorld

G4VPhysicalVolume* G4ErrorRunManagerHelper::theUserWorld
private

The documentation for this class was generated from the following files: