#include <G4tgrVolumeMgr.hh>
Definition at line 52 of file G4tgrVolumeMgr.hh.
◆ CreateSolid()
Definition at line 66 of file G4tgrVolumeMgr.cc.
68{
70 if(sol != nullptr)
71 {
72 G4String ErrMessage =
"Solid already exists... " + wl[1];
74 ErrMessage);
75 }
76
77 std::vector<G4String> wlc = wl;
78 if(bVOLUtag)
79 {
80 wlc.pop_back();
81 }
82
84 for(
G4int ii = 0; ii < (
G4int)wl2.length(); ++ii)
85 {
86 wl2[ii] = (char)std::toupper(wl2[ii]);
87 }
88 if((wl2 == "UNION") || (wl2 == "SUBTRACTION") || (wl2 == "INTERSECTION"))
89 {
90
91
93 }
94 else if(wl2 == "SCALED")
95 {
96
98 }
99 else if(wl2 == "MULTIUNION")
100 {
101
103 }
104 else
105 {
106
108 }
109
110 return sol;
111}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4tgrSolid * FindSolid(const G4String &name, G4bool exists=false)
Referenced by G4tgrVolume::G4tgrVolume(), and G4tgrLineProcessor::ProcessLine().
◆ DumpSummary()
void G4tgrVolumeMgr::DumpSummary |
( |
| ) |
|
Definition at line 385 of file G4tgrVolumeMgr.cc.
386{
387
388 G4cout <<
" @@@@@@@@@@@@@@@@@@ Dumping Detector Summary " <<
G4endl;
389 G4cout <<
" @@@ Geometry built inside world volume: "
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
407
409 G4cout <<
" Number of G4tgrRotationMatrix's: "
411
412
414
419}
G4GLOB_DLL std::ostream G4cout
const G4mstgrelem & GetElementList() const
const G4mstgrmate & GetMaterialList() const
static G4tgrMaterialFactory * GetInstance()
void DumpElementList() const
void DumpMaterialList() const
const G4mstgrisot & GetIsotopeList() const
void DumpIsotopeList() const
std::vector< G4tgrRotationMatrix * > GetRotMatList() const
static G4tgrRotationMatrixFactory * GetInstance()
const G4tgrVolume * GetTopVolume()
const G4String & GetName() const
◆ 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 {
363 }
364 G4cout <<
" VOL:(" << leafDepth <<
")" << vol->
GetName() <<
" copy No "
366
367
368 std::pair<G4mmapspl::iterator, G4mmapspl::iterator> children =
370 G4mmapspl::const_iterator cite;
371
372 ++leafDepth;
373 for(cite = children.first; cite != children.second; ++cite)
374 {
375
378
381 }
382}
unsigned int GetCopyNo() const
G4tgrVolume * GetVolume() const
void DumpVolumeLeaf(const G4tgrVolume *vol, unsigned int copyNo, unsigned int leafDepth)
std::pair< G4mmapspl::iterator, G4mmapspl::iterator > GetChildren(const G4String &name)
Referenced by DumpVolumeLeaf(), and DumpVolumeTree().
◆ DumpVolumeTree()
void G4tgrVolumeMgr::DumpVolumeTree |
( |
| ) |
|
◆ FindSolid()
◆ FindVolume()
◆ FindVolumes()
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 {
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 {
275 }
276 G4String ErrMessage =
"Volume not found... " + volname;
277 G4Exception(
"G4tgrVolumeMgr::FindVolumes()",
"InvalidSetup",
279 }
280 else
281 {
282 G4String WarMessage =
"Volume does not exists... " + volname;
284 WarMessage);
285 }
286 }
287
288 return vols;
289}
static G4bool AreWordsEquivalent(const G4String &word1, const G4String &word2)
Referenced by G4tgrLineProcessor::ProcessLine().
◆ GetChildren()
std::pair< G4mmapspl::iterator, G4mmapspl::iterator > G4tgrVolumeMgr::GetChildren |
( |
const G4String & | name | ) |
|
◆ GetDetPlaceList()
std::vector< G4tgrPlace * > G4tgrVolumeMgr::GetDetPlaceList |
( |
| ) |
|
|
inline |
◆ GetElementList()
std::vector< G4tgrElement * > G4tgrVolumeMgr::GetElementList |
( |
| ) |
|
|
inline |
◆ GetInstance()
Definition at line 56 of file G4tgrVolumeMgr.cc.
57{
58 if(theInstance == nullptr)
59 {
61 }
62 return theInstance;
63}
Referenced by G4tgrVolume::AddPlace(), G4tgrVolumeAssembly::AddPlace(), G4tgrVolume::AddPlaceParam(), G4tgrVolume::AddPlaceReplica(), G4tgbDetectorConstruction::Construct(), G4tgbVolume::ConstructG4Volumes(), G4tgbVolumeMgr::CopyVolumes(), G4tgrLineProcessor::G4tgrLineProcessor(), G4tgrSolid::G4tgrSolid(), G4tgrSolidBoolean::G4tgrSolidBoolean(), G4tgrSolidMultiUnion::G4tgrSolidMultiUnion(), G4tgrSolidScaled::G4tgrSolidScaled(), G4tgrVolume::G4tgrVolume(), G4tgrVolumeDivision::G4tgrVolumeDivision(), and G4tgbDetectorBuilder::ReadDetector().
◆ GetIsotopeList()
std::vector< G4tgrIsotope * > G4tgrVolumeMgr::GetIsotopeList |
( |
| ) |
|
|
inline |
◆ GetMaterialList()
std::vector< G4tgrMaterial * > G4tgrVolumeMgr::GetMaterialList |
( |
| ) |
|
|
inline |
◆ GetRotMList()
◆ GetSolidMap()
const G4mapssol & G4tgrVolumeMgr::GetSolidMap |
( |
| ) |
|
|
inline |
◆ GetTopVolume()
Definition at line 292 of file G4tgrVolumeMgr.cc.
293{
294
295
296
298 for(auto itetv = theG4tgrVolumeMap.cbegin();
299 itetv != theG4tgrVolumeMap.cend(); ++itetv)
300 {
302#ifdef G4VERBOSE
304 {
305 G4cout <<
" G4tgrVolumeMgr::GetTopVolume() - Vol: " << vol->
GetName()
307 }
308#endif
309
311 {
313#ifdef G4VERBOSE
315 {
316 G4cout <<
" G4tgrVolumeMgr::GetTopVolume() - Vol: " << vol->
GetName()
318 }
319#endif
320 }
321 if((topVol != nullptr) && (topVol != vol) &&
322 (topVol->
GetType() !=
"VOLDivision") &&
323 (vol->
GetType() !=
"VOLDivision"))
324 {
326 "Two world volumes found, second will be taken",
JustWarning,
327 (
G4String(
"Both volumes are at the top of a hierarchy: ") +
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
const std::vector< G4tgrPlace * > GetPlacements() const
Referenced by G4tgbDetectorConstruction::Construct(), DumpSummary(), DumpVolumeTree(), and G4tgbDetectorBuilder::ReadDetector().
◆ GetVolumeList()
std::vector< G4tgrVolume * > G4tgrVolumeMgr::GetVolumeList |
( |
| ) |
|
|
inline |
◆ GetVolumeMap()
const G4mapsvol & G4tgrVolumeMgr::GetVolumeMap |
( |
| ) |
|
|
inline |
◆ GetVolumeTree()
const G4mmapspl & G4tgrVolumeMgr::GetVolumeTree |
( |
| ) |
|
|
inline |
◆ RegisterMe() [1/7]
◆ RegisterMe() [2/7]
◆ RegisterMe() [3/7]
◆ RegisterMe() [4/7]
void G4tgrVolumeMgr::RegisterMe |
( |
G4tgrPlace * | pl | ) |
|
|
inline |
◆ RegisterMe() [5/7]
◆ RegisterMe() [6/7]
void G4tgrVolumeMgr::RegisterMe |
( |
G4tgrSolid * | vol | ) |
|
◆ RegisterMe() [7/7]
Definition at line 143 of file G4tgrVolumeMgr.cc.
144{
145 theG4tgrVolumeList.push_back(vol);
146 if(theG4tgrVolumeMap.find(vol->
GetName()) != theG4tgrVolumeMap.cend())
147 {
149 "Cannot be two volumes with the same name... " + vol->
GetName();
151 ErrMessage);
152 }
153 theG4tgrVolumeMap.insert(G4mapsvol::value_type(vol->
GetName(), vol));
154}
◆ 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 {
132 "Cannot unregister a solid that is not registered... " + sol->GetName();
134 ErrMessage);
135 }
136 else
137 {
138 theG4tgrSolidMap.erase(theG4tgrSolidMap.find(sol->GetName()));
139 }
140}
◆ UnRegisterMe() [2/2]
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 {
171 "Cannot unregister a volume not registered... " + vol->
GetName();
172 G4Exception(
"G4tgrVolumeMgr::unRegisterMe()",
"InvalidSetup",
174 }
175 else
176 {
177 theG4tgrVolumeList.erase(ite);
178 }
179 theG4tgrVolumeMap.erase(theG4tgrVolumeMap.find(vol->
GetName()));
180}
The documentation for this class was generated from the following files: