Geant4-11
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Types | Private Attributes | Static Private Attributes | Friends
G4MTRunManager Class Reference

#include <G4MTRunManager.hh>

Inheritance diagram for G4MTRunManager:
G4RunManager G4TaskRunManager

Public Types

using masterWorlds_t = std::map< G4int, G4VPhysicalVolume * >
 
using ProfilerConfig = G4ProfilerConfig< G4ProfileType::Run >
 
enum  RMType { sequentialRM , masterRM , workerRM }
 
enum class  WorkerActionRequest { UNDEFINED , NEXTITERATION , PROCESSUI , ENDWORKER }
 

Public Member Functions

virtual void AbortEvent ()
 
virtual void AbortRun (G4bool softAbort=false)
 
virtual void AnalyzeEvent (G4Event *anEvent)
 
virtual void BeamOn (G4int n_event, const char *macroFile=nullptr, G4int n_select=-1)
 
virtual void ConfigureProfilers (const std::vector< std::string > &args={})
 
void ConfigureProfilers (G4int argc, char **argv)
 
virtual G4bool ConfirmBeamOnCondition ()
 
virtual void ConstructScoringWorlds ()
 
void CutOffHasBeenModified ()
 
virtual void DefineWorldVolume (G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
 
virtual void DoEventLoop (G4int n_event, const char *macroFile=nullptr, G4int n_select=-1)
 
void DumpRegion (const G4String &rname) const
 
void DumpRegion (G4Region *region=nullptr) const
 
 G4MTRunManager ()
 
virtual G4EventGenerateEvent (G4int i_event)
 
void GeometryDirectlyUpdated (G4bool val=true)
 
void GeometryHasBeenModified (G4bool prop=true)
 
std::vector< G4StringGetCommandStack ()
 
const G4EventGetCurrentEvent () const
 
const G4RunGetCurrentRun () const
 
G4int GetEventModulo () const
 
G4int GetFlagRandomNumberStatusToG4Event () const
 
G4bool GetGeometryToBeOptimized ()
 
const CLHEP::HepRandomEnginegetMasterRandomEngine () const
 
G4RunGetNonConstCurrentRun () const
 
G4VUserActionInitializationGetNonConstUserActionInitialization () const
 
virtual size_t GetNumberActiveThreads () const
 
G4int GetNumberOfEventsToBeProcessed () const
 
G4int GetNumberOfParallelWorld () const
 
G4int GetNumberOfSelectEvents () const
 
virtual G4int GetNumberOfThreads () const
 
G4int GetPinAffinity () const
 
const G4EventGetPreviousEvent (G4int i) const
 
G4int GetPrintProgress ()
 
const G4StringGetRandomNumberStatusForThisEvent () const
 
const G4StringGetRandomNumberStatusForThisRun () const
 
G4bool GetRandomNumberStore () const
 
const G4StringGetRandomNumberStoreDir () const
 
G4bool GetRandomNumberStorePerEvent () const
 
RMType GetRunManagerType () const
 
const G4StringGetSelectMacro () const
 
const G4VUserActionInitializationGetUserActionInitialization () const
 
const G4VUserDetectorConstructionGetUserDetectorConstruction () const
 
const G4UserEventActionGetUserEventAction () const
 
const G4VUserPhysicsListGetUserPhysicsList () const
 
const G4VUserPrimaryGeneratorActionGetUserPrimaryGeneratorAction () const
 
const G4UserRunActionGetUserRunAction () const
 
const G4UserStackingActionGetUserStackingAction () const
 
const G4UserSteppingActionGetUserSteppingAction () const
 
const G4UserTrackingActionGetUserTrackingAction () const
 
const G4UserWorkerInitializationGetUserWorkerInitialization () const
 
const G4UserWorkerThreadInitializationGetUserWorkerThreadInitialization () const
 
G4int GetVerboseLevel () const
 
const G4StringGetVersionString () const
 
virtual void Initialize ()
 
virtual void InitializeEventLoop (G4int n_event, const char *macroFile=0, G4int n_select=-1)
 
virtual void InitializeGeometry ()
 
virtual void InitializePhysics ()
 
virtual void InitializeThreadPool ()
 
void MergeRun (const G4Run *localRun)
 
void MergeScores (const G4ScoringManager *localScoringManager)
 
void PhysicsHasBeenModified ()
 
virtual void ProcessOneEvent (G4int i_event)
 
void ReinitializeGeometry (G4bool destroyFirst=false, G4bool prop=true)
 
void ReOptimize (G4LogicalVolume *)
 
void ReOptimizeMotherOf (G4VPhysicalVolume *)
 
virtual void RequestWorkersProcessCommandsStack ()
 
virtual void RestoreRandomNumberStatus (const G4String &fileN)
 
virtual void RestoreRndmEachEvent (G4bool)
 
virtual void RunInitialization ()
 
virtual void RunTermination ()
 
void SetDCtable (G4DCtable *DCtbl)
 
void SetEventModulo (G4int i=1)
 
void SetGeometryToBeOptimized (G4bool vl)
 
void SetNumberOfAdditionalWaitingStacks (G4int iAdd)
 
void SetNumberOfEventsToBeProcessed (G4int val)
 
void SetNumberOfEventsToBeStored (G4int val)
 
virtual void SetNumberOfThreads (G4int n)
 
void SetPinAffinity (G4int n=1)
 
void SetPrimaryTransformer (G4PrimaryTransformer *pt)
 
void SetPrintProgress (G4int i)
 
void SetRandomNumberStore (G4bool flag)
 
void SetRandomNumberStoreDir (const G4String &dir)
 
void SetRandomNumberStorePerEvent (G4bool flag)
 
void SetRunIDCounter (G4int i)
 
virtual G4bool SetUpAnEvent (G4Event *, long &s1, long &s2, long &s3, G4bool reseedRequired=true)
 
virtual G4int SetUpNEvents (G4Event *, G4SeedsQueue *seedsQueue, G4bool reseedRequired=true)
 
virtual void SetUserAction (G4UserEventAction *userAction)
 
virtual void SetUserAction (G4UserRunAction *userAction)
 
virtual void SetUserAction (G4UserStackingAction *userAction)
 
virtual void SetUserAction (G4UserSteppingAction *userAction)
 
virtual void SetUserAction (G4UserTrackingAction *userAction)
 
virtual void SetUserAction (G4VUserPrimaryGeneratorAction *userAction)
 
virtual void SetUserInitialization (G4UserWorkerInitialization *userInit)
 
virtual void SetUserInitialization (G4UserWorkerThreadInitialization *userInit)
 
virtual void SetUserInitialization (G4VUserActionInitialization *userInit)
 
virtual void SetUserInitialization (G4VUserDetectorConstruction *userDC)
 
virtual void SetUserInitialization (G4VUserPhysicsList *userPL)
 
void SetVerboseLevel (G4int vl)
 
void StoreRandomNumberStatusToG4Event (G4int vl)
 
virtual void TerminateEventLoop ()
 
virtual void TerminateOneEvent ()
 
virtual void ThisWorkerEndEventLoop ()
 
virtual void ThisWorkerProcessCommandsStackDone ()
 
virtual void ThisWorkerReady ()
 
virtual WorkerActionRequest ThisWorkerWaitForNextAction ()
 
virtual ~G4MTRunManager ()
 

Static Public Member Functions

static void addWorld (G4int counter, G4VPhysicalVolume *w)
 
static G4MTRunManagerGetMasterRunManager ()
 
static G4RunManagerKernelGetMasterRunManagerKernel ()
 
static G4ScoringManagerGetMasterScoringManager ()
 
static G4ThreadId GetMasterTheadId ()
 
static G4ThreadId GetMasterThreadId ()
 
static masterWorlds_tGetMasterWorlds ()
 
static G4MTRunManagerKernelGetMTMasterRunManagerKernel ()
 
static G4RunManagerGetRunManager ()
 
static G4bool IfGeometryHasBeenDestroyed ()
 
static G4int SeedOncePerCommunication ()
 
static void SetSeedOncePerCommunication (G4int val)
 

Protected Member Functions

void CleanUpPreviousEvents ()
 
void CleanUpUnnecessaryEvents (G4int keepNEvents)
 
virtual void CreateAndStartWorkers ()
 
virtual void DeleteUserInitializations ()
 
virtual G4bool InitializeSeeds (G4int)
 
virtual void NewActionRequest (WorkerActionRequest newRequest)
 
virtual void PrepareCommandsStack ()
 
virtual void RefillSeeds ()
 
virtual void rndmSaveThisEvent ()
 
virtual void rndmSaveThisRun ()
 
void StackPreviousEvent (G4Event *anEvent)
 
virtual void StoreRNGStatus (const G4String &filenamePrefix)
 
virtual void TerminateWorkers ()
 
void UpdateScoring ()
 
virtual void WaitForEndEventLoopWorkers ()
 
virtual void WaitForReadyWorkers ()
 

Protected Attributes

G4MTBarrier beginOfEventLoopBarrier
 
G4EventcurrentEvent = nullptr
 
G4RuncurrentRun = nullptr
 
G4VPhysicalVolumecurrentWorld = nullptr
 
G4DCtableDCtable = nullptr
 
G4MTBarrier endOfEventLoopBarrier
 
G4EventManagereventManager = nullptr
 
G4int eventModulo = 1
 
G4int eventModuloDef = 0
 
G4bool fakeRun = false
 
G4int forcedNwokers = -1
 
G4bool geometryDirectlyUpdated = false
 
G4bool geometryInitialized = false
 
G4bool geometryToBeOptimized = true
 
G4bool initializedAtLeastOnce = false
 
G4bool isScoreNtupleWriter = false
 
G4RunManagerKernelkernel = nullptr
 
G4String msgText = " "
 
G4int n_perviousEventsToBeStored = 0
 
G4int n_select_msg = -1
 
WorkerActionRequest nextActionRequest = WorkerActionRequest::UNDEFINED
 
G4MTBarrier nextActionRequestBarrier
 
G4int nParallelWorlds = 0
 
G4int nSeedsFilled = 0
 
G4int nSeedsMax = 10000
 
G4int nSeedsPerEvent = 2
 
G4int nSeedsUsed = 0
 
G4int numberOfEventProcessed = 0
 
G4int numberOfEventToBeProcessed = 0
 
G4int nworkers = 2
 
G4bool physicsInitialized = false
 
G4VUserPhysicsListphysicsList = nullptr
 
std::list< G4Event * > * previousEvents = nullptr
 
G4int printModulo = -1
 
G4MTBarrier processUIBarrier
 
G4doublerandDbl = nullptr
 
G4String randomNumberStatusDir = "./"
 
G4String randomNumberStatusForThisEvent = ""
 
G4String randomNumberStatusForThisRun = ""
 
G4bool rngStatusEventsFlag = false
 
G4bool runAborted = false
 
G4int runIDCounter = 0
 
RMType runManagerType
 
G4String selectMacro = ""
 
G4bool storeRandomNumberStatus = false
 
G4int storeRandomNumberStatusToG4Event = 0
 
G4Timertimer = nullptr
 
G4VUserActionInitializationuserActionInitialization = nullptr
 
G4VUserDetectorConstructionuserDetector = nullptr
 
G4UserEventActionuserEventAction = nullptr
 
G4VUserPrimaryGeneratorActionuserPrimaryGeneratorAction = nullptr
 
G4UserRunActionuserRunAction = nullptr
 
G4UserStackingActionuserStackingAction = nullptr
 
G4UserSteppingActionuserSteppingAction = nullptr
 
G4UserTrackingActionuserTrackingAction = nullptr
 
G4UserWorkerInitializationuserWorkerInitialization = nullptr
 
G4UserWorkerThreadInitializationuserWorkerThreadInitialization = nullptr
 
G4int verboseLevel = 0
 

Static Protected Attributes

static G4RUN_DLL G4bool fGeometryHasBeenDestroyed = false
 
static G4MTRUN_DLL G4MTRunManagerfMasterRM = nullptr
 
static G4MTRUN_DLL G4ScoringManagermasterScM = nullptr
 
static G4ThreadId masterThreadId = G4ThisThread::get_id()
 
static G4MTRUN_DLL masterWorlds_t masterWorlds = G4MTRunManager::masterWorlds_t()
 
static G4int seedOncePerCommunication = 0
 

Private Types

using G4ThreadsList = std::list< G4Thread * >
 

Private Attributes

CLHEP::HepRandomEnginemasterRNGEngine = nullptr
 
std::unique_ptr< ProfilerConfigmasterRunProfiler
 
G4MTRunManagerKernelMTkernel = nullptr
 
G4int pinAffinity = 0
 
G4RunMessengerrunMessenger = nullptr
 
G4ThreadsList threads
 
std::vector< G4StringuiCmdsForWorkers
 

Static Private Attributes

static G4ThreadLocal G4RunManagerfRunManager = nullptr
 

Friends

class G4RunManagerFactory
 

Detailed Description

Definition at line 58 of file G4MTRunManager.hh.

Member Typedef Documentation

◆ G4ThreadsList

using G4MTRunManager::G4ThreadsList = std::list<G4Thread*>
private

Definition at line 281 of file G4MTRunManager.hh.

◆ masterWorlds_t

Definition at line 68 of file G4MTRunManager.hh.

◆ ProfilerConfig

Definition at line 64 of file G4MTRunManager.hh.

Member Enumeration Documentation

◆ RMType

enum G4RunManager::RMType
inherited
Enumerator
sequentialRM 
masterRM 
workerRM 

Definition at line 575 of file G4RunManager.hh.

576 {
578 masterRM,
580 };

◆ WorkerActionRequest

Enumerator
UNDEFINED 
NEXTITERATION 
PROCESSUI 
ENDWORKER 

Definition at line 167 of file G4MTRunManager.hh.

168 {
169 UNDEFINED,
170 NEXTITERATION, // There is another set of UI commands to be executed
171 PROCESSUI, // Process UI commands w/o a /run/beamOn
172 ENDWORKER // Terminate thread, work finished
173 };

Constructor & Destructor Documentation

◆ G4MTRunManager()

G4MTRunManager::G4MTRunManager ( )

Definition at line 120 of file G4MTRunManager.cc.

122{
123 if(fMasterRM)
124 {
125 G4Exception("G4MTRunManager::G4MTRunManager", "Run0110", FatalException,
126 "Another instance of a G4MTRunManager already exists.");
127 }
128 fMasterRM = this;
129 masterThreadId = G4ThisThread::get_id();
130 MTkernel = static_cast<G4MTRunManagerKernel*>(kernel);
131#ifndef G4MULTITHREADED
133 msg << "Geant4 code is compiled without multi-threading support"
134 << "(-DG4MULTITHREADED is set to off).\n";
135 msg << "G4MTRunManager can only be used in multi-threaded applications.";
136 G4Exception("G4MTRunManager::G4MTRunManager", "Run0111", FatalException, msg);
137#endif
138
139 G4int numberOfStaticAllocators = kernel->GetNumberOfStaticAllocators();
140 if(numberOfStaticAllocators > 0)
141 {
143 msg1
144 << "There are " << numberOfStaticAllocators
145 << " static G4Allocator objects detected.\n"
146 << "In multi-threaded mode, all G4Allocator objects must be dynamically "
147 "instantiated.";
148 G4Exception("G4MTRunManager::G4MTRunManager", "Run1035", FatalException,
149 msg1);
150 }
153
154 // Check if a default RandomNumberGenerator has been created by user,
155 // if not create default one
156 // Note this call forces creation of defaults if not already there
157 // G4Random::getTheEngine(); //User did not specify RNG, create defaults
158 // Now remember the master instance of the RNG Engine
159 masterRNGEngine = G4Random::getTheEngine();
160
162
163 char* env = std::getenv("G4FORCENUMBEROFTHREADS");
164 if(env)
165 {
166 G4String envS = env;
167 if(envS == "MAX" || envS == "max")
168 {
170 }
171 else
172 {
173 std::istringstream is(env);
174 G4int val = -1;
175 is >> val;
176 if(val > 0)
177 {
178 forcedNwokers = val;
179 }
180 else
181 {
183 msg2 << "Environment variable G4FORCENUMBEROFTHREADS has an invalid "
184 "value <"
185 << envS << ">. It has to be an integer or a word \"max\".\n"
186 << "G4FORCENUMBEROFTHREADS is ignored.";
187 G4Exception("G4MTRunManager::G4MTRunManager", "Run1039", JustWarning,
188 msg2);
189 }
190 }
191 if(forcedNwokers > 0)
192 {
194 if(verboseLevel > 0)
195 { G4cout << "### Number of threads is forced to " << forcedNwokers
196 << " by Environment variable G4FORCENUMBEROFTHREADS." << G4endl; }
197 }
198 }
199}
@ JustWarning
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4MTRunManagerKernel * MTkernel
CLHEP::HepRandomEngine * masterRNGEngine
static G4MTRUN_DLL G4ScoringManager * masterScM
static G4MTRUN_DLL G4MTRunManager * fMasterRM
G4double * randDbl
static G4ThreadId masterThreadId
G4int GetNumberOfStaticAllocators() const
G4RunManagerKernel * kernel
G4int verboseLevel
static G4ScoringManager * GetScoringManagerIfExist()
void SetMasterUIManager(G4bool val)
Definition: G4UImanager.hh:219
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
G4int G4GetNumberOfCores()
Definition: G4Threading.cc:121

References FatalException, fMasterRM, forcedNwokers, G4cout, G4endl, G4Exception(), G4Threading::G4GetNumberOfCores(), G4RunManagerKernel::GetNumberOfStaticAllocators(), G4ScoringManager::GetScoringManagerIfExist(), G4UImanager::GetUIpointer(), JustWarning, G4RunManager::kernel, masterRNGEngine, masterScM, masterThreadId, MTkernel, nSeedsMax, nSeedsPerEvent, nworkers, randDbl, G4UImanager::SetMasterUIManager(), and G4RunManager::verboseLevel.

◆ ~G4MTRunManager()

G4MTRunManager::~G4MTRunManager ( )
virtual

Definition at line 202 of file G4MTRunManager.cc.

203{
204 // TODO: Currently does not work due to concurrent deletion of something
205 // that is shared:
206 // G4ProcessTable::DeleteMessenger from ~G4RunManager
207 // G4cout<<"Destroy MTRunManager"<<G4endl;//ANDREA
209 delete[] randDbl;
210}
virtual void TerminateWorkers()

References randDbl, and TerminateWorkers().

Member Function Documentation

◆ AbortEvent()

void G4MTRunManager::AbortEvent ( )
virtual

Reimplemented from G4RunManager.

Reimplemented in G4TaskRunManager.

Definition at line 739 of file G4MTRunManager.cc.

740{
741 // nothing to do in the master thread
742}

◆ AbortRun()

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

Reimplemented from G4RunManager.

Reimplemented in G4TaskRunManager.

Definition at line 722 of file G4MTRunManager.cc.

723{
724 // This method is valid only for GeomClosed or EventProc state
725 G4ApplicationState currentState =
727 if(currentState == G4State_GeomClosed || currentState == G4State_EventProc)
728 {
729 runAborted = true;
730 MTkernel->BroadcastAbortRun(softAbort);
731 }
732 else
733 {
734 G4cerr << "Run is not in progress. AbortRun() ignored." << G4endl;
735 }
736}
G4ApplicationState
@ G4State_EventProc
@ G4State_GeomClosed
G4GLOB_DLL std::ostream G4cerr
void BroadcastAbortRun(G4bool softAbort)
G4bool runAborted
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()

References G4MTRunManagerKernel::BroadcastAbortRun(), G4cerr, G4endl, G4State_EventProc, G4State_GeomClosed, G4StateManager::GetCurrentState(), G4StateManager::GetStateManager(), MTkernel, and G4RunManager::runAborted.

◆ addWorld()

void G4MTRunManager::addWorld ( G4int  counter,
G4VPhysicalVolume w 
)
static

Definition at line 96 of file G4MTRunManager.cc.

97{
98 masterWorlds.insert(std::make_pair(counter, w));
99}
static G4MTRUN_DLL masterWorlds_t masterWorlds

References masterWorlds.

Referenced by ConstructScoringWorlds(), and G4TaskRunManager::ConstructScoringWorlds().

◆ AnalyzeEvent()

void G4RunManager::AnalyzeEvent ( G4Event anEvent)
virtualinherited

Definition at line 548 of file G4RunManager.cc.

549{
550 G4VPersistencyManager* fPersM =
552 if(fPersM != nullptr)
553 fPersM->Store(anEvent);
554 currentRun->RecordEvent(anEvent);
555}
G4Run * currentRun
virtual void RecordEvent(const G4Event *)
Definition: G4Run.cc:61
static G4VPersistencyManager * GetPersistencyManager()
virtual G4bool Store(const G4Event *anEvent)=0

References G4RunManager::currentRun, G4VPersistencyManager::GetPersistencyManager(), G4Run::RecordEvent(), and G4VPersistencyManager::Store().

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

◆ BeamOn()

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

Definition at line 273 of file G4RunManager.cc.

274{
275 if(n_event <= 0)
276 {
277 fakeRun = true;
278 }
279 else
280 {
281 fakeRun = false;
282 }
284 if(cond)
285 {
290 DoEventLoop(n_event, macroFile, n_select);
292 }
293 fakeRun = false;
294}
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()

References G4RunManager::ConfirmBeamOnCondition(), G4RunManager::ConstructScoringWorlds(), G4RunManager::DoEventLoop(), G4RunManager::fakeRun, G4RunManager::numberOfEventProcessed, G4RunManager::numberOfEventToBeProcessed, G4RunManager::RunInitialization(), and G4RunManager::RunTermination().

Referenced by G4WorkerRunManager::DoWork(), export_G4RunManager(), Initialize(), G4TaskRunManager::Initialize(), G4AdjointSimManager::RunAdjointSimulation(), and G4RunMessenger::SetNewValue().

◆ CleanUpPreviousEvents()

void G4RunManager::CleanUpPreviousEvents ( )
protectedinherited

Definition at line 589 of file G4RunManager.cc.

590{
591 // Delete all events carried over from previous run.
592 // This method is invoked at the beginning of the next run
593 // or from the destructor of G4RunManager at the very end of
594 // the program.
595 // N.B. If ToBeKept() is true, the pointer of this event is
596 // kept in G4Run of the previous run, and deleted along with
597 // the deletion of G4Run.
598
599 auto evItr = previousEvents->cbegin();
600 while(evItr != previousEvents->cend())
601 {
602 G4Event* evt = *evItr;
603 if(evt != nullptr && !(evt->ToBeKept()))
604 delete evt;
605 evItr = previousEvents->erase(evItr);
606 }
607}
G4bool ToBeKept() const
Definition: G4Event.hh:102
std::list< G4Event * > * previousEvents

References G4RunManager::previousEvents, and G4Event::ToBeKept().

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

◆ CleanUpUnnecessaryEvents()

void G4RunManager::CleanUpUnnecessaryEvents ( G4int  keepNEvents)
protectedinherited

Definition at line 610 of file G4RunManager.cc.

611{
612 // Delete events that are no longer necessary for post
613 // processing such as visualization.
614 // N.B. If ToBeKept() is true, the pointer of this event is
615 // kept in G4Run of the previous run, and deleted along with
616 // the deletion of G4Run.
617
618 auto evItr = previousEvents->cbegin();
619 while(evItr != previousEvents->cend())
620 {
621 if(G4int(previousEvents->size()) <= keepNEvents)
622 return;
623
624 G4Event* evt = *evItr;
625 if(evt != nullptr)
626 {
627 if(evt->GetNumberOfGrips() == 0)
628 {
629 if(!(evt->ToBeKept()))
630 delete evt;
631 evItr = previousEvents->erase(evItr);
632 }
633 else
634 {
635 ++evItr;
636 }
637 }
638 else
639 {
640 evItr = previousEvents->erase(evItr);
641 }
642 }
643}
G4int GetNumberOfGrips() const
Definition: G4Event.hh:115

References G4Event::GetNumberOfGrips(), G4RunManager::previousEvents, and G4Event::ToBeKept().

Referenced by G4RunManager::RunTermination(), and G4RunManager::StackPreviousEvent().

◆ ConfigureProfilers() [1/2]

void G4RunManager::ConfigureProfilers ( const std::vector< std::string > &  args = {})
virtualinherited

Definition at line 1198 of file G4RunManager.cc.

1199{
1200#ifdef GEANT4_USE_TIMEMORY
1201 // parse command line if arguments were passed
1203#else
1205#endif
1206}
static char ** args
Definition: G4Xt.cc:51
static void Configure(const std::vector< std::string > &args)
Definition: G4Profiler.cc:91
void G4ConsumeParameters(_Args &&...)
Definition: templates.hh:187

References args, G4Profiler::Configure(), and G4ConsumeParameters().

Referenced by G4RunManager::ConfigureProfilers(), and G4RunManager::G4RunManager().

◆ ConfigureProfilers() [2/2]

void G4RunManager::ConfigureProfilers ( G4int  argc,
char **  argv 
)
inherited

Definition at line 1189 of file G4RunManager.cc.

1190{
1191 std::vector<std::string> _args;
1192 for(G4int i = 0; i < argc; ++i)
1193 _args.push_back(argv[i]);
1194 ConfigureProfilers(_args);
1195}
virtual void ConfigureProfilers(const std::vector< std::string > &args={})

References G4RunManager::ConfigureProfilers().

◆ ConfirmBeamOnCondition()

G4bool G4RunManager::ConfirmBeamOnCondition ( )
virtualinherited

Definition at line 297 of file G4RunManager.cc.

298{
300
301 G4ApplicationState currentState = stateManager->GetCurrentState();
302 if(currentState != G4State_PreInit && currentState != G4State_Idle)
303 {
304 G4cerr << "Illegal application state - BeamOn() ignored." << G4endl;
305 return false;
306 }
307
309 {
310 G4cerr << " Geant4 kernel should be initialized" << G4endl;
311 G4cerr << "before the first BeamOn(). - BeamOn ignored." << G4endl;
312 return false;
313 }
314
316 {
317 if(verboseLevel > 0)
318 {
319 G4cout << "Start re-initialization because " << G4endl;
321 G4cout << " Geometry" << G4endl;
323 G4cout << " Physics processes" << G4endl;
324 G4cout << "has been modified since last Run." << G4endl;
325 }
326 Initialize();
327 }
328 return true;
329}
@ G4State_Idle
@ G4State_PreInit
G4bool geometryInitialized
virtual void Initialize()
G4bool physicsInitialized
G4bool initializedAtLeastOnce

References G4cerr, G4cout, G4endl, G4State_Idle, G4State_PreInit, G4RunManager::geometryInitialized, G4StateManager::GetCurrentState(), G4StateManager::GetStateManager(), G4RunManager::Initialize(), G4RunManager::initializedAtLeastOnce, G4RunManager::physicsInitialized, and G4RunManager::verboseLevel.

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

◆ ConstructScoringWorlds()

void G4MTRunManager::ConstructScoringWorlds ( )
virtual

Reimplemented from G4RunManager.

Reimplemented in G4TaskRunManager.

Definition at line 518 of file G4MTRunManager.cc.

519{
521 // Call base class stuff...
523
524 masterWorlds.clear();
525 std::size_t nWorlds =
527 auto itrW =
529 for(std::size_t iWorld = 0; iWorld < nWorlds; ++iWorld)
530 {
531 addWorld(iWorld, *itrW);
532 ++itrW;
533 }
534}
static void addWorld(G4int counter, G4VPhysicalVolume *w)
static G4TransportationManager * GetTransportationManager()
std::vector< G4VPhysicalVolume * >::iterator GetWorldsIterator()
size_t GetNoWorlds() const

References addWorld(), G4RunManager::ConstructScoringWorlds(), G4TransportationManager::GetNoWorlds(), G4ScoringManager::GetScoringManagerIfExist(), G4TransportationManager::GetTransportationManager(), G4TransportationManager::GetWorldsIterator(), masterScM, and masterWorlds.

◆ CreateAndStartWorkers()

void G4MTRunManager::CreateAndStartWorkers ( )
protectedvirtual

Reimplemented in G4TaskRunManager.

Definition at line 330 of file G4MTRunManager.cc.

331{
332 // Now loop on requested number of workers
333 // This will also start the workers
334 // Currently we do not allow to change the
335 // number of threads: threads area created once
336 if(threads.size() == 0)
337 {
338 if(verboseLevel > 0)
339 {
340 // for consistency with G4TaskRunManager
341 std::stringstream msg;
342 msg << "--> G4MTRunManager::CreateAndStartWorkers() --> "
343 << "Initializing workers...";
344
345 std::stringstream ss;
346 ss.fill('=');
347 ss << std::setw(msg.str().length()) << "";
348 G4cout << "\n"
349 << ss.str() << "\n"
350 << msg.str() << "\n"
351 << ss.str() << "\n"
352 << G4endl;
353 }
354
355 for(G4int nw = 0; nw < nworkers; ++nw)
356 {
357 // Create a new worker and remember it
359 context->SetNumberThreads(nworkers);
360 context->SetThreadId(nw);
361 G4Thread* thread =
363 threads.push_back(thread);
364 }
365 }
366 // Signal to threads they can start a new run
368}
G4ThreadsList threads
virtual void NewActionRequest(WorkerActionRequest newRequest)
G4UserWorkerThreadInitialization * userWorkerThreadInitialization
virtual G4Thread * CreateAndStartWorker(G4WorkerThread *workerThreadContext)
context
Definition: g4zmq.py:11

References g4zmq::context, G4UserWorkerThreadInitialization::CreateAndStartWorker(), G4cout, G4endl, NewActionRequest(), NEXTITERATION, nworkers, threads, G4RunManager::userWorkerThreadInitialization, and G4RunManager::verboseLevel.

Referenced by InitializeEventLoop().

◆ CutOffHasBeenModified()

void G4RunManager::CutOffHasBeenModified ( )
inlineinherited

Definition at line 301 of file G4RunManager.hh.

302 {
303 G4cerr << "CutOffHasBeenModified becomes obsolete." << G4endl;
304 G4cerr << "It is safe to remove invoking this method." << G4endl;
305 }

References G4cerr, and G4endl.

◆ DefineWorldVolume()

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

Definition at line 791 of file G4RunManager.cc.

793{
794 kernel->DefineWorldVolume(worldVol, topologyIsChanged);
795}
void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)

References G4RunManagerKernel::DefineWorldVolume(), and G4RunManager::kernel.

Referenced by export_G4RunManager(), DetectorConstruction::SetMaterial(), G4GDMLMessenger::SetNewValue(), and ExN03DetectorConstruction::UpdateGeometry().

◆ DeleteUserInitializations()

void G4RunManager::DeleteUserInitializations ( )
protectedvirtualinherited

Definition at line 244 of file G4RunManager.cc.

245{
246 delete userDetector;
247 userDetector = nullptr;
248 if(verboseLevel > 1)
249 G4cout << "UserDetectorConstruction deleted." << G4endl;
250
251 delete physicsList;
252 physicsList = nullptr;
253 if(verboseLevel > 1)
254 G4cout << "UserPhysicsList deleted." << G4endl;
255
257 userActionInitialization = nullptr;
258 if(verboseLevel > 1)
259 G4cout << "UserActionInitialization deleted." << G4endl;
260
262 userWorkerInitialization = nullptr;
263 if(verboseLevel > 1)
264 G4cout << "UserWorkerInitialization deleted." << G4endl;
265
268 if(verboseLevel > 1)
269 G4cout << "UserWorkerThreadInitialization deleted." << G4endl;
270}
G4UserWorkerInitialization * userWorkerInitialization
G4VUserActionInitialization * userActionInitialization
G4VUserDetectorConstruction * userDetector
G4VUserPhysicsList * physicsList

