Geant4 9.6.0
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 51 of file G4ErrorRunManagerHelper.hh.

Constructor & Destructor Documentation

◆ G4ErrorRunManagerHelper()

G4ErrorRunManagerHelper::G4ErrorRunManagerHelper ( )

Definition at line 55 of file G4ErrorRunManagerHelper.cc.

56{
57 if(fRunManagerKernel) {
58 G4Exception("G4ErrorRunManagerHelper::G4ErrorRunManagerHelper()",
59 "InvalidSetup", FatalException,
60 "G4eRunManageKernel constructed twice.");
61 }
62 fRunManagerKernel = this;
63
64 //----- Look if somebody has created a G4RunManagerKernel
65 theG4RunManagerKernel = G4RunManagerKernel::GetRunManagerKernel();
66 if( theG4RunManagerKernel == 0 ) {
67 //--- if not create it
68 theG4RunManagerKernel = new G4RunManagerKernel();
69 G4cout << " creating G4RunManagerKernel " << theG4RunManagerKernel << G4endl;
70 }
71
72 theG4RunManagerKernel->SetVerboseLevel(2);
73 theUserPhysicsList = 0;
74 theUserWorld = 0;
75
76}
@ FatalException
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
static G4RunManagerKernel * GetRunManagerKernel()
void SetVerboseLevel(G4int vl)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41

◆ ~G4ErrorRunManagerHelper()

G4ErrorRunManagerHelper::~G4ErrorRunManagerHelper ( )
virtual

Definition at line 80 of file G4ErrorRunManagerHelper.cc.

81{
82}

Member Function Documentation

◆ GetRunManagerKernel()

G4ErrorRunManagerHelper * G4ErrorRunManagerHelper::GetRunManagerKernel ( )
static

Definition at line 50 of file G4ErrorRunManagerHelper.cc.

51{ return fRunManagerKernel; }

◆ GetUserPhysicsList()

G4VUserPhysicsList * G4ErrorRunManagerHelper::GetUserPhysicsList ( ) const
inline

Definition at line 87 of file G4ErrorRunManagerHelper.hh.

88 { return theUserPhysicsList; }

Referenced by InitializePhysics().

◆ InitializeGeometry()

void G4ErrorRunManagerHelper::InitializeGeometry ( )

Definition at line 107 of file G4ErrorRunManagerHelper.cc.

108{
109 //check if user world has been directly called or someone initialized the world volume already
110 //----- First option: geometry has been defined to GEANT4e
111 if( theUserWorld != 0 ) {
112 theG4RunManagerKernel->DefineWorldVolume( theUserWorld );
113
114 //----- Second option: geometry has been defined to GEANT4, do nothing GEANT4 should take care
115 } else {
116 // G4cerr << "G4 TM " << G4TransportationManager::GetTransportationManager()
117 // << " NAV " << G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()
118 // << " WORLD " << G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume() << G4endl;
119 //--- Check that indeed geometry has been defined to GEANT4
121 ->GetNavigatorForTracking()->GetWorldVolume() == 0 ) {
122 G4Exception("G4ErrorRunManagerHelper::InitializeGeometry()",
123 "InvalisSetup", FatalException,
124 "No world defined in your geometry!" );
125 }
126
127 }
128}
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
135 G4cout << " G4ErrorRunManagerHelper::InitializePhysics " << G4endl;
136
137 //----- First option: physics list has been defined to GEANT4e
138 if( theUserPhysicsList != 0 ) {
139 theG4RunManagerKernel->SetPhysics(theUserPhysicsList);
140 theG4RunManagerKernel->InitializePhysics();
141 }else {
142 //----- Second option: physics list has been defined to GEANT4, do nothing GEANT4 should take care
144 //--- Physics should be G4ErrorPhysicsList, else send a warning
145 if( static_cast<const G4ErrorPhysicsList*>(G4RunManager::GetRunManager()->GetUserPhysicsList()) == 0 ) {
146 G4cerr << " WARNING G4ErrorRunManagerHelper::InitializePhysics() physics list is not G4ErrorPhysicsList. Are you sure? " << G4endl;
147 }
148 } else {
149 //----- Third option: no physics list has been defined, define a G4ErrorPhysicsList
150 theG4RunManagerKernel->SetPhysics(new G4ErrorPhysicsList);
151 // theG4RunManagerKernel->SetPhysics(new ExN02PhysicsList);
152 theG4RunManagerKernel->InitializePhysics();
153 }
154 }
155
156}
G4DLLIMPORT std::ostream G4cerr
G4VUserPhysicsList * GetUserPhysicsList() const
void SetPhysics(G4VUserPhysicsList *uPhys)
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:62

Referenced by G4ErrorPropagatorManager::InitGeant4e().

◆ RunInitialization()

void G4ErrorRunManagerHelper::RunInitialization ( )

Definition at line 160 of file G4ErrorRunManagerHelper.cc.

161{
162 theG4RunManagerKernel->RunInitialization();
163}

Referenced by G4ErrorPropagatorManager::InitGeant4e().

◆ RunTermination()

void G4ErrorRunManagerHelper::RunTermination ( )

Definition at line 182 of file G4ErrorRunManagerHelper.cc.

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

Referenced by G4ErrorPropagatorManager::RunTermination().

◆ SetUserAction() [1/2]

void G4ErrorRunManagerHelper::SetUserAction ( G4UserSteppingAction userAction)

Definition at line 175 of file G4ErrorRunManagerHelper.cc.

176{
178}
void SetUserAction(G4UserEventAction *userAction)
static G4EventManager * GetEventManager()

◆ SetUserAction() [2/2]

void G4ErrorRunManagerHelper::SetUserAction ( G4UserTrackingAction userAction)

Definition at line 167 of file G4ErrorRunManagerHelper.cc.

168{
169
171}

◆ SetUserInitialization() [1/3]

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VPhysicalVolume userInit)

Definition at line 93 of file G4ErrorRunManagerHelper.cc.

94{
95 theUserWorld = userInit;
96}

◆ SetUserInitialization() [2/3]

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VUserDetectorConstruction userInit)

Definition at line 86 of file G4ErrorRunManagerHelper.cc.

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

Referenced by G4ErrorPropagatorManager::SetUserInitialization().

◆ SetUserInitialization() [3/3]

void G4ErrorRunManagerHelper::SetUserInitialization ( G4VUserPhysicsList userInit)

Definition at line 100 of file G4ErrorRunManagerHelper.cc.

101{
102 theUserPhysicsList = userInit;
103}

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