Geant4-11
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
G4tgrVolumeMgr Class Reference

#include <G4tgrVolumeMgr.hh>

Public Member Functions

G4tgrSolidCreateSolid (const std::vector< G4String > &wl, G4bool bVOLUtag)
 
void DumpSummary ()
 
void DumpVolumeLeaf (const G4tgrVolume *vol, unsigned int copyNo, unsigned int leafDepth)
 
void DumpVolumeTree ()
 
G4tgrSolidFindSolid (const G4String &name, G4bool exists=false)
 
G4tgrVolumeFindVolume (const G4String &volname, G4bool exists=false)
 
std::vector< G4tgrVolume * > FindVolumes (const G4String &volname, G4bool exists)
 
std::pair< G4mmapspl::iterator, G4mmapspl::iterator > GetChildren (const G4String &name)
 
std::vector< G4tgrPlace * > GetDetPlaceList ()
 
std::vector< G4tgrElement * > GetElementList ()
 
std::vector< G4tgrIsotope * > GetIsotopeList ()
 
std::vector< G4tgrMaterial * > GetMaterialList ()
 
std::vector< G4tgrRotationMatrix * > GetRotMList ()
 
const G4mapssolGetSolidMap ()
 
const G4tgrVolumeGetTopVolume ()
 
std::vector< G4tgrVolume * > GetVolumeList ()
 
const G4mapsvolGetVolumeMap ()
 
const G4mmapsplGetVolumeTree ()
 
void RegisterMe (G4tgrElement *ele)
 
void RegisterMe (G4tgrIsotope *iso)
 
void RegisterMe (G4tgrMaterial *mat)
 
void RegisterMe (G4tgrPlace *pl)
 
void RegisterMe (G4tgrRotationMatrix *rm)
 
void RegisterMe (G4tgrSolid *vol)
 
void RegisterMe (G4tgrVolume *vol)
 
void RegisterParentChild (const G4String &parentName, const G4tgrPlace *pl)
 
void UnRegisterMe (G4tgrSolid *vol)
 
void UnRegisterMe (G4tgrVolume *vol)
 

Static Public Member Functions

static G4tgrVolumeMgrGetInstance ()
 

Private Member Functions

 G4tgrVolumeMgr ()
 
 ~G4tgrVolumeMgr ()
 

Private Attributes

std::vector< G4tgrPlace * > theG4tgrPlaceList
 
G4mapssol theG4tgrSolidMap
 
std::vector< G4tgrVolume * > theG4tgrVolumeList
 
G4mapsvol theG4tgrVolumeMap
 
G4mmapspl theG4tgrVolumeTree
 
std::vector< G4tgrElement * > theHgElemList
 
std::vector< G4tgrIsotope * > theHgIsotList
 
std::vector< G4tgrMaterial * > theHgMateList
 
std::vector< G4tgrRotationMatrix * > theHgRotMList
 

Static Private Attributes

static G4ThreadLocal G4tgrVolumeMgrtheInstance = nullptr
 

Detailed Description

Definition at line 52 of file G4tgrVolumeMgr.hh.

Constructor & Destructor Documentation

◆ G4tgrVolumeMgr()

G4tgrVolumeMgr::G4tgrVolumeMgr ( )
private

Definition at line 45 of file G4tgrVolumeMgr.cc.

46{
47}

Referenced by GetInstance().

◆ ~G4tgrVolumeMgr()

G4tgrVolumeMgr::~G4tgrVolumeMgr ( )
private

Definition at line 50 of file G4tgrVolumeMgr.cc.

51{
52 delete theInstance;
53}
static G4ThreadLocal G4tgrVolumeMgr * theInstance

References theInstance.

Member Function Documentation

◆ CreateSolid()

G4tgrSolid * G4tgrVolumeMgr::CreateSolid ( const std::vector< G4String > &  wl,
G4bool  bVOLUtag 
)

Definition at line 66 of file G4tgrVolumeMgr.cc.