References G4cout, G4endl, G4RunManager::physicsList, G4RunManager::userActionInitialization, G4RunManager::userDetector, G4RunManager::userWorkerInitialization, G4RunManager::userWorkerThreadInitialization, and G4RunManager::verboseLevel.

Referenced by G4RunManager::~G4RunManager().

◆ DoEventLoop()

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

Reimplemented in G4WorkerRunManager, and G4WorkerTaskRunManager.

Definition at line 412 of file G4RunManager.cc.

414{
415 InitializeEventLoop(n_event, macroFile, n_select);
416
417 // Event loop
418 for(G4int i_event = 0; i_event < n_event; ++i_event)
419 {
420 ProcessOneEvent(i_event);
422 if(runAborted)
423 break;
424 }
425
426 // For G4MTRunManager, TerminateEventLoop() is invoked after all threads are
427 // finished.
430}
virtual void InitializeEventLoop(G4int n_event, const char *macroFile=nullptr, G4int n_select=-1)
virtual void TerminateEventLoop()
RMType runManagerType
virtual void ProcessOneEvent(G4int i_event)
virtual void TerminateOneEvent()

References G4RunManager::InitializeEventLoop(), G4RunManager::ProcessOneEvent(), G4RunManager::runAborted, G4RunManager::runManagerType, G4RunManager::sequentialRM, G4RunManager::TerminateEventLoop(), and G4RunManager::TerminateOneEvent().

Referenced by G4RunManager::BeamOn().

◆ DumpRegion() [1/2]

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

Definition at line 890 of file G4RunManager.cc.

891{
892 kernel->DumpRegion(rname);
893}
void DumpRegion(const G4String &rname) const

References G4RunManagerKernel::DumpRegion(), and G4RunManager::kernel.

Referenced by G4RunMessenger::SetNewValue().

◆ DumpRegion() [2/2]

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

Definition at line 896 of file G4RunManager.cc.

897{
898 kernel->DumpRegion(region);
899}

References G4RunManagerKernel::DumpRegion(), and G4RunManager::kernel.

◆ GenerateEvent()

G4Event * G4RunManager::GenerateEvent ( G4int  i_event)
virtualinherited

Reimplemented in G4WorkerRunManager, and G4WorkerTaskRunManager.

Definition at line 500 of file G4RunManager.cc.

501{
502 if(userPrimaryGeneratorAction == nullptr)
503 {
504 G4Exception("G4RunManager::GenerateEvent()", "Run0032", FatalException,
505 "G4VUserPrimaryGeneratorAction is not defined!");
506 return nullptr;
507 }
508
509 G4Event* anEvent = new G4Event(i_event);
510
513 {
514 std::ostringstream oss;
515 G4Random::saveFullState(oss);
518 }
519
521 {
522 G4String fileN = "currentEvent";
524 {
525 std::ostringstream os;
526 os << "run" << currentRun->GetRunID() << "evt" << anEvent->GetEventID();
527 fileN = os.str();
528 }
529 StoreRNGStatus(fileN);
530 }
531
532 if(printModulo > 0 && anEvent->GetEventID() % printModulo == 0)
533 {
534 G4cout << "--> Event " << anEvent->GetEventID() << " starts." << G4endl;
535 }
537 return anEvent;
538}
void SetRandomNumberStatus(G4String &st)
Definition: G4Event.hh:90
G4int GetEventID() const
Definition: G4Event.hh:118
G4int storeRandomNumberStatusToG4Event
G4bool rngStatusEventsFlag
G4VUserPrimaryGeneratorAction * userPrimaryGeneratorAction
G4String randomNumberStatusForThisEvent
G4bool storeRandomNumberStatus
virtual void StoreRNGStatus(const G4String &filenamePrefix)
G4int GetRunID() const
Definition: G4Run.hh:78
virtual void GeneratePrimaries(G4Event *anEvent)=0

References G4RunManager::currentRun, FatalException, G4cout, G4endl, G4Exception(), G4VUserPrimaryGeneratorAction::GeneratePrimaries(), G4Event::GetEventID(), G4Run::GetRunID(), G4RunManager::printModulo, G4RunManager::randomNumberStatusForThisEvent, G4RunManager::rngStatusEventsFlag, G4Event::SetRandomNumberStatus(), G4RunManager::storeRandomNumberStatus, G4RunManager::storeRandomNumberStatusToG4Event, G4RunManager::StoreRNGStatus(), and G4RunManager::userPrimaryGeneratorAction.

Referenced by G4RunManager::ProcessOneEvent().

◆ GeometryDirectlyUpdated()

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

Definition at line 331 of file G4RunManager.hh.

332 {
334 }
G4bool geometryDirectlyUpdated

References G4RunManager::geometryDirectlyUpdated.

Referenced by G4GDMLMessenger::SetNewValue().

◆ GeometryHasBeenModified()

void G4RunManager::GeometryHasBeenModified ( G4bool  prop = true)
inherited

Definition at line 1117 of file G4RunManager.cc.

1118{
1119 if(prop)
1120 {
1121 G4UImanager::GetUIpointer()->ApplyCommand("/run/geometryModified");
1122 }
1123 else
1124 {
1126 }
1127}
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:485

References G4UImanager::ApplyCommand(), G4RunManagerKernel::GeometryHasBeenModified(), G4UImanager::GetUIpointer(), and G4RunManager::kernel.

Referenced by G4RunManager::ConstructScoringWorlds(), export_G4RunManager(), and G4RunMessenger::SetNewValue().

◆ GetCommandStack()

std::vector< G4String > G4MTRunManager::GetCommandStack ( )

◆ GetCurrentEvent()

const G4Event * G4RunManager::GetCurrentEvent ( ) const
inlineinherited

◆ GetCurrentRun()

const G4Run * G4RunManager::GetCurrentRun ( ) const
inlineinherited

◆ GetEventModulo()

G4int G4MTRunManager::GetEventModulo ( ) const
inline

◆ GetFlagRandomNumberStatusToG4Event()

G4int G4RunManager::GetFlagRandomNumberStatusToG4Event ( ) const
inlineinherited

◆ GetGeometryToBeOptimized()

G4bool G4RunManager::GetGeometryToBeOptimized ( )
inlineinherited

Definition at line 326 of file G4RunManager.hh.

327 {
329 }
G4bool geometryToBeOptimized

References G4RunManager::geometryToBeOptimized.

Referenced by export_G4RunManager().

◆ getMasterRandomEngine()

const CLHEP::HepRandomEngine * G4MTRunManager::getMasterRandomEngine ( ) const
inline

◆ GetMasterRunManager()

G4MTRunManager * G4MTRunManager::GetMasterRunManager ( )
static

◆ GetMasterRunManagerKernel()

G4RunManagerKernel * G4MTRunManager::GetMasterRunManagerKernel ( )
static

Definition at line 72 of file G4MTRunManager.cc.

73{
74 return fMasterRM->kernel;
75}

References fMasterRM, and G4RunManager::kernel.

Referenced by G4WorkerRunManager::InitializeGeometry().

