Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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 ()
 
G4VUserPhysicsListGetUserPhysicsList () const
 

Static Public Member Functions

static G4ErrorRunManagerHelperGetRunManagerKernel ()
 

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{
58 if(fRunManagerKernel)
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
67 theG4RunManagerKernel = G4RunManagerKernel::GetRunManagerKernel();
68 if(theG4RunManagerKernel == 0)
69 {
70 //--- if not create it
71 theG4RunManagerKernel = new G4RunManagerKernel();
72 G4cout << " creating G4RunManagerKernel " << theG4RunManagerKernel
73 << G4endl;
74 }
75
76 theG4RunManagerKernel->SetVerboseLevel(2);
77 theUserPhysicsList = 0;
78 theUserWorld = 0;
79}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
static G4RunManagerKernel * GetRunManagerKernel()
void SetVerboseLevel(G4int vl)

◆ ~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}

◆ GetUserPhysicsList()

G4VUserPhysicsList * G4ErrorRunManagerHelper::GetUserPhysicsList ( ) const
inline

Definition at line 86 of file G4ErrorRunManagerHelper.hh.

86{ return 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 {
112 theG4RunManagerKernel->DefineWorldVolume(theUserWorld);
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()

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 {
139 theG4RunManagerKernel->SetPhysics(theUserPhysicsList);
140 theG4RunManagerKernel->InitializePhysics();
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
163 theG4RunManagerKernel->SetPhysics(new G4ErrorPhysicsList);
164 // theG4RunManagerKernel->SetPhysics(new ExN02PhysicsList);
165 theG4RunManagerKernel->InitializePhysics();
166 }
167 }
168}
@ JustWarning
G4VUserPhysicsList * GetUserPhysicsList() const
void SetPhysics(G4VUserPhysicsList *uPhys)
static G4RunManager * GetRunManager()

Referenced by G4ErrorPropagatorManager::InitGeant4e().

◆ RunInitialization()

void G4ErrorRunManagerHelper::RunInitialization ( )

Definition at line 171 of file G4ErrorRunManagerHelper.cc.

172{
173 theG4RunManagerKernel->RunInitialization();
174}
G4bool RunInitialization(G4bool fakeRun=false)

Referenced by G4ErrorPropagatorManager::InitGeant4e().

◆ RunTermination()

void G4ErrorRunManagerHelper::RunTermination ( )

Definition at line 189 of file G4ErrorRunManagerHelper.cc.

190{
191 theG4RunManagerKernel->RunTermination();
192}

Referenced by G4ErrorPropagatorManager::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()

◆ SetUserAction() [2/2]

void G4ErrorRunManagerHelper::SetUserAction ( G4UserTrackingAction * userAction)

Definition at line 177 of file G4ErrorRunManagerHelper.cc.

178{
180}

◆ SetUserInitialization() [1/3]

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VPhysicalVolume * userInit)

Definition at line 92 of file G4ErrorRunManagerHelper.cc.

93{
94 theUserWorld = userInit;
95}

◆ SetUserInitialization() [2/3]

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VUserDetectorConstruction * userInit)

◆ SetUserInitialization() [3/3]

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VUserPhysicsList * userInit)

Definition at line 98 of file G4ErrorRunManagerHelper.cc.

100{
101 theUserPhysicsList = userInit;
102}

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