68{
69 G4tgrSolid* sol = FindSolid(wl[1]);
70 if(sol != nullptr)
71 {
72 G4String ErrMessage = "Solid already exists... " + wl[1];
73 G4Exception("G4tgrVolumeMgr::CreateSolid()", "InvalidSetup", FatalException,
74 ErrMessage);
75 }
76
77 std::vector<G4String> wlc = wl;
78 if(bVOLUtag)
79 {
80 wlc.pop_back();
81 }
82
83 G4String wl2 = wlc[2];
84 for(std::size_t ii = 0; ii < wl2.length(); ++ii)
85 {
86 wl2[ii] = toupper(wl2[ii]);
87 }
88 if((wl2 == "UNION") || (wl2 == "SUBTRACTION") || (wl2 == "INTERSECTION"))
89 {
90 //---------- Boolean solid
91 //---------- Create G4tgrSolidBoolean and fill the solid params
92 sol = new G4tgrSolidBoolean(wlc);
93 }
94 else if(wl2 == "SCALED")
95 {
96 //---------- Create G4tgrSolidScaled and fill the solid params
97 sol = new G4tgrSolidScaled(wlc);
98 }
99 else if(wl2 == "MULTIUNION")
100 {
101 //---------- Create G4tgrSolidMultiUnion and fill the solid params
102 sol = new G4tgrSolidMultiUnion(wlc);
103 }
104 else
105 {
106 //---------- Create G4tgrSolidSimple and fill the solid params
107 sol = new G4tgrSolid(wlc);
108 }
109
110 return sol;
111}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
G4tgrSolid * FindSolid(const G4String &name, G4bool exists=false)

References FatalException, FindSolid(), and G4Exception().

Referenced by G4tgrVolume::G4tgrVolume(), and G4tgrLineProcessor::ProcessLine().

◆ DumpSummary()

void G4tgrVolumeMgr::DumpSummary ( )

Definition at line 385 of file G4tgrVolumeMgr.cc.

386{
387 //---------- Dump number of objects of each class
388 G4cout << " @@@@@@@@@@@@@@@@@@ Dumping Detector Summary " << G4endl;
389 G4cout << " @@@ Geometry built inside world volume: "
390 << GetTopVolume()->GetName() << G4endl;
391 G4cout << " Number of G4tgrVolume's: " << theG4tgrVolumeMap.size() << G4endl;
392 unsigned int nPlace = 0;
393 for(auto cite = theG4tgrVolumeMap.cbegin();
394 cite != theG4tgrVolumeMap.cend(); ++cite)
395 {
396 nPlace += ((*cite).second)->GetPlacements().size();
397 }
398 G4cout << " Number of G4tgrPlace's: " << nPlace << G4endl;
399
401 G4cout << " Number of G4tgrIsotope's: " << matef->GetIsotopeList().size()
402 << G4endl;
403 G4cout << " Number of G4tgrElement's: " << matef->GetElementList().size()
404 << G4endl;
405 G4cout << " Number of G4tgrMaterial's: " << matef->GetMaterialList().size()
406 << G4endl;
407
409 G4cout << " Number of G4tgrRotationMatrix's: "
410 << rotmf->GetRotMatList().size() << G4endl;
411
412 //---------- Dump detail list of objects of each class
414
415 matef->DumpIsotopeList();
416 matef->DumpElementList();
417 matef->DumpMaterialList();
418 rotmf->DumpRotmList();
419}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
const G4mstgrelem & GetElementList() const
const G4mstgrmate & GetMaterialList() const
static G4tgrMaterialFactory * GetInstance()
const G4mstgrisot & GetIsotopeList() const
std::vector< G4tgrRotationMatrix * > GetRotMatList() const
static G4tgrRotationMatrixFactory * GetInstance()
const G4tgrVolume * GetTopVolume()
G4mapsvol theG4tgrVolumeMap
const G4String & GetName() const
Definition: G4tgrVolume.hh:83

References G4tgrMaterialFactory::DumpElementList(), G4tgrMaterialFactory::DumpIsotopeList(), G4tgrMaterialFactory::DumpMaterialList(), G4tgrRotationMatrixFactory::DumpRotmList(), DumpVolumeTree(), G4cout, G4endl, G4tgrMaterialFactory::GetElementList(), G4tgrMaterialFactory::GetInstance(), G4tgrRotationMatrixFactory::GetInstance(), G4tgrMaterialFactory::GetIsotopeList(), G4tgrMaterialFactory::GetMaterialList(), G4tgrVolume::GetName(), G4tgrRotationMatrixFactory::GetRotMatList(), GetTopVolume(), and theG4tgrVolumeMap.

◆ DumpVolumeLeaf()

void G4tgrVolumeMgr::DumpVolumeLeaf ( const G4tgrVolume vol,
unsigned int  copyNo,
unsigned int  leafDepth 
)

Definition at line 357 of file G4tgrVolumeMgr.cc.

359{
360 for(std::size_t ii = 0; ii < leafDepth; ++ii)
361 {
362 G4cout << " ";
363 }
364 G4cout << " VOL:(" << leafDepth << ")" << vol->GetName() << " copy No "
365 << copyNo << G4endl;
366
367 //---------- construct the children of this VOL
368 std::pair<G4mmapspl::iterator, G4mmapspl::iterator> children =
369 GetChildren(vol->GetName());
370 G4mmapspl::const_iterator cite;
371
372 ++leafDepth;
373 for(cite = children.first; cite != children.second; ++cite)
374 {
375 //---- find G4tgrVolume pointed by G4tgrPlace
376 const G4tgrPlace* pla = (*cite).second;
377 const G4tgrVolume* volchild = pla->GetVolume();
378 //--- find copyNo
379 unsigned int cn = pla->GetCopyNo();
380 DumpVolumeLeaf(volchild, cn, leafDepth);
381 }
382}
unsigned int GetCopyNo() const
Definition: G4tgrPlace.hh:54
G4tgrVolume * GetVolume() const
Definition: G4tgrPlace.hh:53
void DumpVolumeLeaf(const G4tgrVolume *vol, unsigned int copyNo, unsigned int leafDepth)
std::pair< G4mmapspl::iterator, G4mmapspl::iterator > GetChildren(const G4String &name)

References DumpVolumeLeaf(), G4cout, G4endl, GetChildren(), G4tgrPlace::GetCopyNo(), G4tgrVolume::GetName(), and G4tgrPlace::GetVolume().

Referenced by DumpVolumeLeaf(), and DumpVolumeTree().

◆ DumpVolumeTree()

void G4tgrVolumeMgr::DumpVolumeTree ( )

Definition at line 347 of file G4tgrVolumeMgr.cc.

348{
349 G4cout << " @@@@@@@@@@@@@@@@ DUMPING G4tgrVolume's Tree " << G4endl;
350
351 const G4tgrVolume* vol = GetTopVolume();
352
353 DumpVolumeLeaf(vol, 0, 0);
354}

References DumpVolumeLeaf(), G4cout, G4endl, and GetTopVolume().

Referenced by DumpSummary().

◆ FindSolid()

G4tgrSolid * G4tgrVolumeMgr::FindSolid ( const G4String name,
G4bool  exists = false 
)

Definition at line 190 of file G4tgrVolumeMgr.cc.

191{
192 G4tgrSolid* vol = nullptr;
193
194 G4mapssol::const_iterator svite = theG4tgrSolidMap.find(volname);
195 if(svite == theG4tgrSolidMap.cend())
196 {
197 if(exists)
198 {
199 for(svite = theG4tgrSolidMap.cbegin();
200 svite != theG4tgrSolidMap.cend(); ++svite)
201 {
202 G4cerr << " VOL:" << (*svite).first << G4endl;
203 }
204 G4String ErrMessage = "Solid not found... " + volname;
205 G4Exception("G4tgrVolumeMgr::FindSolid()", "InvalidSetup", FatalException,
206 ErrMessage);
207 }
208 }
209 else
210 {
211 vol = const_cast<G4tgrSolid*>((*svite).second);
212 }
213
214 return vol;
215}
G4GLOB_DLL std::ostream G4cerr
G4mapssol theG4tgrSolidMap

References FatalException, G4cerr, G4endl, G4Exception(), and theG4tgrSolidMap.

Referenced by CreateSolid(), G4tgrSolidBoolean::G4tgrSolidBoolean(), G4tgrSolidMultiUnion::G4tgrSolidMultiUnion(), G4tgrSolidScaled::G4tgrSolidScaled(), and G4tgrVolume::G4tgrVolume().

◆ FindVolume()

G4tgrVolume * G4tgrVolumeMgr::FindVolume ( const G4String volname,
G4bool  exists = false 
)

Definition at line 218 of file G4tgrVolumeMgr.cc.

