Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4RunManager Class Reference

#include <G4RunManager.hh>

Inheritance diagram for G4RunManager:

Public Types

enum  RMType {
  sequentialRM , masterRM , workerRM , subEventMasterRM ,
  subEventWorkerRM
}

Public Member Functions

 G4RunManager ()
virtual ~G4RunManager ()
 G4RunManager (const G4RunManager &)=delete
G4RunManageroperator= (const G4RunManager &)=delete
virtual void BeamOn (G4int n_event, const char *macroFile=nullptr, G4int n_select=-1)
virtual void Initialize ()
virtual void DefineWorldVolume (G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
virtual void AbortRun (G4bool softAbort=false)
virtual void AbortEvent ()
virtual void InitializeGeometry ()
virtual void InitializePhysics ()
virtual G4bool ConfirmBeamOnCondition ()
virtual void RunInitialization ()
virtual void DoEventLoop (G4int n_event, const char *macroFile=nullptr, G4int n_select=-1)
virtual void RunTermination ()
virtual void InitializeEventLoop (G4int n_event, const char *macroFile=nullptr, G4int n_select=-1)
virtual void ProcessOneEvent (G4int i_event)
virtual void TerminateOneEvent ()
virtual void TerminateEventLoop ()
virtual G4EventGenerateEvent (G4int i_event)
virtual void AnalyzeEvent (G4Event *anEvent)
virtual void SetNumberOfThreads (G4int)
virtual G4int GetNumberOfThreads () const
void DumpRegion (const G4String &rname) const
void DumpRegion (G4Region *region=nullptr) const
void GeometryHasBeenModified (G4bool prop=true)
void ReinitializeGeometry (G4bool destroyFirst=false, G4bool prop=true)
void PhysicsHasBeenModified ()
void CutOffHasBeenModified ()
void ReOptimizeMotherOf (G4VPhysicalVolume *)
void ReOptimize (G4LogicalVolume *)
void SetGeometryToBeOptimized (G4bool vl)
G4bool GetGeometryToBeOptimized ()
void GeometryDirectlyUpdated (G4bool val=true)
virtual void ConstructScoringWorlds ()
virtual void rndmSaveThisRun ()
virtual void rndmSaveThisEvent ()
virtual void RestoreRandomNumberStatus (const G4String &fileN)
virtual void RestoreRndmEachEvent (G4bool)
virtual void SetUserInitialization (G4VUserDetectorConstruction *userInit)
virtual void SetUserInitialization (G4VUserPhysicsList *userInit)
virtual void SetUserInitialization (G4VUserActionInitialization *userInit)
virtual void SetUserInitialization (G4UserWorkerInitialization *userInit)
virtual void SetUserInitialization (G4UserWorkerThreadInitialization *userInit)
virtual void SetUserAction (G4UserRunAction *userAction)
virtual void SetUserAction (G4VUserPrimaryGeneratorAction *userAction)
virtual void SetUserAction (G4UserEventAction *userAction)
virtual void SetUserAction (G4UserStackingAction *userAction)
virtual void SetUserAction (G4UserTrackingAction *userAction)
virtual void SetUserAction (G4UserSteppingAction *userAction)
const G4VUserDetectorConstructionGetUserDetectorConstruction () const
const G4VUserPhysicsListGetUserPhysicsList () const
const G4VUserActionInitializationGetUserActionInitialization () const
G4VUserActionInitializationGetNonConstUserActionInitialization () const
const G4UserWorkerInitializationGetUserWorkerInitialization () const
const G4UserWorkerThreadInitializationGetUserWorkerThreadInitialization () const
const G4UserRunActionGetUserRunAction () const
const G4VUserPrimaryGeneratorActionGetUserPrimaryGeneratorAction () const
const G4UserEventActionGetUserEventAction () const
const G4UserStackingActionGetUserStackingAction () const
const G4UserTrackingActionGetUserTrackingAction () const
const G4UserSteppingActionGetUserSteppingAction () const
void SetNumberOfAdditionalWaitingStacks (G4int iAdd)
void SetDefaultClassification (G4TrackStatus ts, G4ClassificationOfNewTrack val, G4ExceptionSeverity es=G4ExceptionSeverity::IgnoreTheIssue)
void SetDefaultClassification (const G4ParticleDefinition *pd, G4ClassificationOfNewTrack val, G4ExceptionSeverity es=G4ExceptionSeverity::IgnoreTheIssue)
const G4StringGetVersionString () const
void SetPrimaryTransformer (G4PrimaryTransformer *pt)
void StoreRandomNumberStatusToG4Event (G4int vl)
G4int GetFlagRandomNumberStatusToG4Event () const
void SetRandomNumberStore (G4bool flag)
G4bool GetRandomNumberStore () const
void SetRandomNumberStoreDir (const G4String &dir)
const G4StringGetRandomNumberStoreDir () const
const G4StringGetRandomNumberStatusForThisRun () const
const G4StringGetRandomNumberStatusForThisEvent () const
void SetRandomNumberStorePerEvent (G4bool flag)
G4bool GetRandomNumberStorePerEvent () const
void SetVerboseLevel (G4int vl)
G4int GetVerboseLevel () const
G4int GetPrintProgress ()
void SetPrintProgress (G4int i)
void SetNumberOfEventsToBeStored (G4int val)
const G4RunGetCurrentRun () const
G4RunGetNonConstCurrentRun () const
const G4EventGetCurrentEvent () const
const G4EventGetPreviousEvent (G4int i) const
void SetRunIDCounter (G4int i)
G4int GetNumberOfParallelWorld () const
void SetNumberOfEventsToBeProcessed (G4int val)
G4int GetNumberOfEventsToBeProcessed () const
G4int GetNumberOfSelectEvents () const
const G4StringGetSelectMacro () const
void SetDCtable (G4DCtable *DCtbl)
RMType GetRunManagerType () const
virtual void RegisterSubEventType (G4int, G4int)
virtual void MergeTrajectories (const G4SubEvent *, const G4Event *)
virtual void UpdateScoringForSubEvent (const G4SubEvent *, const G4Event *)
virtual const G4SubEventGetSubEvent (G4int, G4bool &, G4long &, G4long &, G4long &, G4bool)
virtual void SubEventFinished (const G4SubEvent *, const G4Event *)
virtual G4int GetSubEventType () const
virtual void SetSubEventType (G4int)
virtual std::size_t GetMaxNTrack () const
virtual void TrajectoriesToBeMerged (G4bool)
virtual void ReportEventDeletion (const G4Event *evt)
void ResetNavigatorAtInitialization (G4bool val=true)

Static Public Member Functions

static G4RunManagerGetRunManager ()
static G4bool IfGeometryHasBeenDestroyed ()

Protected Member Functions

 G4RunManager (RMType rmType)
virtual void StackPreviousEvent (G4Event *anEvent)
virtual void CleanUpPreviousEvents ()
virtual void CleanUpUnnecessaryEvents (G4int keepNEvents)
virtual void StoreRNGStatus (const G4String &filenamePrefix)
void UpdateScoring (const G4Event *evt=nullptr)
virtual void DeleteUserInitializations ()

Protected Attributes

G4RunManagerKernelkernel = nullptr
G4EventManagereventManager = nullptr
G4VUserDetectorConstructionuserDetector = nullptr
G4VUserPhysicsListphysicsList = nullptr
G4VUserActionInitializationuserActionInitialization = nullptr
G4UserWorkerInitializationuserWorkerInitialization = nullptr
G4UserWorkerThreadInitializationuserWorkerThreadInitialization = nullptr
G4UserRunActionuserRunAction = nullptr
G4VUserPrimaryGeneratorActionuserPrimaryGeneratorAction = nullptr
G4UserEventActionuserEventAction = nullptr
G4UserStackingActionuserStackingAction = nullptr
G4UserTrackingActionuserTrackingAction = nullptr
G4UserSteppingActionuserSteppingAction = nullptr
G4bool geometryInitialized = false
G4bool physicsInitialized = false
G4bool runAborted = false
G4bool initializedAtLeastOnce = false
G4bool geometryToBeOptimized = true
G4int runIDCounter = 0
G4int verboseLevel = 0
G4int printModulo = -1
G4Timertimer = nullptr
G4DCtableDCtable = nullptr
G4RuncurrentRun = nullptr
G4EventcurrentEvent = nullptr
std::list< G4Event * > * previousEvents = nullptr
G4int n_perviousEventsToBeStored = 0
G4int numberOfEventToBeProcessed = 0
G4bool storeRandomNumberStatus = false
G4int storeRandomNumberStatusToG4Event = 0
G4String randomNumberStatusDir = "./"
G4String randomNumberStatusForThisRun = ""
G4String randomNumberStatusForThisEvent = ""
G4bool rngStatusEventsFlag = false
G4VPhysicalVolumecurrentWorld = nullptr
G4int nParallelWorlds = 0
G4String msgText = " "
G4int n_select_msg = -1
G4int numberOfEventProcessed = 0
G4String selectMacro = ""
G4bool fakeRun = false
G4bool isScoreNtupleWriter = false
G4bool geometryDirectlyUpdated = false
RMType runManagerType

Static Protected Attributes

static G4RUN_DLL G4bool fGeometryHasBeenDestroyed = false

Friends

class G4RunManagerFactory

Detailed Description

Definition at line 137 of file G4RunManager.hh.

Member Enumeration Documentation

◆ RMType

Enumerator
sequentialRM 
masterRM 
workerRM 
subEventMasterRM 
subEventWorkerRM 

Definition at line 521 of file G4RunManager.hh.

Constructor & Destructor Documentation

◆ G4RunManager() [1/3]

G4RunManager::G4RunManager ( )

Definition at line 113 of file G4RunManager.cc.

114{
115 if (fRunManager != nullptr) {
116 G4Exception("G4RunManager::G4RunManager()", "Run0031", FatalException,
117 "G4RunManager constructed twice.");
118 }
119 fRunManager = this;
120
121 kernel = new G4RunManagerKernel();
122 eventManager = kernel->GetEventManager();
123
124 timer = new G4Timer();
125 runMessenger = new G4RunMessenger(this);
126 previousEvents = new std::list<G4Event*>;
129 std::ostringstream oss;
130 G4Random::saveFullState(oss);
134 G4UImanager::GetUIpointer()->SetAlias("RunMode sequential");
135}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
static G4ParticleTable * GetParticleTable()
G4UImessenger * CreateMessenger()
static G4ProcessTable * GetProcessTable()
std::list< G4Event * > * previousEvents
G4Timer * timer
G4RunManagerKernel * kernel
G4String randomNumberStatusForThisRun
G4String randomNumberStatusForThisEvent
RMType runManagerType
G4EventManager * eventManager
void SetAlias(const char *aliasLine)
static G4UImanager * GetUIpointer()

Referenced by G4MTRunManager::G4MTRunManager(), G4RunManager(), G4RunManagerFactory, G4WorkerRunManager::G4WorkerRunManager(), GetRunManager(), and operator=().

◆ ~G4RunManager()

G4RunManager::~G4RunManager ( )
virtual

Definition at line 188 of file G4RunManager.cc.

189{
190 G4StateManager* pStateManager = G4StateManager::GetStateManager();
191 // set the application state to the quite state
192 if (pStateManager->GetCurrentState() != G4State_Quit) {
193 if (verboseLevel > 1) G4cout << "G4 kernel has come to Quit state." << G4endl;
194 pStateManager->SetNewState(G4State_Quit);
195 }
196
198 if (verboseLevel > 1 && currentRun!=nullptr) {
199 G4cout << "Deleting G4Run (id:" << currentRun->GetRunID() << ") ";
200 if(currentRun->GetEventVectorSize()>0) {
201 G4cout << " that has " << currentRun->GetEventVectorSize()
202 << " events kept in eventVector";
203 }
204 G4cout << G4endl;
205 }
206 delete currentRun;
207 delete timer;
208 delete runMessenger;
209 delete previousEvents;
210
211 // The following will work for all RunManager types
212 // if derived class does the correct thing in the derived
213 // destructor that is: set to zero pointers of
214 // user initialization objects for which have no
215 // ownership
217 delete userRunAction;
218 userRunAction = nullptr;
219 if (verboseLevel > 1) G4cout << "UserRunAction deleted." << G4endl;
220
223 if (verboseLevel > 1) G4cout << "UserPrimaryGenerator deleted." << G4endl;
224
225 if (verboseLevel > 1) G4cout << "RunManager is deleting RunManagerKernel." << G4endl;
226
227 delete kernel;
228
229 fRunManager = nullptr;
230
231 if (verboseLevel > 1) G4cout << "RunManager is deleted." << G4endl;
232}
@ G4State_Quit
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
virtual void CleanUpPreviousEvents()
virtual void DeleteUserInitializations()
G4Run * currentRun
G4UserRunAction * userRunAction
G4VUserPrimaryGeneratorAction * userPrimaryGeneratorAction
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()
G4bool SetNewState(const G4ApplicationState &requestedState)

◆ G4RunManager() [2/3]

G4RunManager::G4RunManager ( const G4RunManager & )
delete

◆ G4RunManager() [3/3]

G4RunManager::G4RunManager ( RMType rmType)
protected

Definition at line 138 of file G4RunManager.cc.

139{
140 // This version of the constructor should never be called in sequential mode!
141#ifndef G4MULTITHREADED
143 msg << "Geant4 code is compiled without multi-threading support "
144 "(-DG4MULTITHREADED is set to off).";
145 msg << " This type of RunManager can only be used in mult-threaded "
146 "applications.";
147 G4Exception("G4RunManager::G4RunManager(G4bool)", "Run0107", FatalException, msg);
148#endif
149
150 if (fRunManager != nullptr) {
151 G4Exception("G4RunManager::G4RunManager()", "Run0031", FatalException,
152 "G4RunManager constructed twice.");
153 return;
154 }
155 fRunManager = this;
156
157 switch (rmType) {
158 case masterRM:
159 kernel = new G4MTRunManagerKernel();
160 break;
161 case workerRM:
162 kernel = new G4WorkerRunManagerKernel();
163 break;
164 default:
166 msgx << "This type of RunManager can only be used in multi-threaded "
167 "applications.";
168 G4Exception("G4RunManager::G4RunManager(G4bool)", "Run0108", FatalException, msgx);
169 return;
170 }
171 runManagerType = rmType;
172
173 eventManager = kernel->GetEventManager();
174
175 timer = new G4Timer();
176 runMessenger = new G4RunMessenger(this);
177 previousEvents = new std::list<G4Event*>;
181 std::ostringstream oss;
182 G4Random::saveFullState(oss);
185}
std::ostringstream G4ExceptionDescription
G4String randomNumberStatusDir

Member Function Documentation

◆ AbortEvent()

void G4RunManager::AbortEvent ( )
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, and G4TaskRunManager.

Definition at line 707 of file G4RunManager.cc.

708{
709 // This method is valid only for EventProc state
711 if (currentState == G4State_EventProc) {
712 currentEvent->SetEventAborted();
713 eventManager->AbortCurrentEvent();
714 }
715 else {
716 G4cerr << "Event is not in progress. AbortEevnt() ignored." << G4endl;
717 }
718}
G4ApplicationState
@ G4State_EventProc
G4GLOB_DLL std::ostream G4cerr
G4Event * currentEvent

Referenced by G4ExceptionHandler::Notify().

◆ AbortRun()

void G4RunManager::AbortRun ( G4bool softAbort = false)
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, and G4TaskRunManager.

Definition at line 690 of file G4RunManager.cc.

691{
692 // This method is valid only for GeomClosed or EventProc state
694 if (currentState == G4State_GeomClosed || currentState == G4State_EventProc) {
695 runAborted = true;
696 if (currentState == G4State_EventProc && !softAbort) {
697 currentEvent->SetEventAborted();
698 eventManager->AbortCurrentEvent();
699 }
700 }
701 else {
702 G4cerr << "Run is not in progress. AbortRun() ignored." << G4endl;
703 }
704}
@ G4State_GeomClosed

Referenced by G4ExceptionHandler::Notify().

◆ AnalyzeEvent()

void G4RunManager::AnalyzeEvent ( G4Event * anEvent)
virtual

Definition at line 490 of file G4RunManager.cc.

491{
492 G4VPersistencyManager* fPersM = G4VPersistencyManager::GetPersistencyManager();
493 if (fPersM != nullptr) fPersM->Store(anEvent);
494 currentRun->RecordEvent(anEvent);
495}
static G4VPersistencyManager * GetPersistencyManager()
virtual G4bool Store(const G4Event *anEvent)=0

Referenced by ProcessOneEvent(), G4WorkerRunManager::ProcessOneEvent(), and G4WorkerTaskRunManager::ProcessOneEvent().

◆ BeamOn()

void G4RunManager::BeamOn ( G4int n_event,
const char * macroFile = nullptr,
G4int n_select = -1 )
virtual

Definition at line 259 of file G4RunManager.cc.

260{
261 fakeRun = n_event <= 0;
263 if (cond) {
268 DoEventLoop(n_event, macroFile, n_select);
270 }
271 fakeRun = false;
272}
bool G4bool
Definition G4Types.hh:86
G4int numberOfEventProcessed
virtual G4bool ConfirmBeamOnCondition()
virtual void RunTermination()
G4int numberOfEventToBeProcessed
virtual void DoEventLoop(G4int n_event, const char *macroFile=nullptr, G4int n_select=-1)
virtual void RunInitialization()
virtual void ConstructScoringWorlds()

Referenced by G4WorkerRunManager::DoWork(), G4MTRunManager::Initialize(), G4SubEvtRunManager::Initialize(), G4TaskRunManager::Initialize(), and G4AdjointSimManager::RunAdjointSimulation().

◆ CleanUpPreviousEvents()

void G4RunManager::CleanUpPreviousEvents ( )
protectedvirtual

Reimplemented in G4SubEvtRunManager.

Definition at line 525 of file G4RunManager.cc.

526{
527 // Delete all events carried over from previous run.
528 // This method is invoked at the beginning of the next run
529 // or from the destructor of G4RunManager at the very end of
530 // the program.
531 // N.B. If ToBeKept() is true, the pointer of this event is
532 // kept in G4Run of the previous run, and deleted along with
533 // the deletion of G4Run.
534
535 auto evItr = previousEvents->cbegin();
536 while (evItr != previousEvents->cend()) {
537 G4Event* evt = *evItr;
538 if (evt != nullptr && !(evt->ToBeKept())) {
540 delete evt;
541 }
542 evItr = previousEvents->erase(evItr);
543 }
544
545}
G4bool ToBeKept() const
Definition G4Event.hh:105
virtual void ReportEventDeletion(const G4Event *evt)

Referenced by G4WorkerTaskRunManager::DoCleanup(), RunInitialization(), G4WorkerRunManager::RunInitialization(), G4WorkerSubEvtRunManager::RunInitialization(), G4WorkerTaskRunManager::RunInitialization(), ~G4RunManager(), and G4WorkerRunManager::~G4WorkerRunManager().

◆ CleanUpUnnecessaryEvents()

void G4RunManager::CleanUpUnnecessaryEvents ( G4int keepNEvents)
protectedvirtual

Reimplemented in G4SubEvtRunManager.

Definition at line 548 of file G4RunManager.cc.

549{
550 // Delete events that are no longer necessary for post
551 // processing such as visualization.
552 // N.B. If ToBeKept() is true, the pointer of this event is
553 // kept in G4Run of the previous run, and deleted along with
554 // the deletion of G4Run.
555
556 auto evItr = previousEvents->cbegin();
557 while (evItr != previousEvents->cend()) {
558 if (G4int(previousEvents->size()) <= keepNEvents) return;
559
560 G4Event* evt = *evItr;
561 if (evt != nullptr) {
562 if (evt->GetNumberOfGrips() == 0) {
563 if (!(evt->ToBeKept())) {
565 delete evt;
566 }
567 evItr = previousEvents->erase(evItr);
568 }
569 else {
570 ++evItr;
571 }
572 }
573 else {
574 evItr = previousEvents->erase(evItr);
575 }
576 }
577}
int G4int
Definition G4Types.hh:85
G4int GetNumberOfGrips() const
Definition G4Event.hh:123

Referenced by RunTermination(), and StackPreviousEvent().

◆ ConfirmBeamOnCondition()

G4bool G4RunManager::ConfirmBeamOnCondition ( )
virtual

Definition at line 275 of file G4RunManager.cc.

276{
277 G4StateManager* stateManager = G4StateManager::GetStateManager();
278
279 G4ApplicationState currentState = stateManager->GetCurrentState();
280 if (currentState != G4State_PreInit && currentState != G4State_Idle) {
281 G4cerr << "Illegal application state - BeamOn() ignored." << G4endl;
282 return false;
283 }
284
286 G4cerr << " Geant4 kernel should be initialized" << G4endl;
287 G4cerr << "before the first BeamOn(). - BeamOn ignored." << G4endl;
288 return false;
289 }
290
292 if (verboseLevel > 0) {
293 G4cout << "Start re-initialization because " << G4endl;
294 if (!geometryInitialized) G4cout << " Geometry" << G4endl;
295 if (!physicsInitialized) G4cout << " Physics processes" << G4endl;
296 G4cout << "has been modified since last Run." << G4endl;
297 }
298 Initialize();
299 }
300 return true;
301}
@ G4State_Idle
@ G4State_PreInit
G4bool geometryInitialized
virtual void Initialize()
G4bool physicsInitialized
G4bool initializedAtLeastOnce

Referenced by BeamOn(), G4WorkerSubEvtRunManager::DoWork(), and G4WorkerTaskRunManager::DoWork().

◆ ConstructScoringWorlds()

void G4RunManager::ConstructScoringWorlds ( )
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, G4TaskRunManager, and G4WorkerRunManager.

Definition at line 810 of file G4RunManager.cc.

811{
812 using MeshShape = G4VScoringMesh::MeshShape;
813
814 G4ScoringManager* ScM = G4ScoringManager::GetScoringManagerIfExist();
815 if (ScM == nullptr) return;
816
817 auto nPar = (G4int)ScM->GetNumberOfMesh();
818 if (nPar < 1) return;
819
821 for (G4int iw = 0; iw < nPar; ++iw) {
822 G4VScoringMesh* mesh = ScM->GetMesh(iw);
824 G4VPhysicalVolume* pWorld = nullptr;
825 if (mesh->GetShape() != MeshShape::realWorldLogVol) {
826 pWorld =
828 if (pWorld == nullptr) {
830 ScM->GetWorldName(iw));
831 pWorld->SetName(ScM->GetWorldName(iw));
832
833 G4ParallelWorldProcess* theParallelWorldProcess = mesh->GetParallelWorldProcess();
834 if (theParallelWorldProcess != nullptr) {
835 theParallelWorldProcess->SetParallelWorld(ScM->GetWorldName(iw));
836 }
837 else {
838 theParallelWorldProcess = new G4ParallelWorldProcess(ScM->GetWorldName(iw));
839 mesh->SetParallelWorldProcess(theParallelWorldProcess);
840 theParallelWorldProcess->SetParallelWorld(ScM->GetWorldName(iw));
841
842 theParticleIterator->reset();
843 while ((*theParticleIterator)()) {
844 G4ParticleDefinition* particle = theParticleIterator->value();
845 G4ProcessManager* pmanager = particle->GetProcessManager();
846 if (pmanager != nullptr) {
847 pmanager->AddProcess(theParallelWorldProcess);
848 if (theParallelWorldProcess->IsAtRestRequired(particle)) {
849 pmanager->SetProcessOrdering(theParallelWorldProcess, idxAtRest, 9900);
850 }
851 pmanager->SetProcessOrderingToSecond(theParallelWorldProcess, idxAlongStep);
852 pmanager->SetProcessOrdering(theParallelWorldProcess, idxPostStep, 9900);
853 }
854 }
855 }
856 theParallelWorldProcess->SetLayeredMaterialFlag(mesh->LayeredMassFlg());
857 }
858 }
859 mesh->Construct(pWorld);
860 }
862}
@ idxPostStep
@ idxAtRest
@ idxAlongStep
#define theParticleIterator
void SetLayeredMaterialFlag(G4bool flg=true)
void SetParallelWorld(G4String parallelWorldName)
G4bool IsAtRestRequired(G4ParticleDefinition *)
G4ProcessManager * GetProcessManager() const
G4PTblDicIterator * GetIterator() const
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
void SetProcessOrderingToSecond(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4RUN_DLL G4bool fGeometryHasBeenDestroyed
void GeometryHasBeenModified(G4bool prop=true)
G4VScoringMesh * GetMesh(G4int i) const
const G4String & GetWorldName(G4int i) const
std::size_t GetNumberOfMesh() const
static G4ScoringManager * GetScoringManagerIfExist()
G4VPhysicalVolume * GetParallelWorld(const G4String &worldName)
static G4TransportationManager * GetTransportationManager()
G4VPhysicalVolume * IsWorldExisting(const G4String &worldName)
void SetName(const G4String &pName)
MeshShape GetShape() const
void GeometryHasBeenDestroyed()
G4ParallelWorldProcess * GetParallelWorldProcess() const
void SetParallelWorldProcess(G4ParallelWorldProcess *proc)
virtual void Construct(G4VPhysicalVolume *fWorldPhys)
G4bool LayeredMassFlg()

Referenced by BeamOn(), G4MTRunManager::ConstructScoringWorlds(), G4SubEvtRunManager::ConstructScoringWorlds(), and G4TaskRunManager::ConstructScoringWorlds().

◆ CutOffHasBeenModified()

void G4RunManager::CutOffHasBeenModified ( )
inline

Definition at line 288 of file G4RunManager.hh.

289 {
290 G4cerr << "CutOffHasBeenModified becomes obsolete." << G4endl;
291 G4cerr << "It is safe to remove invoking this method." << G4endl;
292 }

◆ DefineWorldVolume()

void G4RunManager::DefineWorldVolume ( G4VPhysicalVolume * worldVol,
G4bool topologyIsChanged = true )
virtual

Definition at line 721 of file G4RunManager.cc.

722{
723 kernel->DefineWorldVolume(worldVol, topologyIsChanged);
724}

Referenced by G4GDMLMessenger::SetNewValue().

◆ DeleteUserInitializations()

void G4RunManager::DeleteUserInitializations ( )
protectedvirtual

Definition at line 235 of file G4RunManager.cc.

236{
237 if (verboseLevel > 1) G4cout << "UserDetectorConstruction deleted " << userDetector << G4endl;
238 delete userDetector;
239 userDetector = nullptr;
240
241 if (verboseLevel > 1) G4cout << "UserPhysicsList deleted " << physicsList << G4endl;
242 delete physicsList;
243 physicsList = nullptr;
244
245 if (verboseLevel > 1) G4cout << "UserActionInitialization deleted " << userActionInitialization << G4endl;
247 userActionInitialization = nullptr;
248
249 if (verboseLevel > 1) G4cout << "UserWorkerInitialization deleted " << userWorkerInitialization << G4endl;
251 userWorkerInitialization = nullptr;
252
253 if (verboseLevel > 1) G4cout << "UserWorkerThreadInitialization deleted " << userWorkerThreadInitialization << G4endl;
256}
G4UserWorkerInitialization * userWorkerInitialization
G4UserWorkerThreadInitialization * userWorkerThreadInitialization
G4VUserActionInitialization * userActionInitialization
G4VUserDetectorConstruction * userDetector
G4VUserPhysicsList * physicsList

Referenced by ~G4RunManager().

◆ DoEventLoop()

void G4RunManager::DoEventLoop ( G4int n_event,
const char * macroFile = nullptr,
G4int n_select = -1 )
virtual

Reimplemented in G4WorkerRunManager, G4WorkerSubEvtRunManager, and G4WorkerTaskRunManager.

Definition at line 375 of file G4RunManager.cc.

376{
377 InitializeEventLoop(n_event, macroFile, n_select);
378
379 // Event loop
380 for (G4int i_event = 0; i_event < n_event; ++i_event) {
381 ProcessOneEvent(i_event);
383 if (runAborted) break;
384 }
385
386 // For G4MTRunManager, TerminateEventLoop() is invoked after all threads are
387 // finished.
389}
virtual void InitializeEventLoop(G4int n_event, const char *macroFile=nullptr, G4int n_select=-1)
virtual void TerminateEventLoop()
virtual void ProcessOneEvent(G4int i_event)
virtual void TerminateOneEvent()

Referenced by BeamOn().

◆ DumpRegion() [1/2]

void G4RunManager::DumpRegion ( const G4String & rname) const

Definition at line 798 of file G4RunManager.cc.

799{
800 kernel->DumpRegion(rname);
801}

◆ DumpRegion() [2/2]

void G4RunManager::DumpRegion ( G4Region * region = nullptr) const

Definition at line 804 of file G4RunManager.cc.

805{
806 kernel->DumpRegion(region);
807}

◆ GenerateEvent()

G4Event * G4RunManager::GenerateEvent ( G4int i_event)
virtual

Reimplemented in G4WorkerRunManager, G4WorkerSubEvtRunManager, and G4WorkerTaskRunManager.

Definition at line 448 of file G4RunManager.cc.

449{
450 if (userPrimaryGeneratorAction == nullptr) {
451 G4Exception("G4RunManager::GenerateEvent()", "Run0032", FatalException,
452 "G4VUserPrimaryGeneratorAction is not defined!");
453 return nullptr;
454 }
455
456 auto anEvent = new G4Event(i_event);
457
459 std::ostringstream oss;
460 G4Random::saveFullState(oss);
462 anEvent->SetRandomNumberStatus(randomNumberStatusForThisEvent);
463 }
464
466 G4String fileN = "currentEvent";
468 std::ostringstream os;
469 os << "run" << currentRun->GetRunID() << "evt" << anEvent->GetEventID();
470 fileN = os.str();
471 }
472 StoreRNGStatus(fileN);
473 }
474
475 if (printModulo > 0 && anEvent->GetEventID() % printModulo == 0) {
476 G4cout << "--> Event " << anEvent->GetEventID() << " starts." << G4endl;
477 }
478 userPrimaryGeneratorAction->GeneratePrimaries(anEvent);
479 return anEvent;
480}
G4int storeRandomNumberStatusToG4Event
G4bool rngStatusEventsFlag
G4bool storeRandomNumberStatus
virtual void StoreRNGStatus(const G4String &filenamePrefix)

Referenced by ProcessOneEvent(), and G4SubEvtRunManager::ProcessOneEvent().

◆ GeometryDirectlyUpdated()

void G4RunManager::GeometryDirectlyUpdated ( G4bool val = true)
inline

Definition at line 314 of file G4RunManager.hh.

G4bool geometryDirectlyUpdated

Referenced by G4GDMLMessenger::SetNewValue().

◆ GeometryHasBeenModified()

void G4RunManager::GeometryHasBeenModified ( G4bool prop = true)

Definition at line 1005 of file G4RunManager.cc.

1006{
1007 if (prop) {
1008 G4UImanager::GetUIpointer()->ApplyCommand("/run/geometryModified");
1009 }
1010 else {
1011 kernel->GeometryHasBeenModified();
1012 }
1013}
G4int ApplyCommand(const char *aCommand)

Referenced by ConstructScoringWorlds().

◆ GetCurrentEvent()

const G4Event * G4RunManager::GetCurrentEvent ( ) const
inline

Definition at line 491 of file G4RunManager.hh.

491{ return currentEvent; }

◆ GetCurrentRun()

◆ GetFlagRandomNumberStatusToG4Event()

G4int G4RunManager::GetFlagRandomNumberStatusToG4Event ( ) const
inline

Definition at line 427 of file G4RunManager.hh.

428 {
430 }

◆ GetGeometryToBeOptimized()

G4bool G4RunManager::GetGeometryToBeOptimized ( )
inline

Definition at line 312 of file G4RunManager.hh.

312{ return geometryToBeOptimized; }
G4bool geometryToBeOptimized

◆ GetMaxNTrack()

virtual std::size_t G4RunManager::GetMaxNTrack ( ) const
inlinevirtual

Definition at line 572 of file G4RunManager.hh.

573 { return 0; }

◆ GetNonConstCurrentRun()

G4Run * G4RunManager::GetNonConstCurrentRun ( ) const
inline

Definition at line 487 of file G4RunManager.hh.

487{ return currentRun; }

◆ GetNonConstUserActionInitialization()

G4VUserActionInitialization * G4RunManager::GetNonConstUserActionInitialization ( ) const
inline

◆ GetNumberOfEventsToBeProcessed()

G4int G4RunManager::GetNumberOfEventsToBeProcessed ( ) const
inline

◆ GetNumberOfParallelWorld()

G4int G4RunManager::GetNumberOfParallelWorld ( ) const
inline

Definition at line 514 of file G4RunManager.hh.

514{ return nParallelWorlds; }
G4int nParallelWorlds

◆ GetNumberOfSelectEvents()

G4int G4RunManager::GetNumberOfSelectEvents ( ) const
inline

Definition at line 517 of file G4RunManager.hh.

517{ return n_select_msg; }

Referenced by G4WorkerRunManager::DoWork(), and G4WorkerTaskRunManager::DoWork().

◆ GetNumberOfThreads()

virtual G4int G4RunManager::GetNumberOfThreads ( ) const
inlinevirtual

Reimplemented in G4MTRunManager, and G4TaskRunManager.

Definition at line 253 of file G4RunManager.hh.

253{ return 1; }

◆ GetPreviousEvent()

const G4Event * G4RunManager::GetPreviousEvent ( G4int i) const
inline

Definition at line 498 of file G4RunManager.hh.

499 {
500 if (i >= 1 && i <= n_perviousEventsToBeStored) {
501 auto itr = previousEvents->cbegin();
502 for (G4int j = 1; j < i; ++j) {
503 ++itr;
504 }
505 return *itr;
506 }
507 return nullptr;
508 }
G4int n_perviousEventsToBeStored

◆ GetPrintProgress()

G4int G4RunManager::GetPrintProgress ( )
inline

Definition at line 475 of file G4RunManager.hh.

475{ return printModulo; }

Referenced by G4TheMTRayTracer::CreateBitMap().

◆ GetRandomNumberStatusForThisEvent()

const G4String & G4RunManager::GetRandomNumberStatusForThisEvent ( ) const
inline

Definition at line 458 of file G4RunManager.hh.

459 {
461 G4Exception("GrRunManager::SetRandomNumberStoreDir", "Run0072", JustWarning,
462 "Random number status is not available for this event.");
463 }
465 }
@ JustWarning

◆ GetRandomNumberStatusForThisRun()

const G4String & G4RunManager::GetRandomNumberStatusForThisRun ( ) const
inline

Definition at line 454 of file G4RunManager.hh.

455 {
457 }

◆ GetRandomNumberStore()

G4bool G4RunManager::GetRandomNumberStore ( ) const
inline

Definition at line 433 of file G4RunManager.hh.

433{ return storeRandomNumberStatus; }

◆ GetRandomNumberStoreDir()

const G4String & G4RunManager::GetRandomNumberStoreDir ( ) const
inline

Definition at line 453 of file G4RunManager.hh.

453{ return randomNumberStatusDir; }

◆ GetRandomNumberStorePerEvent()

G4bool G4RunManager::GetRandomNumberStorePerEvent ( ) const
inline

Definition at line 467 of file G4RunManager.hh.

467{ return rngStatusEventsFlag; }

◆ GetRunManager()

◆ GetRunManagerType()

RMType G4RunManager::GetRunManagerType ( ) const
inline

Definition at line 530 of file G4RunManager.hh.

530{ return runManagerType; }

◆ GetSelectMacro()

const G4String & G4RunManager::GetSelectMacro ( ) const
inline

Definition at line 518 of file G4RunManager.hh.

518{ return selectMacro; }
G4String selectMacro

Referenced by G4WorkerRunManager::DoWork(), and G4WorkerTaskRunManager::DoWork().

◆ GetSubEvent()

virtual const G4SubEvent * G4RunManager::GetSubEvent ( G4int ,
G4bool & ,
G4long & ,
G4long & ,
G4long & ,
G4bool  )
inlinevirtual

Reimplemented in G4SubEvtRunManager.

Definition at line 549 of file G4RunManager.hh.

551 {
552 G4Exception("G4RunManager::GetSubEvent","RunSE1002",FatalException,
553 "Base class method is invoked for a RunManager that is not sub-event parallel mode");
554 return nullptr;
555 }

◆ GetSubEventType()

virtual G4int G4RunManager::GetSubEventType ( ) const
inlinevirtual

Reimplemented in G4WorkerSubEvtRunManager.

Definition at line 561 of file G4RunManager.hh.

562 {
563 G4Exception("G4RunManager::GetSubEventType","RunSE1010",FatalException,
564 "Base class method is invoked for RunManager that is not a worker in sub-event parallel mode");
565 return -1;
566 }

◆ GetUserActionInitialization()

const G4VUserActionInitialization * G4RunManager::GetUserActionInitialization ( ) const
inline

◆ GetUserDetectorConstruction()

const G4VUserDetectorConstruction * G4RunManager::GetUserDetectorConstruction ( ) const
inline

Definition at line 355 of file G4RunManager.hh.

356 {
357 return userDetector;
358 }

Referenced by G4TaskRunManagerKernel::InitializeWorker(), and G4MTRunManagerKernel::StartThread().

◆ GetUserEventAction()

const G4UserEventAction * G4RunManager::GetUserEventAction ( ) const
inline

Definition at line 381 of file G4RunManager.hh.

381{ return userEventAction; }
G4UserEventAction * userEventAction

Referenced by G4RTWorkerInitialization::WorkerRunStart().

◆ GetUserPhysicsList()

const G4VUserPhysicsList * G4RunManager::GetUserPhysicsList ( ) const
inline

◆ GetUserPrimaryGeneratorAction()

const G4VUserPrimaryGeneratorAction * G4RunManager::GetUserPrimaryGeneratorAction ( ) const
inline

Definition at line 377 of file G4RunManager.hh.

378 {
380 }

Referenced by G4RTWorkerInitialization::WorkerRunStart().

◆ GetUserRunAction()

const G4UserRunAction * G4RunManager::GetUserRunAction ( ) const
inline

◆ GetUserStackingAction()

const G4UserStackingAction * G4RunManager::GetUserStackingAction ( ) const
inline

Definition at line 382 of file G4RunManager.hh.

382{ return userStackingAction; }
G4UserStackingAction * userStackingAction

Referenced by G4RTWorkerInitialization::WorkerRunStart().

◆ GetUserSteppingAction()

const G4UserSteppingAction * G4RunManager::GetUserSteppingAction ( ) const
inline

Definition at line 384 of file G4RunManager.hh.

384{ return userSteppingAction; }
G4UserSteppingAction * userSteppingAction

Referenced by G4RTWorkerInitialization::WorkerRunStart().

◆ GetUserTrackingAction()

const G4UserTrackingAction * G4RunManager::GetUserTrackingAction ( ) const
inline

Definition at line 383 of file G4RunManager.hh.

383{ return userTrackingAction; }
G4UserTrackingAction * userTrackingAction

Referenced by G4RTWorkerInitialization::WorkerRunStart().

◆ GetUserWorkerInitialization()

◆ GetUserWorkerThreadInitialization()

◆ GetVerboseLevel()

G4int G4RunManager::GetVerboseLevel ( ) const
inline

Definition at line 474 of file G4RunManager.hh.

474{ return verboseLevel; }

Referenced by G4TheMTRayTracer::CreateBitMap().

◆ GetVersionString()

const G4String & G4RunManager::GetVersionString ( ) const
inline

Definition at line 409 of file G4RunManager.hh.

409{ return kernel->GetVersionString(); }

◆ IfGeometryHasBeenDestroyed()

G4bool G4RunManager::IfGeometryHasBeenDestroyed ( )
static

◆ Initialize()

void G4RunManager::Initialize ( )
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, and G4TaskRunManager.

Definition at line 617 of file G4RunManager.cc.

618{
619 G4StateManager* stateManager = G4StateManager::GetStateManager();
620 G4ApplicationState currentState = stateManager->GetCurrentState();
621 if (currentState != G4State_PreInit && currentState != G4State_Idle) {
622 G4cerr << "Illegal application state - "
623 << "G4RunManager::Initialize() ignored." << G4endl;
624 return;
625 }
626
627 stateManager->SetNewState(G4State_Init);
631 if (stateManager->GetCurrentState() != G4State_Idle) {
632 stateManager->SetNewState(G4State_Idle);
633 }
634}
@ G4State_Init
virtual void InitializePhysics()
virtual void InitializeGeometry()

Referenced by ConfirmBeamOnCondition(), G4MTRunManager::Initialize(), G4SubEvtRunManager::Initialize(), G4TaskRunManager::Initialize(), and G4MTRunManagerKernel::StartThread().

◆ InitializeEventLoop()

void G4RunManager::InitializeEventLoop ( G4int n_event,
const char * macroFile = nullptr,
G4int n_select = -1 )
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, and G4TaskRunManager.

Definition at line 392 of file G4RunManager.cc.

393{
394 if (verboseLevel > 0) {
395 timer->Start();
396 }
397
398 n_select_msg = n_select;
399 if (macroFile != nullptr) {
400 if (n_select_msg < 0) n_select_msg = n_event;
401 msgText = "/control/execute ";
402 msgText += macroFile;
403 selectMacro = macroFile;
404 }
405 else {
406 n_select_msg = -1;
407 selectMacro = "";
408 }
409}
G4String msgText

Referenced by DoEventLoop(), G4WorkerRunManager::DoEventLoop(), and G4WorkerTaskRunManager::DoEventLoop().

◆ InitializeGeometry()

void G4RunManager::InitializeGeometry ( )
virtual

Reimplemented in G4WorkerRunManager.

Definition at line 637 of file G4RunManager.cc.

638{
639 if (userDetector == nullptr) {
640 G4Exception("G4RunManager::InitializeGeometry", "Run0033", FatalException,
641 "G4VUserDetectorConstruction is not defined!");
642 return;
643 }
644
645 if (verboseLevel > 1) G4cout << "userDetector->Construct() start." << G4endl;
646
647 G4StateManager* stateManager = G4StateManager::GetStateManager();
648 G4ApplicationState currentState = stateManager->GetCurrentState();
649 if (currentState == G4State_PreInit || currentState == G4State_Idle) {
650 stateManager->SetNewState(G4State_Init);
651 }
653 kernel->DefineWorldVolume(userDetector->Construct(), false);
654 userDetector->ConstructSDandField();
655 nParallelWorlds = userDetector->ConstructParallelGeometries();
656 userDetector->ConstructParallelSD();
657 kernel->SetNumberOfParallelWorld(nParallelWorlds);
658 }
659 // Notify the VisManager as well
661 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
662 if (pVVisManager != nullptr) pVVisManager->GeometryHasChanged();
663 }
664
666 geometryInitialized = true;
667 stateManager->SetNewState(currentState);
668}
static G4VVisManager * GetConcreteInstance()
virtual void GeometryHasChanged()=0
G4bool IsMasterThread()

Referenced by Initialize().

◆ InitializePhysics()

void G4RunManager::InitializePhysics ( )
virtual

Definition at line 671 of file G4RunManager.cc.

672{
673 G4StateManager* stateManager = G4StateManager::GetStateManager();
674 G4ApplicationState currentState = stateManager->GetCurrentState();
675 if (currentState == G4State_PreInit || currentState == G4State_Idle) {
676 stateManager->SetNewState(G4State_Init);
677 }
678 if (physicsList != nullptr) {
679 kernel->InitializePhysics();
680 }
681 else {
682 G4Exception("G4RunManager::InitializePhysics()", "Run0034", FatalException,
683 "G4VUserPhysicsList is not defined!");
684 }
685 physicsInitialized = true;
686 stateManager->SetNewState(currentState);
687}

Referenced by Initialize().

◆ MergeTrajectories()

virtual void G4RunManager::MergeTrajectories ( const G4SubEvent * ,
const G4Event *  )
inlinevirtual

Reimplemented in G4SubEvtRunManager.

Definition at line 539 of file G4RunManager.hh.

540 {
541 G4Exception("G4RunManager::MergeTrajectories","RunSE1001",FatalException,
542 "Base class method is invoked for a RunManager that is not sub-event parallel mode");
543 }

◆ operator=()

G4RunManager & G4RunManager::operator= ( const G4RunManager & )
delete

◆ PhysicsHasBeenModified()

void G4RunManager::PhysicsHasBeenModified ( )
inline

Definition at line 286 of file G4RunManager.hh.

286{ kernel->PhysicsHasBeenModified(); }

◆ ProcessOneEvent()

void G4RunManager::ProcessOneEvent ( G4int i_event)
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, G4TaskRunManager, G4WorkerRunManager, G4WorkerSubEvtRunManager, and G4WorkerTaskRunManager.

Definition at line 412 of file G4RunManager.cc.

413{
414 currentEvent = GenerateEvent(i_event);
415 eventManager->ProcessOneEvent(currentEvent);
419}
void UpdateScoring(const G4Event *evt=nullptr)
virtual G4Event * GenerateEvent(G4int i_event)
virtual void AnalyzeEvent(G4Event *anEvent)

Referenced by DoEventLoop().

◆ RegisterSubEventType()

virtual void G4RunManager::RegisterSubEventType ( G4int ,
G4int  )
inlinevirtual

Reimplemented in G4SubEvtRunManager.

Definition at line 534 of file G4RunManager.hh.

535 {
536 G4Exception("G4RunManager::RegisterSubEventType","RunSE1000",FatalException,
537 "Base class method is invoked for a RunManager that is not sub-event parallel mode");
538 }

◆ ReinitializeGeometry()

void G4RunManager::ReinitializeGeometry ( G4bool destroyFirst = false,
G4bool prop = true )

Definition at line 1016 of file G4RunManager.cc.

1017{
1018 if (destroyFirst && G4Threading::IsMasterThread()) {
1019 if (verboseLevel > 0) {
1020 G4cout << "#### Assembly, Volume, Solid, and Surface Stores are being cleaned." << G4endl;
1021 }
1029
1030 // remove all logical volume pointers from regions
1031 // exception: world logical volume pointer must be kept
1032 G4RegionStore* regionStore = G4RegionStore::GetInstance();
1033 for (const auto& rItr : *regionStore) {
1034 if (rItr->GetName() == "DefaultRegionForTheWorld") continue;
1035 auto lvItr = rItr->GetRootLogicalVolumeIterator();
1036 for (std::size_t iRLV = 0; iRLV < rItr->GetNumberOfRootVolumes(); ++iRLV) {
1037 rItr->RemoveRootLogicalVolume(*lvItr, false);
1038 ++lvItr;
1039 }
1040 if (verboseLevel > 0) {
1041 G4cout << "#### Region <" << rItr->GetName() << "> is cleared." << G4endl;
1042 }
1043 }
1044
1045 // clear transportation manager
1048 }
1049 if (prop) {
1050 G4UImanager::GetUIpointer()->ApplyCommand("/run/reinitializeGeometry");
1051 }
1052 else {
1053 kernel->GeometryHasBeenModified();
1054 geometryInitialized = false;
1055 // Notify the VisManager as well
1057 G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
1058 if (pVVisManager != nullptr) pVVisManager->GeometryHasChanged();
1059 }
1060 // Reinitialize field builder
1063 }
1064 }
1065}
static G4AssemblyStore * GetInstance()
static void Clean()
static G4bool IsInstance()
static G4FieldBuilder * Instance()
static G4GeometryManager * GetInstance()
void OpenGeometry(G4VPhysicalVolume *vol=nullptr)
static G4LogicalVolumeStore * GetInstance()
static G4PhysicalVolumeStore * GetInstance()
static G4RegionStore * GetInstance()
static void Clean()
static G4SolidStore * GetInstance()

Referenced by G4GDMLMessenger::SetNewValue().

◆ ReOptimize()

void G4RunManager::ReOptimize ( G4LogicalVolume * pLog)

Definition at line 906 of file G4RunManager.cc.

907{
908 G4Timer localtimer;
909 if (verboseLevel > 1) {
910 localtimer.Start();
911 }
912 G4SmartVoxelHeader* header = pLog->GetVoxelHeader();
913 delete header;
914 header = new G4SmartVoxelHeader(pLog);
915 pLog->SetVoxelHeader(header);
916 if (verboseLevel > 1) {
917 localtimer.Stop();
918 G4SmartVoxelStat stat(pLog, header, localtimer.GetSystemElapsed(), localtimer.GetUserElapsed());
919 G4cout << G4endl << "Voxelisation of logical volume <" << pLog->GetName() << ">" << G4endl;
920 G4cout << " heads : " << stat.GetNumberHeads() << " - nodes : " << stat.GetNumberNodes()
921 << " - pointers : " << stat.GetNumberPointers() << G4endl;
922 G4cout << " Memory used : " << (stat.GetMemoryUse() + 512) / 1024
923 << "k - total time : " << stat.GetTotalTime() << " - system time : " << stat.GetSysTime()
924 << G4endl;
925 }
926}
void SetVoxelHeader(G4SmartVoxelHeader *pVoxel)
const G4String & GetName() const
G4SmartVoxelHeader * GetVoxelHeader() const
void Stop()
G4double GetSystemElapsed() const
Definition G4Timer.cc:124
G4double GetUserElapsed() const
Definition G4Timer.cc:135
void Start()

Referenced by ReOptimizeMotherOf().

◆ ReOptimizeMotherOf()

void G4RunManager::ReOptimizeMotherOf ( G4VPhysicalVolume * pPhys)

Definition at line 899 of file G4RunManager.cc.

900{
901 G4LogicalVolume* pMotherL = pPhys->GetMotherLogical();
902 if (pMotherL != nullptr) ReOptimize(pMotherL);
903}
void ReOptimize(G4LogicalVolume *)
G4LogicalVolume * GetMotherLogical() const

◆ ReportEventDeletion()

void G4RunManager::ReportEventDeletion ( const G4Event * evt)
virtual

Definition at line 603 of file G4RunManager.cc.

604{
605 if(verboseLevel > 3) {
606 G4cout << "deleting G4Event(" << evt << ") eventID = " << evt->GetEventID()
607 << " -- grips = " << evt->GetNumberOfGrips()
608 << " keepFlag = " << evt->KeepTheEventFlag()
609 << " subEvt = " << evt->GetNumberOfRemainingSubEvents();
610 if(evt->GetNumberOfCompletedSubEvent()>0) {
611 G4cout << " -- contains " << evt->GetNumberOfCompletedSubEvent() << " completed sub-events";
612 }
613 G4cout << G4endl;
614 }
615}
G4int GetNumberOfCompletedSubEvent() const
Definition G4Event.hh:260
G4int GetEventID() const
Definition G4Event.hh:126
G4bool KeepTheEventFlag() const
Definition G4Event.hh:103
G4int GetNumberOfRemainingSubEvents() const
Definition G4Event.cc:277

Referenced by CleanUpPreviousEvents(), G4SubEvtRunManager::CleanUpPreviousEvents(), CleanUpUnnecessaryEvents(), G4SubEvtRunManager::CleanUpUnnecessaryEvents(), StackPreviousEvent(), G4SubEvtRunManager::StackPreviousEvent(), and G4Run::~G4Run().

◆ ResetNavigatorAtInitialization()

void G4RunManager::ResetNavigatorAtInitialization ( G4bool val = true)
inline

Definition at line 585 of file G4RunManager.hh.

586 { if(kernel!=nullptr) kernel->ResetNavigatorAtInitialization(val); }

◆ RestoreRandomNumberStatus()

void G4RunManager::RestoreRandomNumberStatus ( const G4String & fileN)
virtual

Definition at line 781 of file G4RunManager.cc.

782{
783 G4String fileNameWithDirectory;
784 if (fileN.find('/') == std::string::npos) {
785 fileNameWithDirectory = randomNumberStatusDir + fileN;
786 }
787 else {
788 fileNameWithDirectory = fileN;
789 }
790
791 G4Random::restoreEngineStatus(fileNameWithDirectory);
792 if (verboseLevel > 0)
793 G4cout << "RandomNumberEngineStatus restored from file: " << fileNameWithDirectory << G4endl;
794 G4Random::showEngineStatus();
795}

◆ RestoreRndmEachEvent()

virtual void G4RunManager::RestoreRndmEachEvent ( G4bool )
inlinevirtual

Reimplemented in G4WorkerRunManager, G4WorkerSubEvtRunManager, and G4WorkerTaskRunManager.

Definition at line 326 of file G4RunManager.hh.

327 { /* No effect in SEQ */
328 }

◆ rndmSaveThisEvent()

void G4RunManager::rndmSaveThisEvent ( )
virtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 752 of file G4RunManager.cc.

753{
754 if (currentEvent == nullptr) {
755 G4cerr << "Warning from G4RunManager::rndmSaveThisEvent():"
756 << " there is no currentEvent available." << G4endl << "Command ignored." << G4endl;
757 return;
758 }
759
761 G4cerr << "Warning from G4RunManager::rndmSaveThisEvent():"
762 << " Random number engine status is not available." << G4endl
763 << "/random/setSavingFlag command must be issued "
764 << "prior to the start of the run. Command ignored." << G4endl;
765 return;
766 }
767
768 G4fs::path fileIn = randomNumberStatusDir + "currentEvent.rndm";
769
770 std::ostringstream os;
771 os << "run" << currentRun->GetRunID() << "evt" << currentEvent->GetEventID() << ".rndm" << '\0';
772 G4fs::path fileOut = randomNumberStatusDir + os.str();
773
774 if (G4CopyRandomState(fileIn, fileOut, "G4RunManager::rndmSaveThisEvent()") && verboseLevel > 0)
775 {
776 G4cout << fileIn << " is copied to " << fileOut << G4endl;
777 }
778}
G4bool G4CopyRandomState(const G4fs::path &source, const G4fs::path &dest, const G4String &callsite)

◆ rndmSaveThisRun()

void G4RunManager::rndmSaveThisRun ( )
virtual

Reimplemented in G4MTRunManager, and G4WorkerRunManager.

Definition at line 727 of file G4RunManager.cc.

728{
729 G4int runNumber = 0;
730 if (currentRun != nullptr) runNumber = currentRun->GetRunID();
732 G4cerr << "Warning from G4RunManager::rndmSaveThisRun():"
733 << " Random number status was not stored prior to this run." << G4endl
734 << "/random/setSavingFlag command must be issued. "
735 << "Command ignored." << G4endl;
736 return;
737 }
738
739 G4fs::path fileIn = randomNumberStatusDir + "currentRun.rndm";
740
741 std::ostringstream os;
742 os << "run" << runNumber << ".rndm" << '\0';
743 G4fs::path fileOut = randomNumberStatusDir + os.str();
744
745 if (G4CopyRandomState(fileIn, fileOut, "G4RunManager::rndmSaveThisRun()") && verboseLevel > 0)
746 {
747 G4cout << fileIn << " is copied to " << fileOut << G4endl;
748 }
749}

◆ RunInitialization()

void G4RunManager::RunInitialization ( )
virtual

Reimplemented in G4SubEvtRunManager, G4WorkerRunManager, G4WorkerSubEvtRunManager, and G4WorkerTaskRunManager.

Definition at line 304 of file G4RunManager.cc.

305{
306 if (!(kernel->RunInitialization(fakeRun))) return;
307
308 runAborted = false;
310
312 if (verboseLevel > 2 && currentRun!=nullptr) {
313 G4cout << "Deleting G4Run (id:" << currentRun->GetRunID() << ") ";
314 if(currentRun->GetEventVectorSize()>0) {
315 G4cout << " that has " << currentRun->GetEventVectorSize()
316 << " events kept in eventVector";
317 }
318 G4cout << G4endl;
319 }
320 delete currentRun;
321 currentRun = nullptr;
322
323 if (fakeRun) return;
324
326
327 if (userRunAction != nullptr) currentRun = userRunAction->GenerateRun();
328 if (currentRun == nullptr) currentRun = new G4Run();
329
330 currentRun->SetRunID(runIDCounter);
331 currentRun->SetNumberOfEventToBeProcessed(numberOfEventToBeProcessed);
332
333 currentRun->SetDCtable(DCtable);
334 G4SDManager* fSDM = G4SDManager::GetSDMpointerIfExist();
335 if (fSDM != nullptr) {
336 currentRun->SetHCtable(fSDM->GetHCtable());
337 }
338
339 if (G4VScoreNtupleWriter::Instance() != nullptr) {
340 auto hce = (fSDM != nullptr) ? fSDM->PrepareNewEvent() : nullptr;
342 delete hce;
343 }
344
345 std::ostringstream oss;
346 G4Random::saveFullState(oss);
348 currentRun->SetRandomNumberStatus(randomNumberStatusForThisRun);
349
350 for (G4int i_prev = 0; i_prev < n_perviousEventsToBeStored; ++i_prev) {
351 previousEvents->push_back(nullptr);
352 }
353
354 if (printModulo >= 0 || verboseLevel > 0) {
355 G4cout << "### Run " << currentRun->GetRunID() << " starts." << G4endl;
356 }
357 if (userRunAction != nullptr) userRunAction->BeginOfRunAction(currentRun);
358
361 }
362
364 G4String fileN = "currentRun";
366 std::ostringstream os;
367 os << "run" << currentRun->GetRunID();
368 fileN = os.str();
369 }
370 StoreRNGStatus(fileN);
371 }
372}
static G4ParallelWorldProcessStore * GetInstance()
G4bool isScoreNtupleWriter
G4DCtable * DCtable
G4HCofThisEvent * PrepareNewEvent()
static G4SDManager * GetSDMpointerIfExist()
G4HCtable * GetHCtable() const
virtual G4bool Book(G4HCofThisEvent *hce)=0
static G4VScoreNtupleWriter * Instance()
virtual void OpenFile()=0

Referenced by BeamOn(), and G4SubEvtRunManager::RunInitialization().

◆ RunTermination()

void G4RunManager::RunTermination ( )
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, G4TaskRunManager, G4WorkerRunManager, G4WorkerSubEvtRunManager, and G4WorkerTaskRunManager.

Definition at line 498 of file G4RunManager.cc.

499{
500 if (!fakeRun) {
502// if(G4int(previousEvents->size())>0) {
503// G4ExceptionDescription ed;
504// ed << "Run still has " << previousEvents->size() << " unfinished events!!";
505// G4Exception("G4RunManager::RunTermination()","RM09009",FatalException,ed);
506// }
507 // tasking occasionally will call this function even
508 // if there was not a current run
509 if (currentRun != nullptr) {
510 if (userRunAction != nullptr) userRunAction->EndOfRunAction(currentRun);
511 G4VPersistencyManager* fPersM = G4VPersistencyManager::GetPersistencyManager();
512 if (fPersM != nullptr) fPersM->Store(currentRun);
513 // write & close analysis output
516 }
517 }
518 ++runIDCounter;
519 }
520
521 kernel->RunTermination();
522}
virtual void CleanUpUnnecessaryEvents(G4int keepNEvents)
virtual void Write()=0

Referenced by BeamOn(), G4MTRunManager::RunTermination(), G4SubEvtRunManager::RunTermination(), G4TaskRunManager::RunTermination(), G4WorkerRunManager::RunTermination(), G4WorkerSubEvtRunManager::RunTermination(), and G4WorkerTaskRunManager::RunTermination().

◆ SetDCtable()

void G4RunManager::SetDCtable ( G4DCtable * DCtbl)
inline

Definition at line 519 of file G4RunManager.hh.

519{ DCtable = DCtbl; }

◆ SetDefaultClassification() [1/2]

void G4RunManager::SetDefaultClassification ( const G4ParticleDefinition * pd,
G4ClassificationOfNewTrack val,
G4ExceptionSeverity es = G4ExceptionSeverity::IgnoreTheIssue )
inline

Definition at line 403 of file G4RunManager.hh.

406 { eventManager->GetStackManager()->SetDefaultClassification(pd,val,es); }

◆ SetDefaultClassification() [2/2]

void G4RunManager::SetDefaultClassification ( G4TrackStatus ts,
G4ClassificationOfNewTrack val,
G4ExceptionSeverity es = G4ExceptionSeverity::IgnoreTheIssue )
inline

Definition at line 399 of file G4RunManager.hh.

402 { eventManager->GetStackManager()->SetDefaultClassification(ts,val,es); }

◆ SetGeometryToBeOptimized()

void G4RunManager::SetGeometryToBeOptimized ( G4bool vl)
inline

Definition at line 304 of file G4RunManager.hh.

305 {
306 if (geometryToBeOptimized != vl) {
308 kernel->GeometryHasBeenModified();
309 kernel->SetGeometryToBeOptimized(vl);
310 }
311 }

◆ SetNumberOfAdditionalWaitingStacks()

void G4RunManager::SetNumberOfAdditionalWaitingStacks ( G4int iAdd)
inline

Definition at line 390 of file G4RunManager.hh.

391 {
392 eventManager->GetStackManager()->SetNumberOfAdditionalWaitingStacks(iAdd);
393 }

◆ SetNumberOfEventsToBeProcessed()

void G4RunManager::SetNumberOfEventsToBeProcessed ( G4int val)
inline

Definition at line 515 of file G4RunManager.hh.

◆ SetNumberOfEventsToBeStored()

void G4RunManager::SetNumberOfEventsToBeStored ( G4int val)
inline

Definition at line 482 of file G4RunManager.hh.

◆ SetNumberOfThreads()

virtual void G4RunManager::SetNumberOfThreads ( G4int )
inlinevirtual

Reimplemented in G4MTRunManager, and G4TaskRunManager.

Definition at line 252 of file G4RunManager.hh.

252{}

◆ SetPrimaryTransformer()

void G4RunManager::SetPrimaryTransformer ( G4PrimaryTransformer * pt)
inline

Definition at line 411 of file G4RunManager.hh.

412 {
413 kernel->SetPrimaryTransformer(pt);
414 }

◆ SetPrintProgress()

void G4RunManager::SetPrintProgress ( G4int i)
inline

Definition at line 476 of file G4RunManager.hh.

476{ printModulo = i; }

◆ SetRandomNumberStore()

void G4RunManager::SetRandomNumberStore ( G4bool flag)
inline

Definition at line 432 of file G4RunManager.hh.

432{ storeRandomNumberStatus = flag; }

◆ SetRandomNumberStoreDir()

void G4RunManager::SetRandomNumberStoreDir ( const G4String & dir)
inline

Definition at line 434 of file G4RunManager.hh.

435 {
436 G4String dirStr = dir;
437 if (dirStr.back() != '/') dirStr += "/";
438#ifndef WIN32
439 G4String shellCmd = "mkdir -p ";
440#else
441 std::replace(dirStr.begin(), dirStr.end(), '/', '\\');
442 G4String shellCmd = "if not exist " + dirStr + " mkdir ";
443#endif
444 shellCmd += dirStr;
445 randomNumberStatusDir = std::move(dirStr);
446 G4int sysret = system(shellCmd);
447 if (sysret != 0) {
448 G4String errmsg = "\"" + shellCmd + "\" returns non-zero value. Directory creation failed.";
449 G4Exception("GrRunManager::SetRandomNumberStoreDir", "Run0071", JustWarning, errmsg);
450 G4cerr << " return value = " << sysret << G4endl;
451 }
452 }

◆ SetRandomNumberStorePerEvent()

void G4RunManager::SetRandomNumberStorePerEvent ( G4bool flag)
inline

Definition at line 466 of file G4RunManager.hh.

466{ rngStatusEventsFlag = flag; }

◆ SetRunIDCounter()

void G4RunManager::SetRunIDCounter ( G4int i)
inline

◆ SetSubEventType()

virtual void G4RunManager::SetSubEventType ( G4int )
inlinevirtual

Reimplemented in G4WorkerSubEvtRunManager.

Definition at line 567 of file G4RunManager.hh.

568 {
569 G4Exception("G4RunManager::SetSubEventType","RunSE1011",FatalException,
570 "Base class method is invoked for RunManager that is not a worker in sub-event parallel mode");
571 }

◆ SetUserAction() [1/6]

void G4RunManager::SetUserAction ( G4UserEventAction * userAction)
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, G4WorkerRunManager, and G4WorkerSubEvtRunManager.

Definition at line 977 of file G4RunManager.cc.

978{
979 eventManager->SetUserAction(userAction);
980 userEventAction = userAction;
981}

◆ SetUserAction() [2/6]

◆ SetUserAction() [3/6]

void G4RunManager::SetUserAction ( G4UserStackingAction * userAction)
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, G4WorkerRunManager, and G4WorkerSubEvtRunManager.

Definition at line 984 of file G4RunManager.cc.

985{
986 eventManager->SetUserAction(userAction);
987 userStackingAction = userAction;
988}

◆ SetUserAction() [4/6]

void G4RunManager::SetUserAction ( G4UserSteppingAction * userAction)
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, G4WorkerRunManager, and G4WorkerSubEvtRunManager.

Definition at line 998 of file G4RunManager.cc.

999{
1000 eventManager->SetUserAction(userAction);
1001 userSteppingAction = userAction;
1002}

◆ SetUserAction() [5/6]

void G4RunManager::SetUserAction ( G4UserTrackingAction * userAction)
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, G4WorkerRunManager, and G4WorkerSubEvtRunManager.

Definition at line 991 of file G4RunManager.cc.

992{
993 eventManager->SetUserAction(userAction);
994 userTrackingAction = userAction;
995}

◆ SetUserAction() [6/6]

void G4RunManager::SetUserAction ( G4VUserPrimaryGeneratorAction * userAction)
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, G4WorkerRunManager, and G4WorkerSubEvtRunManager.

Definition at line 971 of file G4RunManager.cc.

972{
973 userPrimaryGeneratorAction = userAction;
974}

◆ SetUserInitialization() [1/5]

void G4RunManager::SetUserInitialization ( G4UserWorkerInitialization * userInit)
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, G4WorkerRunManager, and G4WorkerSubEvtRunManager.

Definition at line 942 of file G4RunManager.cc.

943{
944 G4Exception("G4RunManager::SetUserInitialization()", "Run3001", FatalException,
945 "Base-class G4RunManager cannot take G4UserWorkerInitialization. Use "
946 "G4MTRunManager.");
947}

◆ SetUserInitialization() [2/5]

void G4RunManager::SetUserInitialization ( G4UserWorkerThreadInitialization * userInit)
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, G4WorkerRunManager, and G4WorkerSubEvtRunManager.

Definition at line 950 of file G4RunManager.cc.

951{
952 G4Exception("G4RunManager::SetUserThreadInitialization()", "Run3001", FatalException,
953 "Base-class G4RunManager cannot take G4UserWorkerThreadInitialization. "
954 "Use G4MTRunManager.");
955}

◆ SetUserInitialization() [3/5]

void G4RunManager::SetUserInitialization ( G4VUserActionInitialization * userInit)
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, G4WorkerRunManager, and G4WorkerSubEvtRunManager.

Definition at line 958 of file G4RunManager.cc.

959{
960 userActionInitialization = userInit;
962}

◆ SetUserInitialization() [4/5]

◆ SetUserInitialization() [5/5]

void G4RunManager::SetUserInitialization ( G4VUserPhysicsList * userInit)
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, G4WorkerRunManager, and G4WorkerSubEvtRunManager.

Definition at line 935 of file G4RunManager.cc.

936{
937 physicsList = userInit;
938 kernel->SetPhysics(userInit);
939}

◆ SetVerboseLevel()

void G4RunManager::SetVerboseLevel ( G4int vl)
inline

Definition at line 469 of file G4RunManager.hh.

470 {
471 verboseLevel = vl;
472 kernel->SetVerboseLevel(vl);
473 }

◆ StackPreviousEvent()

void G4RunManager::StackPreviousEvent ( G4Event * anEvent)
protectedvirtual

Reimplemented in G4SubEvtRunManager.

Definition at line 580 of file G4RunManager.cc.

581{
582 if (anEvent->ToBeKept()) currentRun->StoreEvent(anEvent);
583
585 if (anEvent->GetNumberOfGrips() == 0) {
586 if (!(anEvent->ToBeKept())) {
587 ReportEventDeletion(anEvent);
588 delete anEvent;
589 }
590 }
591 else {
592 previousEvents->push_back(anEvent);
593 }
594 }
595 else {
596 previousEvents->push_back(anEvent);
597 }
598
600}

Referenced by TerminateOneEvent().

◆ StoreRandomNumberStatusToG4Event()

void G4RunManager::StoreRandomNumberStatusToG4Event ( G4int vl)
inline

Definition at line 421 of file G4RunManager.hh.

422 {
424 eventManager->StoreRandomNumberStatusToG4Event(vl);
425 }

◆ StoreRNGStatus()

void G4RunManager::StoreRNGStatus ( const G4String & filenamePrefix)
protectedvirtual

Reimplemented in G4MTRunManager, G4TaskRunManager, G4WorkerRunManager, G4WorkerSubEvtRunManager, and G4WorkerTaskRunManager.

Definition at line 483 of file G4RunManager.cc.

484{
485 G4String fileN = randomNumberStatusDir + fnpref + ".rndm";
486 G4Random::saveEngineStatus(fileN);
487}

Referenced by GenerateEvent(), and RunInitialization().

◆ SubEventFinished()

virtual void G4RunManager::SubEventFinished ( const G4SubEvent * ,
const G4Event *  )
inlinevirtual

Reimplemented in G4SubEvtRunManager.

Definition at line 556 of file G4RunManager.hh.

557 {
558 G4Exception("G4RunManager::SubEventFinished","RunSE1003",FatalException,
559 "Base class method is invoked for a RunManager that is not sub-event parallel mode");
560 }

◆ TerminateEventLoop()

void G4RunManager::TerminateEventLoop ( )
virtual

Reimplemented in G4WorkerRunManager, G4WorkerSubEvtRunManager, and G4WorkerTaskRunManager.

Definition at line 430 of file G4RunManager.cc.

431{
432 if (verboseLevel > 0 && !fakeRun) {
433 timer->Stop();
434 G4cout << " Run terminated." << G4endl;
435 G4cout << "Run Summary" << G4endl;
436 if (runAborted) {
437 G4cout << " Run Aborted after " << numberOfEventProcessed << " events processed." << G4endl;
438 }
439 else {
440 G4cout << " Number of events processed : " << numberOfEventProcessed << G4endl;
441 }
442 G4cout << " " << *timer << G4endl;
443 }
445}

Referenced by DoEventLoop(), G4MTRunManager::RunTermination(), G4SubEvtRunManager::RunTermination(), and G4TaskRunManager::RunTermination().

◆ TerminateOneEvent()

void G4RunManager::TerminateOneEvent ( )
virtual

Reimplemented in G4MTRunManager, G4SubEvtRunManager, and G4TaskRunManager.

Definition at line 422 of file G4RunManager.cc.

423{
425 currentEvent = nullptr;
427}
virtual void StackPreviousEvent(G4Event *anEvent)

Referenced by DoEventLoop(), G4WorkerRunManager::DoEventLoop(), and G4WorkerTaskRunManager::DoEventLoop().

◆ TrajectoriesToBeMerged()

virtual void G4RunManager::TrajectoriesToBeMerged ( G4bool )
inlinevirtual

Reimplemented in G4SubEvtRunManager.

Definition at line 574 of file G4RunManager.hh.

575 {
576 G4Exception("G4RunManager::TrajectoriesToBeMerged","RunSE1001",FatalException,
577 "Base class method is invoked for a RunManager that is not sub-event parallel mode");
578 }

◆ UpdateScoring()

void G4RunManager::UpdateScoring ( const G4Event * evt = nullptr)
protected

Definition at line 865 of file G4RunManager.cc.

866{
867 if(evt==nullptr) evt = currentEvent;
868
869//MAMAMAMA need revisiting
870 if(evt->ScoresAlreadyRecorded()) return;
871//MAMAMAMA need revisiting
872
875 }
876
877 if(evt->ScoresAlreadyRecorded()) {
878 G4Exception("G4RunManager::UpdateScoring()","RMSubEvt001",FatalException,
879 "Double-counting!!!");
880 }
881
882 evt->ScoresRecorded();
883
884 G4ScoringManager* ScM = G4ScoringManager::GetScoringManagerIfExist();
885 if (ScM == nullptr) return;
886 auto nPar = (G4int)ScM->GetNumberOfMesh();
887 if (nPar < 1) return;
888
889 G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
890 if (HCE == nullptr) return;
891 auto nColl = (G4int)HCE->GetCapacity();
892 for (G4int i = 0; i < nColl; ++i) {
893 G4VHitsCollection* HC = HCE->GetHC(i);
894 if (HC != nullptr) ScM->Accumulate(HC);
895 }
896}
G4HCofThisEvent * GetHCofThisEvent() const
Definition G4Event.hh:164
G4bool ScoresAlreadyRecorded() const
Definition G4Event.hh:306
void ScoresRecorded() const
Definition G4Event.hh:305
std::size_t GetCapacity()
G4VHitsCollection * GetHC(G4int i)
void Accumulate(G4VHitsCollection *map)
virtual void Fill(G4HCofThisEvent *hce, G4int eventNumber)=0

Referenced by G4SubEvtRunManager::CleanUpUnnecessaryEvents(), ProcessOneEvent(), G4WorkerRunManager::ProcessOneEvent(), G4WorkerTaskRunManager::ProcessOneEvent(), and G4SubEvtRunManager::StackPreviousEvent().

◆ UpdateScoringForSubEvent()

virtual void G4RunManager::UpdateScoringForSubEvent ( const G4SubEvent * ,
const G4Event *  )
inlinevirtual

Reimplemented in G4SubEvtRunManager.

Definition at line 544 of file G4RunManager.hh.

545 {
546 G4Exception("G4RunManager::UpdateScoringForSubEvent","RunSE1001",FatalException,
547 "Base class method is invoked for a RunManager that is not sub-event parallel mode");
548 }

◆ G4RunManagerFactory

friend class G4RunManagerFactory
friend

Definition at line 139 of file G4RunManager.hh.

Referenced by G4RunManagerFactory.

Member Data Documentation

◆ currentEvent

◆ currentRun

◆ currentWorld

G4VPhysicalVolume* G4RunManager::currentWorld = nullptr
protected

Definition at line 653 of file G4RunManager.hh.

◆ DCtable

◆ eventManager

◆ fakeRun

◆ fGeometryHasBeenDestroyed

◆ geometryDirectlyUpdated

G4bool G4RunManager::geometryDirectlyUpdated = false
protected

Definition at line 664 of file G4RunManager.hh.

Referenced by GeometryDirectlyUpdated(), and InitializeGeometry().

◆ geometryInitialized

G4bool G4RunManager::geometryInitialized = false
protected

◆ geometryToBeOptimized

G4bool G4RunManager::geometryToBeOptimized = true
protected

Definition at line 632 of file G4RunManager.hh.

Referenced by GetGeometryToBeOptimized(), and SetGeometryToBeOptimized().

◆ initializedAtLeastOnce

G4bool G4RunManager::initializedAtLeastOnce = false
protected

Definition at line 631 of file G4RunManager.hh.

Referenced by ConfirmBeamOnCondition(), and Initialize().

◆ isScoreNtupleWriter

◆ kernel

◆ msgText

◆ n_perviousEventsToBeStored

◆ n_select_msg

◆ nParallelWorlds

G4int G4RunManager::nParallelWorlds = 0
protected

Definition at line 655 of file G4RunManager.hh.

Referenced by GetNumberOfParallelWorld(), and InitializeGeometry().

◆ numberOfEventProcessed

◆ numberOfEventToBeProcessed

◆ physicsInitialized

G4bool G4RunManager::physicsInitialized = false
protected

Definition at line 629 of file G4RunManager.hh.

Referenced by ConfirmBeamOnCondition(), Initialize(), and InitializePhysics().

◆ physicsList

◆ previousEvents

◆ printModulo

◆ randomNumberStatusDir

◆ randomNumberStatusForThisEvent

G4String G4RunManager::randomNumberStatusForThisEvent = ""
protected

◆ randomNumberStatusForThisRun

◆ rngStatusEventsFlag

◆ runAborted

◆ runIDCounter

◆ runManagerType

◆ selectMacro

◆ storeRandomNumberStatus

◆ storeRandomNumberStatusToG4Event

◆ timer

◆ userActionInitialization

◆ userDetector

◆ userEventAction

◆ userPrimaryGeneratorAction

◆ userRunAction

◆ userStackingAction

G4UserStackingAction* G4RunManager::userStackingAction = nullptr
protected

Definition at line 624 of file G4RunManager.hh.

Referenced by GetUserStackingAction(), and SetUserAction().

◆ userSteppingAction

G4UserSteppingAction* G4RunManager::userSteppingAction = nullptr
protected

Definition at line 626 of file G4RunManager.hh.

Referenced by GetUserSteppingAction(), and SetUserAction().

◆ userTrackingAction

G4UserTrackingAction* G4RunManager::userTrackingAction = nullptr
protected

Definition at line 625 of file G4RunManager.hh.

Referenced by GetUserTrackingAction(), and SetUserAction().

◆ userWorkerInitialization

◆ userWorkerThreadInitialization

◆ verboseLevel

G4int G4RunManager::verboseLevel = 0
protected

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