◆ GetMasterScoringManager()

G4ScoringManager * G4MTRunManager::GetMasterScoringManager ( )
static

Definition at line 84 of file G4MTRunManager.cc.

85{
86 return masterScM;
87}

References masterScM.

Referenced by G4WorkerRunManager::ConstructScoringWorlds(), and G4WorkerRunManager::G4WorkerRunManager().

◆ GetMasterTheadId()

static G4ThreadId G4MTRunManager::GetMasterTheadId ( )
static

◆ GetMasterThreadId()

G4ThreadId G4MTRunManager::GetMasterThreadId ( )
static

◆ GetMasterWorlds()

G4MTRunManager::masterWorlds_t & G4MTRunManager::GetMasterWorlds ( )
static

◆ GetMTMasterRunManagerKernel()

G4MTRunManagerKernel * G4MTRunManager::GetMTMasterRunManagerKernel ( )
static

Definition at line 78 of file G4MTRunManager.cc.

79{
80 return fMasterRM->MTkernel;
81}

References fMasterRM, and MTkernel.

◆ GetNonConstCurrentRun()

G4Run * G4RunManager::GetNonConstCurrentRun ( ) const
inlineinherited

Definition at line 534 of file G4RunManager.hh.

534{ return currentRun; }

References G4RunManager::currentRun.

◆ GetNonConstUserActionInitialization()

G4VUserActionInitialization * G4RunManager::GetNonConstUserActionInitialization ( ) const
inlineinherited

◆ GetNumberActiveThreads()

virtual size_t G4MTRunManager::GetNumberActiveThreads ( ) const
inlinevirtual

Reimplemented in G4TaskRunManager.

Definition at line 116 of file G4MTRunManager.hh.

116{ return threads.size(); }

References threads.

Referenced by NewActionRequest(), RequestWorkersProcessCommandsStack(), WaitForEndEventLoopWorkers(), and WaitForReadyWorkers().

◆ GetNumberOfEventsToBeProcessed()

G4int G4RunManager::GetNumberOfEventsToBeProcessed ( ) const
inlineinherited

◆ GetNumberOfParallelWorld()

G4int G4RunManager::GetNumberOfParallelWorld ( ) const
inlineinherited

Definition at line 562 of file G4RunManager.hh.

562{ return nParallelWorlds; }
G4int nParallelWorlds

References G4RunManager::nParallelWorlds.

◆ GetNumberOfSelectEvents()

G4int G4RunManager::GetNumberOfSelectEvents ( ) const
inlineinherited

Definition at line 571 of file G4RunManager.hh.

571{ return n_select_msg; }
G4int n_select_msg

References G4RunManager::n_select_msg.

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

◆ GetNumberOfThreads()

virtual G4int G4MTRunManager::GetNumberOfThreads ( ) const
inlinevirtual

Reimplemented from G4RunManager.

Reimplemented in G4TaskRunManager.

Definition at line 75 of file G4MTRunManager.hh.

75{ return nworkers; }

References nworkers.

◆ GetPinAffinity()

G4int G4MTRunManager::GetPinAffinity ( ) const
inline

Definition at line 77 of file G4MTRunManager.hh.

77{ return pinAffinity; }

References pinAffinity.

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

◆ GetPreviousEvent()

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

Definition at line 540 of file G4RunManager.hh.

546 {
547 if(i >= 1 && i <= n_perviousEventsToBeStored)
548 {
549 auto itr = previousEvents->cbegin();
550 for(G4int j = 1; j < i; ++j)
551 {
552 ++itr;
553 }
554 return *itr;
555 }
556 return nullptr;
557 }
G4int n_perviousEventsToBeStored

References G4RunManager::n_perviousEventsToBeStored, and G4RunManager::previousEvents.

Referenced by G4DigiManager::GetDigiCollection(), and G4DigiManager::GetHitsCollection().

◆ GetPrintProgress()

G4int G4RunManager::GetPrintProgress ( )
inlineinherited

Definition at line 521 of file G4RunManager.hh.

521{ return printModulo; }

References G4RunManager::printModulo.

Referenced by G4TheMTRayTracer::CreateBitMap(), and G4RunMessenger::GetCurrentValue().

◆ GetRandomNumberStatusForThisEvent()

const G4String & G4RunManager::GetRandomNumberStatusForThisEvent ( ) const
inlineinherited

Definition at line 495 of file G4RunManager.hh.

496 {
499 {
500 G4Exception("GrRunManager::SetRandomNumberStoreDir", "Run0072",
502 "Random number status is not available for this event.");
503 }
505 }

References G4Exception(), JustWarning, G4RunManager::randomNumberStatusForThisEvent, and G4RunManager::storeRandomNumberStatusToG4Event.

◆ GetRandomNumberStatusForThisRun()

const G4String & G4RunManager::GetRandomNumberStatusForThisRun ( ) const
inlineinherited

Definition at line 491 of file G4RunManager.hh.

492 {
494 }
G4String randomNumberStatusForThisRun

References G4RunManager::randomNumberStatusForThisRun.

◆ GetRandomNumberStore()

G4bool G4RunManager::GetRandomNumberStore ( ) const
inlineinherited

Definition at line 460 of file G4RunManager.hh.

461 {
463 }

References G4RunManager::storeRandomNumberStatus.

Referenced by export_G4RunManager().

◆ GetRandomNumberStoreDir()

const G4String & G4RunManager::GetRandomNumberStoreDir ( ) const
inlineinherited

Definition at line 487 of file G4RunManager.hh.

488 {
490 }
G4String randomNumberStatusDir

References G4RunManager::randomNumberStatusDir.

Referenced by export_G4RunManager(), and G4RunMessenger::GetCurrentValue().

◆ GetRandomNumberStorePerEvent()

G4bool G4RunManager::GetRandomNumberStorePerEvent ( ) const
inlineinherited

Definition at line 510 of file G4RunManager.hh.

511 {
512 return rngStatusEventsFlag;
513 }

References G4RunManager::rngStatusEventsFlag.

◆ GetRunManager()

G4RunManager * G4RunManager::GetRunManager ( )
staticinherited

◆ GetRunManagerType()

RMType G4RunManager::GetRunManagerType ( ) const
inlineinherited

◆ GetSelectMacro()

const G4String & G4RunManager::GetSelectMacro ( ) const
inlineinherited

Definition at line 572 of file G4RunManager.hh.

572{ return selectMacro; }
G4String selectMacro

References G4RunManager::selectMacro.

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

◆ GetUserActionInitialization()

const G4VUserActionInitialization * G4RunManager::GetUserActionInitialization ( ) const
inlineinherited

◆ GetUserDetectorConstruction()

const G4VUserDetectorConstruction * G4RunManager::GetUserDetectorConstruction ( ) const
inlineinherited

◆ GetUserEventAction()

const G4UserEventAction * G4RunManager::GetUserEventAction ( ) const
inlineinherited

◆ GetUserPhysicsList()

const G4VUserPhysicsList * G4RunManager::GetUserPhysicsList ( ) const
inlineinherited

◆ GetUserPrimaryGeneratorAction()

const G4VUserPrimaryGeneratorAction * G4RunManager::GetUserPrimaryGeneratorAction ( ) const
inlineinherited

◆ GetUserRunAction()

const G4UserRunAction * G4RunManager::GetUserRunAction ( ) const
inlineinherited

◆ GetUserStackingAction()

const G4UserStackingAction * G4RunManager::GetUserStackingAction ( ) const
inlineinherited

◆ GetUserSteppingAction()

const G4UserSteppingAction * G4RunManager::GetUserSteppingAction ( ) const
inlineinherited

◆ GetUserTrackingAction()

const G4UserTrackingAction * G4RunManager::GetUserTrackingAction ( ) const
inlineinherited

◆ GetUserWorkerInitialization()

const G4UserWorkerInitialization * G4RunManager::GetUserWorkerInitialization ( ) const
inlineinherited

◆ GetUserWorkerThreadInitialization()

const G4UserWorkerThreadInitialization * G4RunManager::GetUserWorkerThreadInitialization ( ) const
inlineinherited

◆ GetVerboseLevel()

G4int G4RunManager::GetVerboseLevel ( ) const
inlineinherited

◆ GetVersionString()

const G4String & G4RunManager::GetVersionString ( ) const
inlineinherited

Definition at line 431 of file G4RunManager.hh.

432 {
433 return kernel->GetVersionString();
434 }
const G4String & GetVersionString() const

References G4RunManagerKernel::GetVersionString(), and G4RunManager::kernel.

Referenced by export_G4RunManager().

◆ IfGeometryHasBeenDestroyed()

G4bool G4RunManager::IfGeometryHasBeenDestroyed ( )
staticinherited

Definition at line 105 of file G4RunManager.cc.

106{
108}
static G4RUN_DLL G4bool fGeometryHasBeenDestroyed

References G4RunManager::fGeometryHasBeenDestroyed.

Referenced by G4WorkerTaskRunManager::RunInitialization().

◆ Initialize()

void G4MTRunManager::Initialize ( void  )
virtual

G4UImanager::GetUIpointer()->SetIgnoreCmdNotFound(true);

Reimplemented from G4RunManager.

Reimplemented in G4TaskRunManager.

Definition at line 287 of file G4MTRunManager.cc.

288{
290
291 // make sure all worker threads are set up.
292 BeamOn(0);
295}
void SetRunIDCounter(G4int i)
virtual void BeamOn(G4int n_event, const char *macroFile=nullptr, G4int n_select=-1)

References G4RunManager::BeamOn(), G4RunManager::Initialize(), and G4RunManager::SetRunIDCounter().

◆ InitializeEventLoop()

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

Reimplemented from G4RunManager.

Reimplemented in G4TaskRunManager.

Definition at line 371 of file G4MTRunManager.cc.

373{
377
378 if(!fakeRun)
379 {
380 nSeedsUsed = 0;
381 nSeedsFilled = 0;
382
383 if(verboseLevel > 0)
384 {
385 timer->Start();
386 }
387
388 n_select_msg = n_select;
389 if(macroFile != 0)
390 {
391 if(n_select_msg < 0)
392 n_select_msg = n_event;
393 msgText = "/control/execute ";
394 msgText += macroFile;
395 selectMacro = macroFile;
396 }
397 else
398 {
399 n_select_msg = -1;
400 selectMacro = "";
401 }
402
403 // initialize seeds
404 // If user did not implement InitializeSeeds,
405 // use default: nSeedsPerEvent seeds per event
406 if(eventModuloDef > 0)
407 {
410 {
412 if(eventModulo < 1)
413 eventModulo = 1;
415 msgd << "Event modulo is reduced to " << eventModulo
416 << " to distribute events to all threads.";
417 G4Exception("G4MTRunManager::InitializeEventLoop()", "Run10035",
418 JustWarning, msgd);
419 }
420 }
421 else
422 {
425 if(eventModulo < 1)
426 eventModulo = 1;
427 }
428 if(InitializeSeeds(n_event) == false && n_event > 0)
429 {
432 {
433 case 0:
434 nSeedsFilled = n_event;
435 break;
436 case 1:
438 break;
439 case 2:
440 nSeedsFilled = n_event / eventModulo + 1;
441 break;
442 default:
444 msgd << "Parameter value <" << seedOncePerCommunication
445 << "> of seedOncePerCommunication is invalid. It is reset to 0.";
446 G4Exception("G4MTRunManager::InitializeEventLoop()", "Run10036",
447 JustWarning, msgd);
449 nSeedsFilled = n_event;
450 }
451
452 // Generates up to nSeedsMax seed pairs only.
456 helper->Fill(randDbl, nSeedsFilled, n_event, nSeedsPerEvent);
457 }
458 }
459
460 // Now initialize workers. Check if user defined a WorkerThreadInitialization
461 if(userWorkerThreadInitialization == nullptr)
462 {
464 }
465
466 // Prepare UI commands for threads
468
469 // Start worker threads
471
472 // We need a barrier here. Wait for workers to start event loop.
473 // This will return only when all workers have started processing events.
475}
virtual void flatArray(const int size, double *vect)=0
G4int numberOfEventToBeProcessed
virtual G4bool InitializeSeeds(G4int)
virtual void WaitForReadyWorkers()
virtual void CreateAndStartWorkers()
virtual void PrepareCommandsStack()
static G4int seedOncePerCommunication
G4Timer * timer
G4String msgText
static G4TemplateRNGHelper< T > * GetInstance()
Definition: G4RNGHelper.cc:42
void Fill(G4double *dbl, G4int nev, G4int nev_tot, G4int nrpe)
Definition: G4RNGHelper.hh:83
void Start()

References CreateAndStartWorkers(), eventModulo, eventModuloDef, G4RunManager::fakeRun, G4TemplateRNGHelper< T >::Fill(), CLHEP::HepRandomEngine::flatArray(), G4Exception(), G4TemplateRNGHelper< T >::GetInstance(), InitializeSeeds(), JustWarning, masterRNGEngine, G4RunManager::msgText, MTkernel, G4RunManager::n_select_msg, nSeedsFilled, nSeedsMax, nSeedsPerEvent, nSeedsUsed, G4RunManager::numberOfEventProcessed, numberOfEventToBeProcessed, nworkers, PrepareCommandsStack(), randDbl, seedOncePerCommunication, G4RunManager::selectMacro, G4MTRunManagerKernel::SetUpDecayChannels(), G4Timer::Start(), G4RunManager::timer, G4RunManager::userWorkerThreadInitialization, G4RunManager::verboseLevel, and WaitForReadyWorkers().

◆ InitializeGeometry()

void G4RunManager::InitializeGeometry ( )
virtualinherited

Reimplemented in G4WorkerRunManager.

Definition at line 691 of file G4RunManager.cc.

692{
693 if(userDetector == nullptr)
694 {
695 G4Exception("G4RunManager::InitializeGeometry", "Run0033", FatalException,
696 "G4VUserDetectorConstruction is not defined!");
697 return;
698 }
699
700 if(verboseLevel > 1)
701 G4cout << "userDetector->Construct() start." << G4endl;
702
704 G4ApplicationState currentState = stateManager->GetCurrentState();
705 if(currentState == G4State_PreInit || currentState == G4State_Idle)
706 {
707 stateManager->SetNewState(G4State_Init);
708 }
710 {
716 }
717 // Notify the VisManager as well
719 {
721 if(pVVisManager != nullptr)
722 pVVisManager->GeometryHasChanged();
723 }
724
726 geometryInitialized = true;
727 stateManager->SetNewState(currentState);
728}
@ G4State_Init
void SetNumberOfParallelWorld(G4int i)
G4bool SetNewState(const G4ApplicationState &requestedState)
virtual G4VPhysicalVolume * Construct()=0
static G4VVisManager * GetConcreteInstance()
virtual void GeometryHasChanged()=0
G4bool IsMasterThread()
Definition: G4Threading.cc:124

References G4VUserDetectorConstruction::Construct(), G4VUserDetectorConstruction::ConstructParallelGeometries(), G4VUserDetectorConstruction::ConstructParallelSD(), G4VUserDetectorConstruction::ConstructSDandField(), G4RunManagerKernel::DefineWorldVolume(), FatalException, G4cout, G4endl, G4Exception(), G4State_Idle, G4State_Init, G4State_PreInit, G4RunManager::geometryDirectlyUpdated, G4VVisManager::GeometryHasChanged(), G4RunManager::geometryInitialized, G4VVisManager::GetConcreteInstance(), G4StateManager::GetCurrentState(), G4StateManager::GetStateManager(), G4Threading::IsMasterThread(), G4RunManager::kernel, G4RunManager::nParallelWorlds, G4StateManager::SetNewState(), G4RunManagerKernel::SetNumberOfParallelWorld(), G4RunManager::userDetector, and G4RunManager::verboseLevel.

Referenced by G4RunManager::Initialize().

◆ InitializePhysics()

void G4RunManager::InitializePhysics ( )
virtualinherited

Definition at line 731 of file G4RunManager.cc.

732{
734 G4ApplicationState currentState = stateManager->GetCurrentState();
735 if(currentState == G4State_PreInit || currentState == G4State_Idle)
736 {
737 stateManager->SetNewState(G4State_Init);
738 }
739 if(physicsList != nullptr)
740 {
742 }
743 else
744 {
745 G4Exception("G4RunManager::InitializePhysics()", "Run0034", FatalException,
746 "G4VUserPhysicsList is not defined!");
747 }
748 physicsInitialized = true;
749 stateManager->SetNewState(currentState);
750}

References FatalException, G4Exception(), G4State_Idle, G4State_Init, G4State_PreInit, G4StateManager::GetCurrentState(), G4StateManager::GetStateManager(), G4RunManagerKernel::InitializePhysics(), G4RunManager::kernel, G4RunManager::physicsInitialized, G4RunManager::physicsList, and G4StateManager::SetNewState().

Referenced by G4RunManager::Initialize().

◆ InitializeSeeds()

virtual G4bool G4MTRunManager::InitializeSeeds ( G4int  )
inlineprotectedvirtual

Reimplemented in G4TaskRunManager.

Definition at line 199 of file G4MTRunManager.hh.

199{ return false; };

Referenced by InitializeEventLoop().

◆ InitializeThreadPool()

virtual void G4MTRunManager::InitializeThreadPool ( )
inlinevirtual

Reimplemented in G4TaskRunManager.

Definition at line 83 of file G4MTRunManager.hh.

83{}

◆ MergeRun()

void G4MTRunManager::MergeRun ( const G4Run localRun)

Definition at line 629 of file G4MTRunManager.cc.

630{
632 if(currentRun != nullptr && localRun != nullptr)
633 currentRun->Merge(localRun);
634}
virtual void Merge(const G4Run *)
Definition: G4Run.cc:67

References G4RunManager::currentRun, G4Run::Merge(), and anonymous_namespace{G4MTRunManager.cc}::runMergerMutex.

Referenced by G4WorkerRunManager::MergePartialResults().

◆ MergeScores()

void G4MTRunManager::MergeScores ( const G4ScoringManager localScoringManager)

Definition at line 621 of file G4MTRunManager.cc.

622{
624 if(masterScM != nullptr && localScoringManager != nullptr)
625 masterScM->Merge(localScoringManager);
626}
void Merge(const G4ScoringManager *scMan)

References masterScM, G4ScoringManager::Merge(), and anonymous_namespace{G4MTRunManager.cc}::scorerMergerMutex.

Referenced by G4WorkerRunManager::MergePartialResults().

◆ NewActionRequest()

void G4MTRunManager::NewActionRequest ( G4MTRunManager::WorkerActionRequest  newRequest)
protectedvirtual

Reimplemented in G4TaskRunManager.

Definition at line 773 of file G4MTRunManager.cc.

775{
777 // nextActionRequest is a shared resource, but there is no
778 // data-race thanks to the barrier: all threads are waiting
779 nextActionRequest = newRequest;
781}
void Wait()
Definition: G4MTBarrier.cc:53
void ReleaseBarrier()
Definition: G4MTBarrier.cc:72
virtual size_t GetNumberActiveThreads() const
WorkerActionRequest nextActionRequest
G4MTBarrier nextActionRequestBarrier

References GetNumberActiveThreads(), nextActionRequest, nextActionRequestBarrier, G4MTBarrier::ReleaseBarrier(), and G4MTBarrier::Wait().

Referenced by CreateAndStartWorkers(), RequestWorkersProcessCommandsStack(), and TerminateWorkers().

◆ PhysicsHasBeenModified()

void G4RunManager::PhysicsHasBeenModified ( )
inlineinherited

◆ PrepareCommandsStack()

void G4MTRunManager::PrepareCommandsStack ( )
protectedvirtual

Definition at line 310 of file G4MTRunManager.cc.

311{
313 uiCmdsForWorkers.clear();
314 std::vector<G4String>* cmdCopy =
316 for(auto it = cmdCopy->cbegin(); it != cmdCopy->cend(); ++it)
317 uiCmdsForWorkers.push_back(*it);
318 cmdCopy->clear();
319 delete cmdCopy;
320}
std::vector< G4String > * GetCommandStack()
Definition: G4UImanager.cc:838

References anonymous_namespace{G4MTRunManager.cc}::cmdHandlingMutex, G4UImanager::GetCommandStack(), G4UImanager::GetUIpointer(), and uiCmdsForWorkers.

Referenced by InitializeEventLoop(), G4TaskRunManager::InitializeEventLoop(), RequestWorkersProcessCommandsStack(), and G4TaskRunManager::RequestWorkersProcessCommandsStack().

◆ ProcessOneEvent()

void G4MTRunManager::ProcessOneEvent ( G4int  i_event)
virtual

Reimplemented from G4RunManager.

Reimplemented in G4TaskRunManager.

Definition at line 298 of file G4MTRunManager.cc.

299{
300 // Nothing to do
301}

◆ RefillSeeds()

void G4MTRunManager::RefillSeeds ( )
protectedvirtual

Reimplemented in G4TaskRunManager.

Definition at line 478 of file G4MTRunManager.cc.

479{
481 G4int nFill = 0;
483 {
484 case 0:
486 break;
487 case 1:
488 nFill = nworkers - nSeedsFilled;
489 break;
490 case 2:
491 default:
493 / eventModulo + 1;
494 }
495 // Generates up to nSeedsMax seed pairs only.
496 if(nFill > nSeedsMax)
497 nFill = nSeedsMax;
499 helper->Refill(randDbl, nFill);
500 nSeedsFilled += nFill;
501}
void Refill(G4double *dbl, G4int nev)
Definition: G4RNGHelper.hh:96

References eventModulo, CLHEP::HepRandomEngine::flatArray(), G4TemplateRNGHelper< T >::GetInstance(), masterRNGEngine, nSeedsFilled, nSeedsMax, nSeedsPerEvent, numberOfEventToBeProcessed, nworkers, randDbl, G4TemplateRNGHelper< T >::Refill(), and seedOncePerCommunication.

Referenced by SetUpAnEvent(), and SetUpNEvents().

◆ ReinitializeGeometry()

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

Definition at line 1130 of file G4RunManager.cc.

1131{
1132 if(destroyFirst && G4Threading::IsMasterThread())
1133 {
1134 if(verboseLevel > 0)
1135 {
1136 G4cout << "#### Assemblies, Volumes and Solids Stores are wiped out."
1137 << G4endl;
1138 }
1144
1145 // remove all logical volume pointers from regions
1146 // exception: world logical volume pointer must be kept
1148 for(auto rItr = regionStore->cbegin(); rItr != regionStore->cend(); ++rItr)
1149 {
1150 if((*rItr)->GetName() == "DefaultRegionForTheWorld")
1151 continue;
1152 // if((*rItr)->GetName()=="DefaultRegionForParallelWorld") continue;
1153 auto lvItr = (*rItr)->GetRootLogicalVolumeIterator();
1154 for(std::size_t iRLV=0; iRLV<(*rItr)->GetNumberOfRootVolumes(); ++iRLV)
1155 {
1156 (*rItr)->RemoveRootLogicalVolume(*lvItr, false);
1157 ++lvItr;
1158 }
1159 if(verboseLevel > 0)
1160 {
1161 G4cout << "#### Region <" << (*rItr)->GetName() << "> is cleared."
1162 << G4endl;
1163 }
1164 }
1165
1166 // clear transportation manager
1169 }
1170 if(prop)
1171 {
1172 G4UImanager::GetUIpointer()->ApplyCommand("/run/reinitializeGeometry");
1173 }
1174 else
1175 {
1177 geometryInitialized = false;
1178 // Notify the VisManager as well
1180 {
1182 if(pVVisManager != nullptr)
1183 pVVisManager->GeometryHasChanged();
1184 }
1185 }
1186}
static G4AssemblyStore * GetInstance()
static void Clean()
static G4GeometryManager * GetInstance()
void OpenGeometry(G4VPhysicalVolume *vol=nullptr)
static G4LogicalVolumeStore * GetInstance()
static G4PhysicalVolumeStore * GetInstance()
static G4RegionStore * GetInstance()
static void Clean()
Definition: G4SolidStore.cc:74
static G4SolidStore * GetInstance()

References G4UImanager::ApplyCommand(), G4LogicalVolumeStore::Clean(), G4PhysicalVolumeStore::Clean(), G4SolidStore::Clean(), G4AssemblyStore::Clean(), G4TransportationManager::ClearParallelWorlds(), G4RunManager::fGeometryHasBeenDestroyed, G4cout, G4endl, G4RunManagerKernel::GeometryHasBeenModified(), G4VVisManager::GeometryHasChanged(), G4RunManager::geometryInitialized, G4VVisManager::GetConcreteInstance(), G4GeometryManager::GetInstance(), G4LogicalVolumeStore::GetInstance(), G4PhysicalVolumeStore::GetInstance(), G4RegionStore::GetInstance(), G4SolidStore::GetInstance(), G4AssemblyStore::GetInstance(), G4TransportationManager::GetTransportationManager(), G4UImanager::GetUIpointer(), G4Threading::IsMasterThread(), G4RunManager::kernel, G4GeometryManager::OpenGeometry(), and G4RunManager::verboseLevel.

Referenced by G4GDMLMessenger::SetNewValue(), and G4RunMessenger::SetNewValue().

◆ ReOptimize()

void G4RunManager::ReOptimize ( G4LogicalVolume pLog)
inherited

Definition at line 1009 of file G4RunManager.cc.

1010{
1011 G4Timer localtimer;
1012 if(verboseLevel > 1)
1013 {
1014 localtimer.Start();
1015 }
1016 G4SmartVoxelHeader* header = pLog->GetVoxelHeader();
1017 delete header;
1018 header = new G4SmartVoxelHeader(pLog);
1019 pLog->SetVoxelHeader(header);
1020 if(verboseLevel > 1)
1021 {
1022 localtimer.Stop();
1023 G4SmartVoxelStat stat(pLog, header, localtimer.GetSystemElapsed(),
1024 localtimer.GetUserElapsed());
1025 G4cout << G4endl << "Voxelisation of logical volume <" << pLog->GetName()
1026 << ">" << G4endl;
1027 G4cout << " heads : " << stat.GetNumberHeads()
1028 << " - nodes : " << stat.GetNumberNodes()
1029 << " - pointers : " << stat.GetNumberPointers() << G4endl;
1030 G4cout << " Memory used : " << (stat.GetMemoryUse() + 512) / 1024
1031 << "k - total time : " << stat.GetTotalTime()
1032 << " - system time : " << stat.GetSysTime() << G4endl;
1033 }
1034}
void SetVoxelHeader(G4SmartVoxelHeader *pVoxel)
const G4String & GetName() const
G4SmartVoxelHeader * GetVoxelHeader() const
void Stop()
G4double GetSystemElapsed() const
Definition: G4Timer.cc:132
G4double GetUserElapsed() const
Definition: G4Timer.cc:143

References G4cout, G4endl, G4SmartVoxelStat::GetMemoryUse(), G4LogicalVolume::GetName(), G4SmartVoxelStat::GetNumberHeads(), G4SmartVoxelStat::GetNumberNodes(), G4SmartVoxelStat::GetNumberPointers(), G4Timer::GetSystemElapsed(), G4SmartVoxelStat::GetSysTime(), G4SmartVoxelStat::GetTotalTime(), G4Timer::GetUserElapsed(), G4LogicalVolume::GetVoxelHeader(), G4LogicalVolume::SetVoxelHeader(), G4Timer::Start(), G4Timer::Stop(), and G4RunManager::verboseLevel.

Referenced by G4RunManager::ReOptimizeMotherOf().

◆ ReOptimizeMotherOf()

void G4RunManager::ReOptimizeMotherOf ( G4VPhysicalVolume pPhys)
inherited

Definition at line 1001 of file G4RunManager.cc.

1002{
1003 G4LogicalVolume* pMotherL = pPhys->GetMotherLogical();
1004 if(pMotherL != nullptr)
1005 ReOptimize(pMotherL);
1006}
void ReOptimize(G4LogicalVolume *)
G4LogicalVolume * GetMotherLogical() const

References G4VPhysicalVolume::GetMotherLogical(), and G4RunManager::ReOptimize().

◆ RequestWorkersProcessCommandsStack()

void G4MTRunManager::RequestWorkersProcessCommandsStack ( )
virtual

◆ RestoreRandomNumberStatus()

void G4RunManager::RestoreRandomNumberStatus ( const G4String fileN)
virtualinherited

Definition at line 870 of file G4RunManager.cc.

871{
872 G4String fileNameWithDirectory;
873 if(fileN.find("/") == std::string::npos)
874 {
875 fileNameWithDirectory = randomNumberStatusDir + fileN;
876 }
877 else
878 {
879 fileNameWithDirectory = fileN;
880 }
881
882 G4Random::restoreEngineStatus(fileNameWithDirectory);
883 if(verboseLevel > 0)
884 G4cout << "RandomNumberEngineStatus restored from file: "
885 << fileNameWithDirectory << G4endl;
886 G4Random::showEngineStatus();
887}

References G4cout, G4endl, G4RunManager::randomNumberStatusDir, and G4RunManager::verboseLevel.

Referenced by export_G4RunManager(), and G4RunMessenger::SetNewValue().

◆ RestoreRndmEachEvent()

virtual void G4RunManager::RestoreRndmEachEvent ( G4bool  )
inlinevirtualinherited

Reimplemented in G4WorkerRunManager, and G4WorkerTaskRunManager.

Definition at line 346 of file G4RunManager.hh.

346{ /* No effect in SEQ */ }

Referenced by G4RunMessenger::SetNewValue().

◆ rndmSaveThisEvent()

void G4MTRunManager::rndmSaveThisEvent ( )
protectedvirtual

Reimplemented from G4RunManager.

Definition at line 254 of file G4MTRunManager.cc.

255{
256 G4Exception("G4MTRunManager::rndmSaveThisEvent", "RUN_RNDM001",
257 FatalException, "This method shall not be invoked !!");
258}

References FatalException, and G4Exception().

◆ rndmSaveThisRun()

void G4MTRunManager::rndmSaveThisRun ( )
protectedvirtual

Reimplemented from G4RunManager.

Definition at line 221 of file G4MTRunManager.cc.

222{
223 G4int runNumber = 0;
224 if(currentRun != nullptr)
225 runNumber = currentRun->GetRunID();
227 {
228 G4cerr << "Warning from G4RunManager::rndmSaveThisRun():"
229 << " Random number status was not stored prior to this run."
230 << G4endl << "/random/setSavingFlag command must be issued. "
231 << "Command ignored." << G4endl;
232 return;
233 }
234
235 G4String fileIn = randomNumberStatusDir + "G4Worker_currentRun.rndm";
236
237 std::ostringstream os;
238 os << "run" << runNumber << ".rndm" << '\0';
239 G4String fileOut = randomNumberStatusDir + os.str();
240
241#ifdef WIN32
242 G4String copCmd = "/control/shell copy " + fileIn + " " + fileOut;
243#else
244 G4String copCmd = "/control/shell cp " + fileIn + " " + fileOut;
245#endif
247 if(verboseLevel > 0)
248 {
249 G4cout << fileIn << " is copied to " << fileOut << G4endl;
250 }
251}

References G4UImanager::ApplyCommand(), G4RunManager::currentRun, G4cerr, G4cout, G4endl, G4Run::GetRunID(), G4UImanager::GetUIpointer(), G4RunManager::randomNumberStatusDir, G4RunManager::storeRandomNumberStatus, and G4RunManager::verboseLevel.

◆ RunInitialization()

void G4RunManager::RunInitialization ( )
virtualinherited

Reimplemented in G4WorkerRunManager, and G4WorkerTaskRunManager.

Definition at line 332 of file G4RunManager.cc.

333{
335 return;
336
337 runAborted = false;
339
341 delete currentRun;
342 currentRun = nullptr;
343
344 if(fakeRun)
345 return;
346
349
350 if(userRunAction != nullptr)
352 if(currentRun == nullptr)
353 currentRun = new G4Run();
354
357
360 if(fSDM != nullptr)
361 {
363 }
364
365 if(G4VScoreNtupleWriter::Instance() != nullptr)
366 {
367 auto hce = fSDM->PrepareNewEvent();
369 delete hce;
370 }
371
372 std::ostringstream oss;
373 G4Random::saveFullState(oss);
376
377 for(G4int i_prev = 0; i_prev < n_perviousEventsToBeStored; ++i_prev)
378 {
379 previousEvents->push_back(nullptr);
380 }
381
382 if(printModulo >= 0 || verboseLevel > 0)
383 {
384 G4cout << "### Run " << currentRun->GetRunID() << " starts." << G4endl;
385 }
386 if(userRunAction != nullptr)
388
389#if defined(GEANT4_USE_TIMEMORY)
391#endif
392
394 {
396 }
397
399 {
400 G4String fileN = "currentRun";
402 {
403 std::ostringstream os;
404 os << "run" << currentRun->GetRunID();
405 fileN = os.str();
406 }
407 StoreRNGStatus(fileN);
408 }
409}
static G4ParallelWorldProcessStore * GetInstance()
G4bool RunInitialization(G4bool fakeRun=false)
G4bool isScoreNtupleWriter
void CleanUpPreviousEvents()
G4int runIDCounter
std::unique_ptr< ProfilerConfig > masterRunProfiler
G4DCtable * DCtable
G4ProfilerConfig< G4ProfileType::Run > ProfilerConfig
Definition: G4Run.hh:49
void SetHCtable(G4HCtable *HCtbl)
Definition: G4Run.hh:107
void SetNumberOfEventToBeProcessed(G4int n_ev)
Definition: G4Run.hh:103
void SetRunID(G4int id)
Definition: G4Run.hh:102
void SetDCtable(G4DCtable *DCtbl)
Definition: G4Run.hh:108
void SetRandomNumberStatus(G4String &st)
Definition: G4Run.hh:109
G4HCofThisEvent * PrepareNewEvent()
Definition: G4SDManager.cc:113
static G4SDManager * GetSDMpointerIfExist()
Definition: G4SDManager.cc:47
G4HCtable * GetHCtable() const
Definition: G4SDManager.hh:101
virtual void BeginOfRunAction(const G4Run *aRun)
virtual G4Run * GenerateRun()
virtual G4bool Book(G4HCofThisEvent *hce)=0
static G4VScoreNtupleWriter * Instance()
virtual void OpenFile()=0

References G4UserRunAction::BeginOfRunAction(), G4VScoreNtupleWriter::Book(), G4RunManager::CleanUpPreviousEvents(), G4RunManager::currentRun, G4RunManager::DCtable, G4RunManager::fakeRun, G4RunManager::fGeometryHasBeenDestroyed, G4cout, G4endl, G4UserRunAction::GenerateRun(), G4SDManager::GetHCtable(), G4ParallelWorldProcessStore::GetInstance(), G4Run::GetRunID(), G4SDManager::GetSDMpointerIfExist(), G4VScoreNtupleWriter::Instance(), G4RunManager::isScoreNtupleWriter, G4RunManager::kernel, G4RunManager::masterRunProfiler, G4RunManager::n_perviousEventsToBeStored, G4RunManager::numberOfEventProcessed, G4RunManager::numberOfEventToBeProcessed, G4VScoreNtupleWriter::OpenFile(), G4SDManager::PrepareNewEvent(), G4RunManager::previousEvents, G4RunManager::printModulo, G4RunManager::randomNumberStatusForThisRun, G4RunManager::rngStatusEventsFlag, G4RunManager::runAborted, G4RunManager::runIDCounter, G4RunManagerKernel::RunInitialization(), G4Run::SetDCtable(), G4Run::SetHCtable(), G4Run::SetNumberOfEventToBeProcessed(), G4Run::SetRandomNumberStatus(), G4Run::SetRunID(), G4RunManager::storeRandomNumberStatus, G4RunManager::StoreRNGStatus(), G4ParallelWorldProcessStore::UpdateWorlds(), G4RunManager::userRunAction, and G4RunManager::verboseLevel.

Referenced by G4RunManager::BeamOn().

◆ RunTermination()

void G4MTRunManager::RunTermination ( )
virtual

Reimplemented from G4RunManager.

Reimplemented in G4TaskRunManager.

Definition at line 504 of file G4MTRunManager.cc.

505{
506 // Wait for all worker threads to have finished the run
507 // i.e. wait for them to return from RunTermination()
508 // This guarantee that userrunaction for workers has been called
509
510 // Wait now for all threads to finish event-loop
512 // Now call base-class methof
515}
virtual void WaitForEndEventLoopWorkers()

References G4RunManager::RunTermination(), G4RunManager::TerminateEventLoop(), and WaitForEndEventLoopWorkers().

◆ SeedOncePerCommunication()

G4int G4MTRunManager::SeedOncePerCommunication ( )
static

◆ SetDCtable()

void G4RunManager::SetDCtable ( G4DCtable DCtbl)
inlineinherited

Definition at line 573 of file G4RunManager.hh.

573{ DCtable = DCtbl; }

References G4RunManager::DCtable.

Referenced by G4DigiManager::AddNewModule().

◆ SetEventModulo()

void G4MTRunManager::SetEventModulo ( G4int  i = 1)
inline

Definition at line 187 of file G4MTRunManager.hh.

187{ eventModuloDef = i; }

References eventModuloDef.

◆ SetGeometryToBeOptimized()

void G4RunManager::SetGeometryToBeOptimized ( G4bool  vl)
inlineinherited

◆ SetNumberOfAdditionalWaitingStacks()

void G4RunManager::SetNumberOfAdditionalWaitingStacks ( G4int  iAdd)
inlineinherited

Definition at line 422 of file G4RunManager.hh.

427 {
429 }
void SetNumberOfAdditionalWaitingStacks(G4int iAdd)
G4EventManager * eventManager

References G4RunManager::eventManager, and G4EventManager::SetNumberOfAdditionalWaitingStacks().

◆ SetNumberOfEventsToBeProcessed()

void G4RunManager::SetNumberOfEventsToBeProcessed ( G4int  val)
inlineinherited

Definition at line 563 of file G4RunManager.hh.

564 {
566 }

References G4RunManager::numberOfEventToBeProcessed.

◆ SetNumberOfEventsToBeStored()

void G4RunManager::SetNumberOfEventsToBeStored ( G4int  val)
inlineinherited

Definition at line 524 of file G4RunManager.hh.

529 {
531 }

References G4RunManager::n_perviousEventsToBeStored.

◆ SetNumberOfThreads()

void G4MTRunManager::SetNumberOfThreads ( G4int  n)
virtual

Reimplemented from G4RunManager.

Reimplemented in G4TaskRunManager.

Definition at line 261 of file G4MTRunManager.cc.

