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

#include <G4ParallelWorldProcessStore.hh>

+ Inheritance diagram for G4ParallelWorldProcessStore:

Public Member Functions

void SetParallelWorld (G4ParallelWorldProcess *proc, const G4String &parallelWorldName)
 
void UpdateWorlds ()
 
G4ParallelWorldProcessGetProcess (const G4String &parallelWorldName)
 
void Clear ()
 
virtual ~G4ParallelWorldProcessStore ()
 

Static Public Member Functions

static G4ParallelWorldProcessStoreGetInstance ()
 
static G4ParallelWorldProcessStoreGetInstanceIfExist ()
 

Detailed Description

Definition at line 48 of file G4ParallelWorldProcessStore.hh.

Constructor & Destructor Documentation

◆ ~G4ParallelWorldProcessStore()

G4ParallelWorldProcessStore::~G4ParallelWorldProcessStore ( )
virtual

Definition at line 53 of file G4ParallelWorldProcessStore.cc.

54{
55 Clear();
56 fInstance = nullptr;
57}

Member Function Documentation

◆ Clear()

void G4ParallelWorldProcessStore::Clear ( )

Definition at line 99 of file G4ParallelWorldProcessStore.cc.

100{
101 fInstance->clear();
102}

Referenced by ~G4ParallelWorldProcessStore().

◆ GetInstance()

G4ParallelWorldProcessStore * G4ParallelWorldProcessStore::GetInstance ( )
static

◆ GetInstanceIfExist()

G4ParallelWorldProcessStore * G4ParallelWorldProcessStore::GetInstanceIfExist ( )
static

Definition at line 46 of file G4ParallelWorldProcessStore.cc.

47{
48 return fInstance;
49}

Referenced by G4RunManagerKernel::~G4RunManagerKernel().

◆ GetProcess()

G4ParallelWorldProcess * G4ParallelWorldProcessStore::GetProcess ( const G4String & parallelWorldName)

Definition at line 90 of file G4ParallelWorldProcessStore.cc.

91{
92 for(const auto& [proc, name] : *fInstance)
93 {
94 if (name == parallelWorldName) return proc;
95 }
96 return nullptr;
97}

◆ SetParallelWorld()

void G4ParallelWorldProcessStore::SetParallelWorld ( G4ParallelWorldProcess * proc,
const G4String & parallelWorldName )

Definition at line 59 of file G4ParallelWorldProcessStore.cc.

61{
62 for (const auto& [process, name] : *fInstance)
63 {
64 if(process == proc)
65 {
66 if(name == parallelWorldName)
67 {
68 return; // already registered
69 }
70
71 // inconsistent !
73 ED << "G4ParallelWorldProcess (" << proc << ") has the world volume (" << name
74 << "). It is inconsistent with (" << parallelWorldName << ").";
75 G4Exception("G4ParallelWorldProcessStore::SetParallelWorld", "ProcScore0101", FatalException,
76 ED);
77 }
78 }
79 (*fInstance)[proc] = parallelWorldName;
80}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
const char * name(G4int ptype)

Referenced by G4ParallelWorldProcess::G4ParallelWorldProcess().

◆ UpdateWorlds()

void G4ParallelWorldProcessStore::UpdateWorlds ( )

Definition at line 82 of file G4ParallelWorldProcessStore.cc.

83{
84 for(auto& [process, name] : *fInstance)
85 {
86 process->SetParallelWorld(name);
87 }
88}

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


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