219{
220 G4tgrVolume* vol = nullptr;
221
222 G4mapsvol::const_iterator svite = theG4tgrVolumeMap.find(volname);
223 if(svite == theG4tgrVolumeMap.cend())
224 {
225 if(exists)
226 {
227 for(svite = theG4tgrVolumeMap.cbegin();
228 svite != theG4tgrVolumeMap.cend(); ++svite)
229 {
230 G4cerr << " VOL:" << (*svite).first << G4endl;
231 }
232 G4String ErrMessage = "Volume not found... " + volname;
233 G4Exception("G4tgrVolumeMgr::FindVolume()", "InvalidSetup",
234 FatalException, ErrMessage);
235 }
236 else
237 {
238 G4String WarMessage = "Volume does not exists... " + volname;
239 G4Exception("G4tgrVolumeMgr::FindVolume()", "SearchFailed", JustWarning,
240 WarMessage);
241 }
242 }
243 else
244 {
245 vol = const_cast<G4tgrVolume*>((*svite).second);
246 }
247
248 return vol;
249}
@ JustWarning

References FatalException, G4cerr, G4endl, G4Exception(), JustWarning, and theG4tgrVolumeMap.

Referenced by G4tgrLineProcessor::FindVolume(), G4tgrSolidBoolean::G4tgrSolidBoolean(), G4tgrSolidMultiUnion::G4tgrSolidMultiUnion(), G4tgrSolidScaled::G4tgrSolidScaled(), G4tgrVolumeDivision::G4tgrVolumeDivision(), and GetTopVolume().

◆ FindVolumes()

std::vector< G4tgrVolume * > G4tgrVolumeMgr::FindVolumes ( const G4String volname,
G4bool  exists 
)

Definition at line 252 of file G4tgrVolumeMgr.cc.

254{
255 std::vector<G4tgrVolume*> vols;
256
257 G4mapsvol::const_iterator svite;
258 for(svite = theG4tgrVolumeMap.cbegin();
259 svite != theG4tgrVolumeMap.cend(); ++svite)
260 {
261 if(G4tgrUtils::AreWordsEquivalent(volname, (*svite).second->GetName()))
262 {
263 vols.push_back(const_cast<G4tgrVolume*>((*svite).second));
264 }
265 }
266
267 if(vols.size() == 0)
268 {
269 if(exists)
270 {
271 for(svite = theG4tgrVolumeMap.cbegin();
272 svite != theG4tgrVolumeMap.cend(); ++svite)
273 {
274 G4cerr << " VOL:" << (*svite).first << G4endl;
275 }
276 G4String ErrMessage = "Volume not found... " + volname;
277 G4Exception("G4tgrVolumeMgr::FindVolumes()", "InvalidSetup",
278 FatalException, ErrMessage);
279 }
280 else
281 {
282 G4String WarMessage = "Volume does not exists... " + volname;
283 G4Exception("G4tgrVolumeMgr::FindVolumes()", "SearchFailed", JustWarning,
284 WarMessage);
285 }
286 }
287
288 return vols;
289}
static G4bool AreWordsEquivalent(const G4String &word1, const G4String &word2)
Definition: G4tgrUtils.cc:653

References G4tgrUtils::AreWordsEquivalent(), FatalException, G4cerr, G4endl, G4Exception(), JustWarning, and theG4tgrVolumeMap.

Referenced by G4tgrLineProcessor::ProcessLine().

◆ GetChildren()

std::pair< G4mmapspl::iterator, G4mmapspl::iterator > G4tgrVolumeMgr::GetChildren ( const G4String name)

Definition at line 339 of file G4tgrVolumeMgr.cc.

340{
341 std::pair<G4mmapspl::iterator, G4mmapspl::iterator> dite;
342 dite = theG4tgrVolumeTree.equal_range(name);
343 return dite;
344}
G4mmapspl theG4tgrVolumeTree
const char * name(G4int ptype)

References G4InuclParticleNames::name(), and theG4tgrVolumeTree.

Referenced by G4tgbVolume::ConstructG4Volumes(), and DumpVolumeLeaf().

◆ GetDetPlaceList()

std::vector< G4tgrPlace * > G4tgrVolumeMgr::GetDetPlaceList ( )
inline

Definition at line 110 of file G4tgrVolumeMgr.hh.

110{ return theG4tgrPlaceList; }
std::vector< G4tgrPlace * > theG4tgrPlaceList

References theG4tgrPlaceList.

◆ GetElementList()

std::vector< G4tgrElement * > G4tgrVolumeMgr::GetElementList ( )
inline

Definition at line 112 of file G4tgrVolumeMgr.hh.

112{ return theHgElemList; }
std::vector< G4tgrElement * > theHgElemList

References theHgElemList.

◆ GetInstance()

G4tgrVolumeMgr * G4tgrVolumeMgr::GetInstance ( )
static

◆ GetIsotopeList()

std::vector< G4tgrIsotope * > G4tgrVolumeMgr::GetIsotopeList ( )
inline

Definition at line 111 of file G4tgrVolumeMgr.hh.

111{ return theHgIsotList; }
std::vector< G4tgrIsotope * > theHgIsotList

References theHgIsotList.

◆ GetMaterialList()

std::vector< G4tgrMaterial * > G4tgrVolumeMgr::GetMaterialList ( )
inline

Definition at line 113 of file G4tgrVolumeMgr.hh.

113{ return theHgMateList; }
std::vector< G4tgrMaterial * > theHgMateList

References theHgMateList.

◆ GetRotMList()

std::vector< G4tgrRotationMatrix * > G4tgrVolumeMgr::GetRotMList ( )
inline

Definition at line 114 of file G4tgrVolumeMgr.hh.

114{ return theHgRotMList; }
std::vector< G4tgrRotationMatrix * > theHgRotMList

References theHgRotMList.

◆ GetSolidMap()

const G4mapssol & G4tgrVolumeMgr::GetSolidMap ( )
inline

Definition at line 106 of file G4tgrVolumeMgr.hh.

106{ return theG4tgrSolidMap; }

References theG4tgrSolidMap.

◆ GetTopVolume()

const G4tgrVolume * G4tgrVolumeMgr::GetTopVolume ( )

Definition at line 292 of file G4tgrVolumeMgr.cc.

293{
294 //--- Start from any G4tgrVolume and go upwards until you get to the top.
295 // Check that indeed all volumes drive to the same top volume
296
297 const G4tgrVolume* topVol = nullptr;
298 for(auto itetv = theG4tgrVolumeMap.cbegin();
299 itetv != theG4tgrVolumeMap.cend(); ++itetv)
300 {
301 const G4tgrVolume* vol = (*itetv).second;
302#ifdef G4VERBOSE
304 {
305 G4cout << " G4tgrVolumeMgr::GetTopVolume() - Vol: " << vol->GetName()
306 << " no place = " << vol->GetPlacements().size() << G4endl;
307 }
308#endif
309
310 while(vol->GetPlacements().size() != 0)
311 {
312 vol = FindVolume((*(vol->GetPlacements()).cbegin())->GetParentName(), 1);
313#ifdef G4VERBOSE
315 {
316 G4cout << " G4tgrVolumeMgr::GetTopVolume() - Vol: " << vol->GetName()
317 << " N place = " << vol->GetPlacements().size() << G4endl;
318 }
319#endif
320 }
321 if((topVol != nullptr) && (topVol != vol) &&
322 (topVol->GetType() != "VOLDivision") &&
323 (vol->GetType() != "VOLDivision"))
324 {
325 G4Exception("G4tgrVolumeMgr::GetTopVolume()",
326 "Two world volumes found, second will be taken", JustWarning,
327 (G4String("Both volumes are at the top of a hierarchy: ") +
328 topVol->GetName() + " & " + vol->GetName())
329 .c_str());
330 }
331 topVol = vol;
332 }
333
334 return topVol;
335}
static G4int GetVerboseLevel()
G4tgrVolume * FindVolume(const G4String &volname, G4bool exists=false)
const G4String & GetType() const
Definition: G4tgrVolume.hh:85
const std::vector< G4tgrPlace * > GetPlacements() const
Definition: G4tgrVolume.hh:89

References FindVolume(), G4cout, G4endl, G4Exception(), G4tgrVolume::GetName(), G4tgrVolume::GetPlacements(), G4tgrVolume::GetType(), G4tgrMessenger::GetVerboseLevel(), JustWarning, and theG4tgrVolumeMap.

Referenced by G4tgbDetectorConstruction::Construct(), DumpSummary(), DumpVolumeTree(), and G4tgbDetectorBuilder::ReadDetector().

◆ GetVolumeList()

std::vector< G4tgrVolume * > G4tgrVolumeMgr::GetVolumeList ( )
inline

Definition at line 109 of file G4tgrVolumeMgr.hh.

109{ return theG4tgrVolumeList; }
std::vector< G4tgrVolume * > theG4tgrVolumeList

References theG4tgrVolumeList.