262{
263 if(threads.size() != 0)
264 {
266 msg << "Number of threads cannot be changed at this moment \n"
267 << "(old threads are still alive). Method ignored.";
268 G4Exception("G4MTRunManager::SetNumberOfThreads(G4int)", "Run0112",
269 JustWarning, msg);
270 }
271 else if(forcedNwokers > 0)
272 {
274 msg << "Number of threads is forced to " << forcedNwokers
275 << " by G4FORCENUMBEROFTHREADS shell variable.\n"
276 << "Method ignored.";
277 G4Exception("G4MTRunManager::SetNumberOfThreads(G4int)", "Run0113",
278 JustWarning, msg);
279 }
280 else
281 {
282 nworkers = n;
283 }
284}

References forcedNwokers, G4Exception(), JustWarning, CLHEP::detail::n, nworkers, and threads.

Referenced by G4RunManagerFactory::CreateRunManager().

◆ SetPinAffinity()

void G4MTRunManager::SetPinAffinity ( G4int  n = 1)

Definition at line 807 of file G4MTRunManager.cc.

808{
809 if(n == 0)
810 {
811 G4Exception("G4MTRunManager::SetPinAffinity", "Run0114", FatalException,
812 "Pin affinity must be >0 or <0.");
813 }
814 pinAffinity = n;
815 return;
816}

References FatalException, G4Exception(), CLHEP::detail::n, and pinAffinity.

◆ SetPrimaryTransformer()

void G4RunManager::SetPrimaryTransformer ( G4PrimaryTransformer pt)
inlineinherited

Definition at line 436 of file G4RunManager.hh.

437 {
439 }
void SetPrimaryTransformer(G4PrimaryTransformer *pt)

References G4RunManager::kernel, and G4RunManagerKernel::SetPrimaryTransformer().

◆ SetPrintProgress()

void G4RunManager::SetPrintProgress ( G4int  i)
inlineinherited

Definition at line 522 of file G4RunManager.hh.

522{ printModulo = i; }

References G4RunManager::printModulo.

Referenced by G4RunMessenger::SetNewValue().

◆ SetRandomNumberStore()

void G4RunManager::SetRandomNumberStore ( G4bool  flag)
inlineinherited

Definition at line 456 of file G4RunManager.hh.

457 {
459 }

References G4RunManager::storeRandomNumberStatus.

Referenced by export_G4RunManager(), and G4RunMessenger::SetNewValue().

◆ SetRandomNumberStoreDir()

void G4RunManager::SetRandomNumberStoreDir ( const G4String dir)
inlineinherited

Definition at line 464 of file G4RunManager.hh.

465 {
466 G4String dirStr = dir;
467 if(dirStr.back() != '/')
468 dirStr += "/";
469 #ifndef WIN32
470 G4String shellCmd = "mkdir -p ";
471 #else
472 std::replace(dirStr.begin(), dirStr.end(), '/', '\\');
473 G4String shellCmd = "if not exist " + dirStr + " mkdir ";
474 #endif
475 shellCmd += dirStr;
476 randomNumberStatusDir = dirStr;
477 G4int sysret = system(shellCmd);
478 if(sysret != 0)
479 {
480 G4String errmsg = "\"" + shellCmd
481 + "\" returns non-zero value. Directory creation failed.";
482 G4Exception("GrRunManager::SetRandomNumberStoreDir", "Run0071",
483 JustWarning, errmsg);
484 G4cerr << " return value = " << sysret << G4endl;
485 }
486 }

References G4cerr, G4endl, G4Exception(), JustWarning, and G4RunManager::randomNumberStatusDir.

Referenced by export_G4RunManager(), and G4RunMessenger::SetNewValue().

◆ SetRandomNumberStorePerEvent()

void G4RunManager::SetRandomNumberStorePerEvent ( G4bool  flag)
inlineinherited

Definition at line 506 of file G4RunManager.hh.

507 {
508 rngStatusEventsFlag = flag;
509 }

References G4RunManager::rngStatusEventsFlag.

Referenced by G4RunMessenger::SetNewValue().

◆ SetRunIDCounter()

void G4RunManager::SetRunIDCounter ( G4int  i)
inlineinherited

Definition at line 558 of file G4RunManager.hh.

558{ runIDCounter = i; }

References G4RunManager::runIDCounter.

Referenced by export_G4RunManager(), Initialize(), and G4TaskRunManager::Initialize().

◆ SetSeedOncePerCommunication()

void G4MTRunManager::SetSeedOncePerCommunication ( G4int  val)
static

◆ SetUpAnEvent()

G4bool G4MTRunManager::SetUpAnEvent ( G4Event evt,
long &  s1,
long &  s2,
long &  s3,
G4bool  reseedRequired = true 
)
virtual

Reimplemented in G4TaskRunManager.

Definition at line 637 of file G4MTRunManager.cc.

639{
642 {
644 if(reseedRequired)
645 {
647 G4int idx_rndm = nSeedsPerEvent * nSeedsUsed;
648 s1 = helper->GetSeed(idx_rndm);
649 s2 = helper->GetSeed(idx_rndm + 1);
650 if(nSeedsPerEvent == 3)
651 s3 = helper->GetSeed(idx_rndm + 2);
652 ++nSeedsUsed;
654 RefillSeeds();
655 }
657 return true;
658 }
659 return false;
660}
void SetEventID(G4int i)
Definition: G4Event.hh:80
virtual void RefillSeeds()
virtual const T GetSeed(const G4int &sdId)
Definition: G4RNGHelper.hh:64

References G4TemplateRNGHelper< T >::GetInstance(), G4TemplateRNGHelper< T >::GetSeed(), nSeedsFilled, nSeedsPerEvent, nSeedsUsed, G4RunManager::numberOfEventProcessed, numberOfEventToBeProcessed, RefillSeeds(), G4Event::SetEventID(), and anonymous_namespace{G4MTRunManager.cc}::setUpEventMutex.

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

◆ SetUpNEvents()

G4int G4MTRunManager::SetUpNEvents ( G4Event evt,
G4SeedsQueue seedsQueue,
G4bool  reseedRequired = true 
)
virtual

◆ SetUserAction() [1/6]

void G4MTRunManager::SetUserAction ( G4UserEventAction userAction)
virtual

Reimplemented from G4RunManager.

Definition at line 589 of file G4MTRunManager.cc.

590{
591 G4Exception("G4MTRunManager::SetUserAction()", "Run0124", FatalException,
592 "For multi-threaded version, define G4UserEventAction in "
593 "G4VUserActionInitialization.");
594}

References FatalException, and G4Exception().

◆ SetUserAction() [2/6]

void G4MTRunManager::SetUserAction ( G4UserRunAction userAction)
virtual

Reimplemented from G4RunManager.

Definition at line 571 of file G4MTRunManager.cc.

572{
573 G4RunManager::SetUserAction(userAction);
574 if(userAction)
575 userAction->SetMaster();
576}
virtual void SetUserAction(G4UserRunAction *userAction)
virtual void SetMaster(G4bool val=true)

References G4UserRunAction::SetMaster(), and G4RunManager::SetUserAction().

Referenced by G4TheMTRayTracer::RestoreUserActions(), and G4TheMTRayTracer::StoreUserActions().

◆ SetUserAction() [3/6]

void G4MTRunManager::SetUserAction ( G4UserStackingAction userAction)
virtual

Reimplemented from G4RunManager.

Definition at line 597 of file G4MTRunManager.cc.

598{
599 G4Exception("G4MTRunManager::SetUserAction()", "Run0125", FatalException,
600 "For multi-threaded version, define G4UserStackingAction in "
601 "G4VUserActionInitialization.");
602}

References FatalException, and G4Exception().

◆ SetUserAction() [4/6]

void G4MTRunManager::SetUserAction ( G4UserSteppingAction userAction)
virtual

Reimplemented from G4RunManager.

Definition at line 613 of file G4MTRunManager.cc.

614{
615 G4Exception("G4MTRunManager::SetUserAction()", "Run0127", FatalException,
616 "For multi-threaded version, define G4UserSteppingAction in "
617 "G4VUserActionInitialization.");
618}

References FatalException, and G4Exception().

◆ SetUserAction() [5/6]

void G4MTRunManager::SetUserAction ( G4UserTrackingAction userAction)
virtual

Reimplemented from G4RunManager.

Definition at line 605 of file G4MTRunManager.cc.

606{
607 G4Exception("G4MTRunManager::SetUserAction()", "Run0126", FatalException,
608 "For multi-threaded version, define G4UserTrackingAction in "
609 "G4VUserActionInitialization.");
610}

References FatalException, and G4Exception().

◆ SetUserAction() [6/6]

void G4MTRunManager::SetUserAction ( G4VUserPrimaryGeneratorAction userAction)
virtual

Reimplemented from G4RunManager.

Definition at line 579 of file G4MTRunManager.cc.

581{
583 "G4MTRunManager::SetUserAction()", "Run0123", FatalException,
584 "For multi-threaded version, define G4VUserPrimaryGeneratorAction in "
585 "G4VUserActionInitialization.");
586}

References FatalException, and G4Exception().

◆ SetUserInitialization() [1/5]

void G4MTRunManager::SetUserInitialization ( G4UserWorkerInitialization userInit)
virtual

Reimplemented from G4RunManager.

Definition at line 537 of file G4MTRunManager.cc.

538{
539 userWorkerInitialization = userInit;
540}

References G4RunManager::userWorkerInitialization.

◆ SetUserInitialization() [2/5]

void G4MTRunManager::SetUserInitialization ( G4UserWorkerThreadInitialization userInit)
virtual

Reimplemented from G4RunManager.

Definition at line 543 of file G4MTRunManager.cc.

545{
547}

References G4RunManager::userWorkerThreadInitialization.

◆ SetUserInitialization() [3/5]

void G4MTRunManager::SetUserInitialization ( G4VUserActionInitialization userInit)
virtual

◆ SetUserInitialization() [4/5]

void G4MTRunManager::SetUserInitialization ( G4VUserDetectorConstruction userDC)
virtual

Reimplemented from G4RunManager.

Definition at line 565 of file G4MTRunManager.cc.

566{
568}
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)

References G4RunManager::SetUserInitialization().

◆ SetUserInitialization() [5/5]

void G4MTRunManager::SetUserInitialization ( G4VUserPhysicsList userPL)
virtual

Reimplemented from G4RunManager.

Definition at line 558 of file G4MTRunManager.cc.

559{
561 // Needed for MT, to be moved in kernel
562}

References G4RunManager::SetUserInitialization().

Referenced by G4TheMTRayTracer::RestoreUserActions(), and G4TheMTRayTracer::StoreUserActions().

◆ SetVerboseLevel()

void G4RunManager::SetVerboseLevel ( G4int  vl)
inlineinherited

◆ StackPreviousEvent()

void G4RunManager::StackPreviousEvent ( G4Event anEvent)
protectedinherited

Definition at line 646 of file G4RunManager.cc.

647{
648 if(anEvent->ToBeKept())
649 currentRun->StoreEvent(anEvent);
650
652 {
653 if(anEvent->GetNumberOfGrips() == 0)
654 {
655 if(!(anEvent->ToBeKept()))
656 delete anEvent;
657 }
658 else
659 {
660 previousEvents->push_back(anEvent);
661 }
662 }
664}
void CleanUpUnnecessaryEvents(G4int keepNEvents)
void StoreEvent(G4Event *evt)
Definition: G4Run.cc:78

References G4RunManager::CleanUpUnnecessaryEvents(), G4RunManager::currentRun, G4Event::GetNumberOfGrips(), G4RunManager::n_perviousEventsToBeStored, G4RunManager::previousEvents, G4Run::StoreEvent(), and G4Event::ToBeKept().

Referenced by G4RunManager::TerminateOneEvent().

◆ StoreRandomNumberStatusToG4Event()

void G4RunManager::StoreRandomNumberStatusToG4Event ( G4int  vl)
inlineinherited

◆ StoreRNGStatus()

void G4MTRunManager::StoreRNGStatus ( const G4String filenamePrefix)
protectedvirtual

Reimplemented from G4RunManager.

Reimplemented in G4TaskRunManager.

Definition at line 213 of file G4MTRunManager.cc.

214{
215 std::ostringstream os;
216 os << randomNumberStatusDir << "G4Master_" << fn << ".rndm";
217 G4Random::saveEngineStatus(os.str().c_str());
218}

References G4RunManager::randomNumberStatusDir.

◆ TerminateEventLoop()

void G4RunManager::TerminateEventLoop ( )
virtualinherited

Reimplemented in G4WorkerRunManager, and G4WorkerTaskRunManager.

Definition at line 477 of file G4RunManager.cc.

478{
479 if(verboseLevel > 0 && !fakeRun)
480 {
481 timer->Stop();
482 G4cout << " Run terminated." << G4endl;
483 G4cout << "Run Summary" << G4endl;
484 if(runAborted)
485 {
486 G4cout << " Run Aborted after " << numberOfEventProcessed
487 << " events processed." << G4endl;
488 }
489 else
490 {
491 G4cout << " Number of events processed : " << numberOfEventProcessed
492 << G4endl;
493 }
494 G4cout << " " << *timer << G4endl;
495 }
497}

References G4RunManager::fakeRun, G4RunManager::fGeometryHasBeenDestroyed, G4cout, G4endl, G4RunManager::numberOfEventProcessed, G4RunManager::runAborted, G4Timer::Stop(), G4RunManager::timer, and G4RunManager::verboseLevel.

Referenced by G4RunManager::DoEventLoop(), RunTermination(), and G4TaskRunManager::RunTermination().

◆ TerminateOneEvent()

void G4MTRunManager::TerminateOneEvent ( )
virtual

Reimplemented from G4RunManager.

Reimplemented in G4TaskRunManager.

Definition at line 304 of file G4MTRunManager.cc.

305{
306 // Nothing to do
307}

◆ TerminateWorkers()

void G4MTRunManager::TerminateWorkers ( )
protectedvirtual

Reimplemented in G4TaskRunManager.

Definition at line 699 of file G4MTRunManager.cc.

700{
701 // Force workers to execute (if any) all UI commands left in the stack
703 // Ask workers to exit
705 // finalize profiler before shutting down the threads
707 // Now join threads.
708#ifdef G4MULTITHREADED // protect here to prevent warning in compilation
709 while(!threads.empty())
710 {
711 G4Thread* t = *(threads.begin());
712 threads.pop_front();
714 // G4THREADJOIN(*t);
715 delete t;
716 }
717#endif
718 threads.clear();
719}
virtual void RequestWorkersProcessCommandsStack()
static void Finalize()
Definition: G4Profiler.cc:331

References ENDWORKER, G4Profiler::Finalize(), G4UserWorkerThreadInitialization::JoinWorker(), NewActionRequest(), RequestWorkersProcessCommandsStack(), threads, and G4RunManager::userWorkerThreadInitialization.

Referenced by ~G4MTRunManager().

◆ ThisWorkerEndEventLoop()

void G4MTRunManager::ThisWorkerEndEventLoop ( )
virtual

◆ ThisWorkerProcessCommandsStackDone()

void G4MTRunManager::ThisWorkerProcessCommandsStackDone ( )
virtual

◆ ThisWorkerReady()

void G4MTRunManager::ThisWorkerReady ( )
virtual

◆ ThisWorkerWaitForNextAction()

G4MTRunManager::WorkerActionRequest G4MTRunManager::ThisWorkerWaitForNextAction ( )
virtual

◆ UpdateScoring()

void G4RunManager::UpdateScoring ( )
protectedinherited

Definition at line 973 of file G4RunManager.cc.

974{
976 {
979 }
980
982 if(ScM == nullptr)
983 return;
984 G4int nPar = ScM->GetNumberOfMesh();
985 if(nPar < 1)
986 return;
987
989 if(HCE == nullptr)
990 return;
991 G4int nColl = HCE->GetCapacity();
992 for(G4int i = 0; i < nColl; ++i)
993 {
994 G4VHitsCollection* HC = HCE->GetHC(i);
995 if(HC != nullptr)
996 ScM->Accumulate(HC);
997 }
998}
G4HCofThisEvent * GetHCofThisEvent() const
Definition: G4Event.hh:156
G4VHitsCollection * GetHC(G4int i)
void Accumulate(G4VHitsCollection *map)
size_t GetNumberOfMesh() const
virtual void Fill(G4HCofThisEvent *hce, G4int eventNumber)=0

References G4ScoringManager::Accumulate(), G4RunManager::currentEvent, G4VScoreNtupleWriter::Fill(), G4HCofThisEvent::GetCapacity(), G4Event::GetEventID(), G4HCofThisEvent::GetHC(), G4Event::GetHCofThisEvent(), G4ScoringManager::GetNumberOfMesh(), G4ScoringManager::GetScoringManagerIfExist(), G4VScoreNtupleWriter::Instance(), and G4RunManager::isScoreNtupleWriter.

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

◆ WaitForEndEventLoopWorkers()

void G4MTRunManager::WaitForEndEventLoopWorkers ( )
protectedvirtual

◆ WaitForReadyWorkers()

void G4MTRunManager::WaitForReadyWorkers ( )
protectedvirtual

Friends And Related Function Documentation

◆ G4RunManagerFactory

friend class G4RunManagerFactory
friend

Definition at line 60 of file G4MTRunManager.hh.

Field Documentation

◆ beginOfEventLoopBarrier

G4MTBarrier G4MTRunManager::beginOfEventLoopBarrier
protected

◆ currentEvent

G4Event* G4RunManager::currentEvent = nullptr
protectedinherited

◆ currentRun

G4Run* G4RunManager::currentRun = nullptr
protectedinherited

◆ currentWorld

G4VPhysicalVolume* G4RunManager::currentWorld = nullptr
protectedinherited

Definition at line 643 of file G4RunManager.hh.

◆ DCtable

G4DCtable* G4RunManager::DCtable = nullptr
protectedinherited

◆ endOfEventLoopBarrier

G4MTBarrier G4MTRunManager::endOfEventLoopBarrier
protected

◆ eventManager

G4EventManager* G4RunManager::eventManager = nullptr
protectedinherited

◆ eventModulo

G4int G4MTRunManager::eventModulo = 1
protected

◆ eventModuloDef

G4int G4MTRunManager::eventModuloDef = 0
protected

◆ fakeRun

G4bool G4RunManager::fakeRun = false
protectedinherited

◆ fGeometryHasBeenDestroyed

G4bool G4RunManager::fGeometryHasBeenDestroyed = false
staticprotectedinherited

◆ fMasterRM

G4MTRunManager * G4MTRunManager::fMasterRM = nullptr
staticprotected

◆ forcedNwokers

G4int G4MTRunManager::forcedNwokers = -1
protected

◆ fRunManager

G4ThreadLocal G4RunManager * G4RunManager::fRunManager = nullptr
staticprivateinherited

◆ geometryDirectlyUpdated

G4bool G4RunManager::geometryDirectlyUpdated = false
protectedinherited

◆ geometryInitialized

G4bool G4RunManager::geometryInitialized = false
protectedinherited

◆ geometryToBeOptimized

G4bool G4RunManager::geometryToBeOptimized = true
protectedinherited

◆ initializedAtLeastOnce

G4bool G4RunManager::initializedAtLeastOnce = false
protectedinherited

◆ isScoreNtupleWriter

G4bool G4RunManager::isScoreNtupleWriter = false
protectedinherited

◆ kernel

G4RunManagerKernel* G4RunManager::kernel = nullptr
protectedinherited

◆ masterRNGEngine

CLHEP::HepRandomEngine* G4MTRunManager::masterRNGEngine = nullptr
private

◆ masterRunProfiler

std::unique_ptr<ProfilerConfig> G4RunManager::masterRunProfiler
privateinherited

◆ masterScM

G4ScoringManager * G4MTRunManager::masterScM = nullptr
staticprotected

◆ masterThreadId

G4ThreadId G4MTRunManager::masterThreadId = G4ThisThread::get_id()
staticprotected

Definition at line 256 of file G4MTRunManager.hh.

Referenced by G4MTRunManager(), and GetMasterThreadId().

◆ masterWorlds

G4MTRunManager::masterWorlds_t G4MTRunManager::masterWorlds = G4MTRunManager::masterWorlds_t()
staticprotected

◆ msgText

G4String G4RunManager::msgText = " "
protectedinherited

◆ MTkernel

G4MTRunManagerKernel* G4MTRunManager::MTkernel = nullptr
private

◆ n_perviousEventsToBeStored

G4int G4RunManager::n_perviousEventsToBeStored = 0
protectedinherited

◆ n_select_msg

G4int G4RunManager::n_select_msg = -1
protectedinherited

◆ nextActionRequest

WorkerActionRequest G4MTRunManager::nextActionRequest = WorkerActionRequest::UNDEFINED
protected

Definition at line 246 of file G4MTRunManager.hh.

Referenced by NewActionRequest(), and ThisWorkerWaitForNextAction().

◆ nextActionRequestBarrier

G4MTBarrier G4MTRunManager::nextActionRequestBarrier
protected

Definition at line 276 of file G4MTRunManager.hh.

Referenced by NewActionRequest(), and ThisWorkerWaitForNextAction().

◆ nParallelWorlds

G4int G4RunManager::nParallelWorlds = 0
protectedinherited

◆ nSeedsFilled

G4int G4MTRunManager::nSeedsFilled = 0
protected

◆ nSeedsMax

G4int G4MTRunManager::nSeedsMax = 10000
protected

◆ nSeedsPerEvent

G4int G4MTRunManager::nSeedsPerEvent = 2
protected

◆ nSeedsUsed

G4int G4MTRunManager::nSeedsUsed = 0
protected

◆ numberOfEventProcessed

G4int G4RunManager::numberOfEventProcessed = 0
protectedinherited

◆ numberOfEventToBeProcessed

G4int G4MTRunManager::numberOfEventToBeProcessed = 0
protected

◆ nworkers

G4int G4MTRunManager::nworkers = 2
protected

◆ physicsInitialized

G4bool G4RunManager::physicsInitialized = false
protectedinherited

◆ physicsList

G4VUserPhysicsList* G4RunManager::physicsList = nullptr
protectedinherited

◆ pinAffinity

G4int G4MTRunManager::pinAffinity = 0
private

Definition at line 284 of file G4MTRunManager.hh.

Referenced by GetPinAffinity(), and SetPinAffinity().

◆ previousEvents

std::list<G4Event*>* G4RunManager::previousEvents = nullptr
protectedinherited

◆ printModulo

G4int G4RunManager::printModulo = -1
protectedinherited

◆ processUIBarrier

G4MTBarrier G4MTRunManager::processUIBarrier
protected

◆ randDbl

G4double* G4MTRunManager::randDbl = nullptr
protected

◆ randomNumberStatusDir

G4String G4RunManager::randomNumberStatusDir = "./"
protectedinherited

◆ randomNumberStatusForThisEvent

G4String G4RunManager::randomNumberStatusForThisEvent = ""
protectedinherited

◆ randomNumberStatusForThisRun

G4String G4RunManager::randomNumberStatusForThisRun = ""
protectedinherited

◆ rngStatusEventsFlag

G4bool G4RunManager::rngStatusEventsFlag = false
protectedinherited

◆ runAborted

G4bool G4RunManager::runAborted = false
protectedinherited

◆ runIDCounter

G4int G4RunManager::runIDCounter = 0
protectedinherited

◆ runManagerType

RMType G4RunManager::runManagerType
protectedinherited

◆ runMessenger

G4RunMessenger* G4RunManager::runMessenger = nullptr
privateinherited

Definition at line 666 of file G4RunManager.hh.

Referenced by G4RunManager::G4RunManager(), and G4RunManager::~G4RunManager().

◆ seedOncePerCommunication

G4int G4MTRunManager::seedOncePerCommunication = 0
staticprotected

◆ selectMacro

G4String G4RunManager::selectMacro = ""
protectedinherited

◆ storeRandomNumberStatus

G4bool G4RunManager::storeRandomNumberStatus = false
protectedinherited

◆ storeRandomNumberStatusToG4Event

G4int G4RunManager::storeRandomNumberStatusToG4Event = 0
protectedinherited

◆ threads

G4ThreadsList G4MTRunManager::threads
private

◆ timer

G4Timer* G4RunManager::timer = nullptr
protectedinherited

◆ uiCmdsForWorkers

std::vector<G4String> G4MTRunManager::uiCmdsForWorkers
private

Definition at line 289 of file G4MTRunManager.hh.

Referenced by GetCommandStack(), and PrepareCommandsStack().

◆ userActionInitialization

G4VUserActionInitialization* G4RunManager::userActionInitialization = nullptr
protectedinherited

◆ userDetector

G4VUserDetectorConstruction* G4RunManager::userDetector = nullptr
protectedinherited

◆ userEventAction

G4UserEventAction* G4RunManager::userEventAction = nullptr
protectedinherited

◆ userPrimaryGeneratorAction

G4VUserPrimaryGeneratorAction* G4RunManager::userPrimaryGeneratorAction = nullptr
protectedinherited

◆ userRunAction

G4UserRunAction* G4RunManager::userRunAction = nullptr
protectedinherited

◆ userStackingAction

G4UserStackingAction* G4RunManager::userStackingAction = nullptr
protectedinherited

◆ userSteppingAction

G4UserSteppingAction* G4RunManager::userSteppingAction = nullptr
protectedinherited

◆ userTrackingAction

G4UserTrackingAction* G4RunManager::userTrackingAction = nullptr
protectedinherited

◆ userWorkerInitialization

G4UserWorkerInitialization* G4RunManager::userWorkerInitialization = nullptr
protectedinherited

◆ userWorkerThreadInitialization

G4UserWorkerThreadInitialization* G4RunManager::userWorkerThreadInitialization = nullptr
protectedinherited

◆ verboseLevel

G4int G4RunManager::verboseLevel = 0
protectedinherited

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