Geant4  10.02.p03
G4ErrorRunManagerHelper Class Reference

#include <G4ErrorRunManagerHelper.hh>

Collaboration diagram for G4ErrorRunManagerHelper:

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 ()
 

Private Attributes

G4VUserPhysicsList * theUserPhysicsList
 
G4VPhysicalVolume * theUserWorld
 
G4RunManagerKernel * theG4RunManagerKernel
 

Static Private Attributes

static G4ThreadLocal G4ErrorRunManagerHelper * fRunManagerKernel = 0
 

Detailed Description

Definition at line 51 of file G4ErrorRunManagerHelper.hh.

Constructor & Destructor Documentation

◆ G4ErrorRunManagerHelper()

G4ErrorRunManagerHelper::G4ErrorRunManagerHelper ( )

Definition at line 56 of file G4ErrorRunManagerHelper.cc.

57 {
58  if(fRunManagerKernel) {
59  G4Exception("G4ErrorRunManagerHelper::G4ErrorRunManagerHelper()",
60  "InvalidSetup", FatalException,
61  "G4eRunManageKernel constructed twice.");
62  }
63  fRunManagerKernel = this;
64 
65  //----- Look if somebody has created a G4RunManagerKernel
67  if( theG4RunManagerKernel == 0 ) {
68  //--- if not create it
70  G4cout << " creating G4RunManagerKernel " << theG4RunManagerKernel << G4endl;
71  }
72 
75  theUserWorld = 0;
76 
77 }
G4VPhysicalVolume * theUserWorld
static G4RunManagerKernel * GetRunManagerKernel()
G4RunManagerKernel * theG4RunManagerKernel
G4VUserPhysicsList * theUserPhysicsList
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
static G4ThreadLocal G4ErrorRunManagerHelper * fRunManagerKernel
void SetVerboseLevel(G4int vl)
Here is the call graph for this function:

◆ ~G4ErrorRunManagerHelper()

G4ErrorRunManagerHelper::~G4ErrorRunManagerHelper ( )
virtual

Definition at line 81 of file G4ErrorRunManagerHelper.cc.

82 {
83 }

Member Function Documentation

◆ GetRunManagerKernel()

G4ErrorRunManagerHelper * G4ErrorRunManagerHelper::GetRunManagerKernel ( )
static

Definition at line 51 of file G4ErrorRunManagerHelper.cc.

52 { return fRunManagerKernel; }
static G4ThreadLocal G4ErrorRunManagerHelper * fRunManagerKernel
Here is the caller graph for this function:

◆ GetUserPhysicsList()

G4VUserPhysicsList* G4ErrorRunManagerHelper::GetUserPhysicsList ( ) const
inline

Definition at line 87 of file G4ErrorRunManagerHelper.hh.

88  { return theUserPhysicsList; }
G4VUserPhysicsList * theUserPhysicsList
Here is the caller graph for this function:

◆ InitializeGeometry()

void G4ErrorRunManagerHelper::InitializeGeometry ( )

Definition at line 108 of file G4ErrorRunManagerHelper.cc.

109 {
110  //check if user world has been directly called or someone initialized the world volume already
111  //----- First option: geometry has been defined to GEANT4e
112  if( theUserWorld != 0 ) {
114 
115  //----- Second option: geometry has been defined to GEANT4, do nothing GEANT4 should take care
116  } else {
117  //--- Check that indeed geometry has been defined to GEANT4
119  ->GetNavigatorForTracking()->GetWorldVolume() == 0 ) {
120  G4Exception("G4ErrorRunManagerHelper::InitializeGeometry()",
121  "InvalisSetup", FatalException,
122  "No world defined in your geometry!" );
123  }
124 
125  }
126 }
G4VPhysicalVolume * theUserWorld
G4RunManagerKernel * theG4RunManagerKernel
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4TransportationManager * GetTransportationManager()
void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitializePhysics()

void G4ErrorRunManagerHelper::InitializePhysics ( )

Definition at line 130 of file G4ErrorRunManagerHelper.cc.

131 {
132 
133  G4cout << " G4ErrorRunManagerHelper::InitializePhysics " << G4endl;
134 
135  //----- First option: physics list has been defined to GEANT4e
136  if( theUserPhysicsList != 0 ) {
139  }else {
140  //----- Second option: physics list has been defined to GEANT4, do nothing GEANT4 should take care
142  //--- Physics should be G4ErrorPhysicsList, else send a warning
143  if( static_cast<const G4ErrorPhysicsList*>(G4RunManager::GetRunManager()->GetUserPhysicsList()) == 0 ) {
144  std::ostringstream message;
145  message << "Physics list is not G4ErrorPhysicsList. Are you sure?";
146  G4Exception("G4ErrorRunManagerHelper::InitializePhysics()",
147  "GEANT4e-Notification", JustWarning, message);
148  }
149  } else {
150  //----- Third option: no physics list has been defined, define a G4ErrorPhysicsList
152  // theG4RunManagerKernel->SetPhysics(new ExN02PhysicsList);
154  }
155  }
156 
157 }
void SetPhysics(G4VUserPhysicsList *uPhys)
G4RunManagerKernel * theG4RunManagerKernel
G4VUserPhysicsList * theUserPhysicsList
G4GLOB_DLL std::ostream G4cout
G4VUserPhysicsList * GetUserPhysicsList() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunInitialization()

void G4ErrorRunManagerHelper::RunInitialization ( )

Definition at line 161 of file G4ErrorRunManagerHelper.cc.

162 {
164 }
G4RunManagerKernel * theG4RunManagerKernel
G4bool RunInitialization(G4bool fakeRun=false)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunTermination()

void G4ErrorRunManagerHelper::RunTermination ( )

Definition at line 183 of file G4ErrorRunManagerHelper.cc.

184 {
186 }
G4RunManagerKernel * theG4RunManagerKernel
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetUserAction() [1/2]

void G4ErrorRunManagerHelper::SetUserAction ( G4UserTrackingAction *  userAction)

Definition at line 168 of file G4ErrorRunManagerHelper.cc.

169 {
170 
172 }
void SetUserAction(G4UserEventAction *userAction)
static G4EventManager * GetEventManager()
Here is the call graph for this function:

◆ SetUserAction() [2/2]

void G4ErrorRunManagerHelper::SetUserAction ( G4UserSteppingAction *  userAction)

Definition at line 176 of file G4ErrorRunManagerHelper.cc.

177 {
179 }
void SetUserAction(G4UserEventAction *userAction)
static G4EventManager * GetEventManager()
Here is the call graph for this function:

◆ SetUserInitialization() [1/3]

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VUserDetectorConstruction *  userInit)

Definition at line 87 of file G4ErrorRunManagerHelper.cc.

88 {
89  theUserWorld = userInit->Construct();
90 }
virtual G4VPhysicalVolume * Construct()=0
G4VPhysicalVolume * theUserWorld
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetUserInitialization() [2/3]

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VPhysicalVolume *  userInit)

Definition at line 94 of file G4ErrorRunManagerHelper.cc.

95 {
96  theUserWorld = userInit;
97 }
G4VPhysicalVolume * theUserWorld

◆ SetUserInitialization() [3/3]

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VUserPhysicsList *  userInit)

Definition at line 101 of file G4ErrorRunManagerHelper.cc.

102 {
103  theUserPhysicsList = userInit;
104 }
G4VUserPhysicsList * theUserPhysicsList

Member Data Documentation

◆ fRunManagerKernel

G4ThreadLocal G4ErrorRunManagerHelper * G4ErrorRunManagerHelper::fRunManagerKernel = 0
staticprivate

Definition at line 92 of file G4ErrorRunManagerHelper.hh.

◆ theG4RunManagerKernel

G4RunManagerKernel* G4ErrorRunManagerHelper::theG4RunManagerKernel
private

Definition at line 97 of file G4ErrorRunManagerHelper.hh.

◆ theUserPhysicsList

G4VUserPhysicsList* G4ErrorRunManagerHelper::theUserPhysicsList
private

Definition at line 94 of file G4ErrorRunManagerHelper.hh.

◆ theUserWorld

G4VPhysicalVolume* G4ErrorRunManagerHelper::theUserWorld
private

Definition at line 95 of file G4ErrorRunManagerHelper.hh.


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