◆ GetVolumeMap()

const G4mapsvol & G4tgrVolumeMgr::GetVolumeMap ( )
inline

Definition at line 107 of file G4tgrVolumeMgr.hh.

107{ return theG4tgrVolumeMap; }

References theG4tgrVolumeMap.

Referenced by G4tgbVolumeMgr::CopyVolumes().

◆ GetVolumeTree()

const G4mmapspl & G4tgrVolumeMgr::GetVolumeTree ( )
inline

Definition at line 108 of file G4tgrVolumeMgr.hh.

108{ return theG4tgrVolumeTree; }

References theG4tgrVolumeTree.

◆ RegisterMe() [1/7]

void G4tgrVolumeMgr::RegisterMe ( G4tgrElement ele)
inline

Definition at line 100 of file G4tgrVolumeMgr.hh.

100{ theHgElemList.push_back(ele); }
static const G4double ele

References ele, and theHgElemList.

◆ RegisterMe() [2/7]

void G4tgrVolumeMgr::RegisterMe ( G4tgrIsotope iso)
inline

Definition at line 99 of file G4tgrVolumeMgr.hh.

99{ theHgIsotList.push_back(iso); }

References theHgIsotList.

◆ RegisterMe() [3/7]

void G4tgrVolumeMgr::RegisterMe ( G4tgrMaterial mat)
inline

Definition at line 101 of file G4tgrVolumeMgr.hh.

101{ theHgMateList.push_back(mat); }

References theHgMateList.

◆ RegisterMe() [4/7]

void G4tgrVolumeMgr::RegisterMe ( G4tgrPlace pl)
inline

Definition at line 98 of file G4tgrVolumeMgr.hh.

98{ theG4tgrPlaceList.push_back(pl); }

References theG4tgrPlaceList.

◆ RegisterMe() [5/7]

void G4tgrVolumeMgr::RegisterMe ( G4tgrRotationMatrix rm)
inline

Definition at line 102 of file G4tgrVolumeMgr.hh.

102{ theHgRotMList.push_back(rm); }

References theHgRotMList.

◆ RegisterMe() [6/7]

void G4tgrVolumeMgr::RegisterMe ( G4tgrSolid vol)

Definition at line 114 of file G4tgrVolumeMgr.cc.

115{
116 if(theG4tgrSolidMap.find(sol->GetName()) != theG4tgrSolidMap.cend())
117 {
118 G4String ErrMessage =
119 "Cannot be two solids with the same name... " + sol->GetName();
120 G4Exception("G4tgrVolumeMgr::RegisterMe()", "InvalidSetup", FatalException,
121 ErrMessage);
122 }
123 theG4tgrSolidMap.insert(G4mapssol::value_type(sol->GetName(), sol));
124}

References FatalException, G4Exception(), G4tgrSolid::GetName(), and theG4tgrSolidMap.

Referenced by G4tgrSolid::G4tgrSolid(), G4tgrSolidBoolean::G4tgrSolidBoolean(), G4tgrSolidMultiUnion::G4tgrSolidMultiUnion(), G4tgrSolidScaled::G4tgrSolidScaled(), and G4tgrLineProcessor::ProcessLine().

◆ RegisterMe() [7/7]

void G4tgrVolumeMgr::RegisterMe ( G4tgrVolume vol)

Definition at line 143 of file G4tgrVolumeMgr.cc.

144{
145 theG4tgrVolumeList.push_back(vol);
146 if(theG4tgrVolumeMap.find(vol->GetName()) != theG4tgrVolumeMap.cend())
147 {
148 G4String ErrMessage =
149 "Cannot be two volumes with the same name... " + vol->GetName();
150 G4Exception("G4tgrVolumeMgr::RegisterMe()", "InvalidSetup", FatalException,
151 ErrMessage);
152 }
153 theG4tgrVolumeMap.insert(G4mapsvol::value_type(vol->GetName(), vol));
154}

References FatalException, G4Exception(), G4tgrVolume::GetName(), theG4tgrVolumeList, and theG4tgrVolumeMap.

◆ RegisterParentChild()

void G4tgrVolumeMgr::RegisterParentChild ( const G4String parentName,
const G4tgrPlace pl 
)

◆ UnRegisterMe() [1/2]

void G4tgrVolumeMgr::UnRegisterMe ( G4tgrSolid vol)

Definition at line 127 of file G4tgrVolumeMgr.cc.

128{
129 if(theG4tgrSolidMap.find(sol->GetName()) != theG4tgrSolidMap.cend())
130 {
131 G4String ErrMessage =
132 "Cannot unregister a solid that is not registered... " + sol->GetName();
133 G4Exception("G4tgrSolidMgr::unRegisterMe()", "InvalidSetup", FatalException,
134 ErrMessage);
135 }
136 else
137 {
138 theG4tgrSolidMap.erase(theG4tgrSolidMap.find(sol->GetName()));
139 }
140}

References FatalException, G4Exception(), G4tgrSolid::GetName(), and theG4tgrSolidMap.

◆ UnRegisterMe() [2/2]

void G4tgrVolumeMgr::UnRegisterMe ( G4tgrVolume vol)

Definition at line 157 of file G4tgrVolumeMgr.cc.

158{
159 std::vector<G4tgrVolume*>::const_iterator ite;
160 for(ite = theG4tgrVolumeList.cbegin();
161 ite != theG4tgrVolumeList.cend(); ++ite)
162 {
163 if((*ite) == vol)
164 {
165 break;
166 }
167 }
168 if(ite == theG4tgrVolumeList.cend())
169 {
170 G4String ErrMessage =
171 "Cannot unregister a volume not registered... " + vol->GetName();
172 G4Exception("G4tgrVolumeMgr::unRegisterMe()", "InvalidSetup",
173 FatalException, ErrMessage);
174 }
175 else
176 {
177 theG4tgrVolumeList.erase(ite);
178 }
179 theG4tgrVolumeMap.erase(theG4tgrVolumeMap.find(vol->GetName()));
180}

References FatalException, G4Exception(), G4tgrVolume::GetName(), theG4tgrVolumeList, and theG4tgrVolumeMap.

Field Documentation

◆ theG4tgrPlaceList

std::vector<G4tgrPlace*> G4tgrVolumeMgr::theG4tgrPlaceList
private

Definition at line 138 of file G4tgrVolumeMgr.hh.

Referenced by GetDetPlaceList(), and RegisterMe().

◆ theG4tgrSolidMap

G4mapssol G4tgrVolumeMgr::theG4tgrSolidMap
private

Definition at line 123 of file G4tgrVolumeMgr.hh.

Referenced by FindSolid(), GetSolidMap(), RegisterMe(), and UnRegisterMe().

◆ theG4tgrVolumeList

std::vector<G4tgrVolume*> G4tgrVolumeMgr::theG4tgrVolumeList
private

Definition at line 137 of file G4tgrVolumeMgr.hh.

Referenced by GetVolumeList(), RegisterMe(), and UnRegisterMe().

◆ theG4tgrVolumeMap

G4mapsvol G4tgrVolumeMgr::theG4tgrVolumeMap
private

◆ theG4tgrVolumeTree

G4mmapspl G4tgrVolumeMgr::theG4tgrVolumeTree
private

Definition at line 131 of file G4tgrVolumeMgr.hh.

Referenced by GetChildren(), GetVolumeTree(), and RegisterParentChild().

◆ theHgElemList

std::vector<G4tgrElement*> G4tgrVolumeMgr::theHgElemList
private

Definition at line 140 of file G4tgrVolumeMgr.hh.

Referenced by GetElementList(), and RegisterMe().

◆ theHgIsotList

std::vector<G4tgrIsotope*> G4tgrVolumeMgr::theHgIsotList
private

Definition at line 139 of file G4tgrVolumeMgr.hh.

Referenced by GetIsotopeList(), and RegisterMe().

◆ theHgMateList

std::vector<G4tgrMaterial*> G4tgrVolumeMgr::theHgMateList
private

Definition at line 141 of file G4tgrVolumeMgr.hh.

Referenced by GetMaterialList(), and RegisterMe().

◆ theHgRotMList

std::vector<G4tgrRotationMatrix*> G4tgrVolumeMgr::theHgRotMList
private

Definition at line 142 of file G4tgrVolumeMgr.hh.

Referenced by GetRotMList(), and RegisterMe().

◆ theInstance

G4ThreadLocal G4tgrVolumeMgr * G4tgrVolumeMgr::theInstance = nullptr
staticprivate

Definition at line 135 of file G4tgrVolumeMgr.hh.

Referenced by GetInstance(), and ~G4tgrVolumeMgr().


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