Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 51 of file G4ErrorRunManagerHelper.hh.

Constructor & Destructor Documentation

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
66  theG4RunManagerKernel = G4RunManagerKernel::GetRunManagerKernel();
67  if( theG4RunManagerKernel == 0 ) {
68  //--- if not create it
69  theG4RunManagerKernel = new G4RunManagerKernel();
70  G4cout << " creating G4RunManagerKernel " << theG4RunManagerKernel << G4endl;
71  }
72 
73  theG4RunManagerKernel->SetVerboseLevel(2);
74  theUserPhysicsList = 0;
75  theUserWorld = 0;
76 
77 }
static G4RunManagerKernel * GetRunManagerKernel()
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
void SetVerboseLevel(G4int vl)

Here is the call graph for this function:

G4ErrorRunManagerHelper::~G4ErrorRunManagerHelper ( )
virtual

Definition at line 81 of file G4ErrorRunManagerHelper.cc.

82 {
83 }

Member Function Documentation

G4ErrorRunManagerHelper * G4ErrorRunManagerHelper::GetRunManagerKernel ( )
static

Definition at line 51 of file G4ErrorRunManagerHelper.cc.

52 { return fRunManagerKernel; }
G4VUserPhysicsList* G4ErrorRunManagerHelper::GetUserPhysicsList ( ) const
inline

Definition at line 87 of file G4ErrorRunManagerHelper.hh.

88  { return theUserPhysicsList; }

Here is the caller graph for this function:

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 ) {
113  theG4RunManagerKernel->DefineWorldVolume( theUserWorld );
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 }
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:

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 ) {
137  theG4RunManagerKernel->SetPhysics(theUserPhysicsList);
138  theG4RunManagerKernel->InitializePhysics();
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
151  theG4RunManagerKernel->SetPhysics(new G4ErrorPhysicsList);
152  // theG4RunManagerKernel->SetPhysics(new ExN02PhysicsList);
153  theG4RunManagerKernel->InitializePhysics();
154  }
155  }
156 
157 }
void SetPhysics(G4VUserPhysicsList *uPhys)
G4VUserPhysicsList * GetUserPhysicsList() const
G4GLOB_DLL std::ostream G4cout
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:

void G4ErrorRunManagerHelper::RunInitialization ( )

Definition at line 161 of file G4ErrorRunManagerHelper.cc.

162 {
163  theG4RunManagerKernel->RunInitialization();
164 }
G4bool RunInitialization(G4bool fakeRun=false)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4ErrorRunManagerHelper::RunTermination ( )

Definition at line 183 of file G4ErrorRunManagerHelper.cc.

184 {
185  theG4RunManagerKernel->RunTermination();
186 }

Here is the call graph for this function:

Here is the caller graph for this function:

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:

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:

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VUserDetectorConstruction userInit)

Definition at line 87 of file G4ErrorRunManagerHelper.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VPhysicalVolume userInit)

Definition at line 94 of file G4ErrorRunManagerHelper.cc.

95 {
96  theUserWorld = userInit;
97 }
void G4ErrorRunManagerHelper::SetUserInitialization ( G4VUserPhysicsList userInit)

Definition at line 101 of file G4ErrorRunManagerHelper.cc.

102 {
103  theUserPhysicsList = userInit;
104 }

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