#include <G4RegionStore.hh>
Definition at line 58 of file G4RegionStore.hh.
◆ ~G4RegionStore()
G4RegionStore::~G4RegionStore |
( |
| ) |
|
|
virtual |
◆ G4RegionStore() [1/2]
◆ G4RegionStore() [2/2]
G4RegionStore::G4RegionStore |
( |
| ) |
|
|
protected |
◆ Clean()
void G4RegionStore::Clean |
( |
| ) |
|
|
static |
Definition at line 78 of file G4RegionStore.cc.
79{
80
81
83 {
84 G4cout <<
"WARNING - Attempt to delete the region store"
85 <<
" while geometry closed !" <<
G4endl;
86 return;
87 }
88
89
90
91
92 locked = true;
93
95
96 for(auto pos=store->cbegin(); pos!=store->cend(); ++pos)
97 {
100 }
101
102 store->bmap.clear(); store->mvalid = false;
103 locked = false;
104 store->clear();
105}
G4GLOB_DLL std::ostream G4cout
static G4bool IsGeometryClosed()
static G4RegionStore * GetInstance()
virtual void NotifyDeRegistration()=0
Referenced by ~G4RegionStore().
◆ DeRegister()
void G4RegionStore::DeRegister |
( |
G4Region * | pRegion | ) |
|
|
static |
Definition at line 171 of file G4RegionStore.cc.
172{
174 if (!locked)
175 {
177 for (auto i=store->cbegin(); i!=store->cend(); ++i)
178 {
179 if (**i==*pRegion)
180 {
181 store->erase(i);
182 break;
183 }
184 }
186 auto it = store->bmap.find(reg_name);
187 if (it != store->bmap.cend())
188 {
189 if (it->second.size() > 1)
190 {
191 for (auto i=it->second.cbegin(); i!=it->second.cend(); ++i)
192 {
193 if (**i==*pRegion)
194 {
195 it->second.erase(i);
196 break;
197 }
198 }
199 }
200 else
201 {
202 store->bmap.erase(it);
203 }
204 }
205 }
206}
const G4String & GetName() const
Referenced by G4Region::~G4Region().
◆ FindOrCreateRegion()
Definition at line 303 of file G4RegionStore.cc.
304{
306 if (target == nullptr)
307 {
309 }
310 return target;
311}
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
◆ GetInstance()
Definition at line 212 of file G4RegionStore.cc.
213{
215 if (fgInstance == nullptr)
216 {
217 fgInstance = &worldStore;
218 }
219 return fgInstance;
220}
Referenced by G4EmBiasingManager::ActivateForcedInteraction(), G4EmBiasingManager::ActivateSecondaryBiasing(), G4LowECapture::BuildPhysicsTable(), G4MicroElecCapture::BuildPhysicsTable(), G4RunManagerKernel::CheckRegions(), Clean(), G4TheRayTracer::CreateBitMap(), G4EmExtraParameters::DefineRegParamForLoss(), DeRegister(), G4RunManagerKernel::DumpRegion(), G4RunManagerKernel::DumpRegion(), G4EmCalculator::FindCouple(), G4EmUtility::FindRegion(), G4ProductionCutsTable::G4ProductionCutsTable(), G4Region::G4Region(), G4Region::G4Region(), G4RunManagerKernel::G4RunManagerKernel(), G4VUserPhysicsList::GetCutValue(), GetRegion(), G4EmModelManager::Initialise(), G4PAIModel::Initialise(), G4PAIPhotModel::Initialise(), G4VAtomDeexcitation::InitialiseAtomicDeexcitation(), IsModified(), Register(), G4RunManager::ReinitializeGeometry(), ResetRegionModified(), G4VUserPhysicsList::SetCutValue(), G4VAtomDeexcitation::SetDeexcitationActiveRegion(), G4ScoringProbe::SetMaterial(), G4Region::SetName(), SetNotifier(), G4VUserPhysicsList::SetParticleCuts(), G4MaterialScanner::SetRegionName(), G4ScoringProbe::SetupGeometry(), SetWorldVolume(), G4GlobalFastSimulationManager::ShowSetup(), G4WorkerThread::UpdateGeometryAndPhysicsVectorFromMaster(), UpdateMap(), UpdateMaterialList(), G4RunManagerKernel::UpdateRegion(), and G4Region::~G4Region().
◆ GetMap()
const std::map< G4String, std::vector< G4Region * > > & G4RegionStore::GetMap |
( |
| ) |
const |
|
inline |
◆ GetRegion()
Definition at line 267 of file G4RegionStore.cc.
268{
270 if (!store->mvalid) { store->
UpdateMap(); }
271 auto pos = store->bmap.find(name);
272 if(pos != store->bmap.cend())
273 {
274 if ((verbose) && (
pos->second.size()>1))
275 {
276 std::ostringstream message;
277 message << "There exists more than ONE region in store named: "
279 << "Returning the first found.";
282 }
283 return pos->second[0];
284 }
285 if (verbose)
286 {
287 std::ostringstream message;
288 message <<
"Region NOT found in store !" <<
G4endl
289 <<
" Region " <<
name <<
" NOT found in store !" <<
G4endl
290 << " Returning NULL pointer.";
293 }
294 return nullptr;
295}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
const char * name(G4int ptype)
Referenced by G4EmBiasingManager::ActivateForcedInteraction(), G4EmBiasingManager::ActivateSecondaryBiasing(), G4LowECapture::BuildPhysicsTable(), G4ProductionCutsTable::CheckMaterialCutsCoupleInfo(), G4EmExtraParameters::DefineRegParamForLoss(), G4RunManagerKernel::DumpRegion(), FindOrCreateRegion(), G4EmUtility::FindRegion(), G4Region::G4Region(), G4RunManagerKernel::G4RunManagerKernel(), G4VUserPhysicsList::GetCutValue(), G4EmModelManager::Initialise(), G4VAtomDeexcitation::InitialiseAtomicDeexcitation(), G4VUserPhysicsList::SetCutValue(), G4ScoringProbe::SetMaterial(), G4VUserPhysicsList::SetParticleCuts(), G4MaterialScanner::SetRegionName(), and G4ScoringProbe::SetupGeometry().
◆ IsMapValid()
G4bool G4RegionStore::IsMapValid |
( |
| ) |
const |
|
inline |
◆ IsModified()
G4bool G4RegionStore::IsModified |
( |
| ) |
const |
Definition at line 227 of file G4RegionStore.cc.
228{
230 {
231 if ((*i)->IsModified()) { return true; }
232 }
233 return false;
234}
◆ operator=()
◆ Register()
void G4RegionStore::Register |
( |
G4Region * | pRegion | ) |
|
|
static |
Definition at line 148 of file G4RegionStore.cc.
149{
151 store->push_back(pRegion);
153 auto it = store->bmap.find(reg_name);
154 if (it != store->bmap.cend())
155 {
156 it->second.push_back(pRegion);
157 }
158 else
159 {
160 std::vector<G4Region*> reg_vec { pRegion };
161 store->bmap.insert(std::make_pair(reg_name, reg_vec));
162 }
164 store->mvalid = true;
165}
virtual void NotifyRegistration()=0
Referenced by G4Region::G4Region(), and G4Region::G4Region().
◆ ResetRegionModified()
void G4RegionStore::ResetRegionModified |
( |
| ) |
|
Definition at line 241 of file G4RegionStore.cc.
242{
244 {
245 (*i)->RegionModified(false);
246 }
247}
◆ SetMapValid()
void G4RegionStore::SetMapValid |
( |
G4bool | val | ) |
|
|
inline |
◆ SetNotifier()
◆ SetWorldVolume()
void G4RegionStore::SetWorldVolume |
( |
| ) |
|
Definition at line 318 of file G4RegionStore.cc.
319{
320
321
323 { (*i)->SetWorld(nullptr); }
324
325
326
329 std::size_t nPhys = fPhysicalVolumeStore->size();
330 for(std::size_t iPhys=0; iPhys<nPhys; ++iPhys)
331 {
334
335
336
338 { (*i)->SetWorld(fPhys); }
339 }
340}
static G4PhysicalVolumeStore * GetInstance()
G4LogicalVolume * GetMotherLogical() const
◆ UpdateMap()
void G4RegionStore::UpdateMap |
( |
| ) |
|
Definition at line 121 of file G4RegionStore.cc.
122{
124 if (mvalid) return;
125 bmap.clear();
127 {
128 const G4String& reg_name = (*pos)->GetName();
129 auto it = bmap.find(reg_name);
130 if (it != bmap.cend())
131 {
132 it->second.push_back(*pos);
133 }
134 else
135 {
136 std::vector<G4Region*> reg_vec { *
pos };
137 bmap.insert(std::make_pair(reg_name, reg_vec));
138 }
139 }
140 mvalid = true;
141 l.unlock();
142}
Referenced by GetRegion().
◆ UpdateMaterialList()
The documentation for this class was generated from the following files: