#include <G4tgrVolumeMgr.hh>
Definition at line 52 of file G4tgrVolumeMgr.hh.
◆ CreateSolid()
Definition at line 64 of file G4tgrVolumeMgr.cc.
66{
68 if(sol != nullptr)
69 {
70 G4String ErrMessage =
"Solid already exists... " + wl[1];
72 ErrMessage);
73 }
74
75 std::vector<G4String> wlc = wl;
76 if(bVOLUtag)
77 {
78 wlc.pop_back();
79 }
80
82 for(std::size_t ii = 0; ii < wl2.length(); ++ii)
83 {
84 wl2[ii] = toupper(wl2[ii]);
85 }
86 if((wl2 == "UNION") || (wl2 == "SUBTRACTION") || (wl2 == "INTERSECTION"))
87 {
88
89
91 }
92 else
93 {
94
96 }
97
98 return sol;
99}
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 373 of file G4tgrVolumeMgr.cc.
374{
375
376 G4cout <<
" @@@@@@@@@@@@@@@@@@ Dumping Detector Summary " <<
G4endl;
377 G4cout <<
" @@@ Geometry built inside world volume: "
379 G4cout <<
" Number of G4tgrVolume's: " << theG4tgrVolumeMap.size() <<
G4endl;
380 unsigned int nPlace = 0;
381 for(auto cite = theG4tgrVolumeMap.cbegin();
382 cite != theG4tgrVolumeMap.cend(); ++cite)
383 {
384 nPlace += ((*cite).second)->GetPlacements().size();
385 }
386 G4cout <<
" Number of G4tgrPlace's: " << nPlace <<
G4endl;
387
395
397 G4cout <<
" Number of G4tgrRotationMatrix's: "
399
400
402
407}
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 345 of file G4tgrVolumeMgr.cc.
347{
348 for(std::size_t ii = 0; ii < leafDepth; ++ii)
349 {
351 }
352 G4cout <<
" VOL:(" << leafDepth <<
")" << vol->
GetName() <<
" copy No "
354
355
356 std::pair<G4mmapspl::iterator, G4mmapspl::iterator> children =
358 G4mmapspl::const_iterator cite;
359
360 ++leafDepth;
361 for(cite = children.first; cite != children.second; ++cite)
362 {
363
366
369 }
370}
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()
Definition at line 178 of file G4tgrVolumeMgr.cc.
179{
181
182 G4mapssol::const_iterator svite = theG4tgrSolidMap.find(volname);
183 if(svite == theG4tgrSolidMap.cend())
184 {
185 if(exists)
186 {
187 for(svite = theG4tgrSolidMap.cbegin();
188 svite != theG4tgrSolidMap.cend(); ++svite)
189 {
191 }
192 G4String ErrMessage =
"Solid not found... " + volname;
194 ErrMessage);
195 }
196 }
197 else
198 {
199 vol =
const_cast<G4tgrSolid*
>((*svite).second);
200 }
201
202 return vol;
203}
G4GLOB_DLL std::ostream G4cerr
Referenced by CreateSolid(), G4tgrSolidBoolean::G4tgrSolidBoolean(), and G4tgrVolume::G4tgrVolume().
◆ FindVolume()
◆ FindVolumes()
Definition at line 240 of file G4tgrVolumeMgr.cc.
242{
243 std::vector<G4tgrVolume*> vols;
244
245 G4mapsvol::const_iterator svite;
246 for(svite = theG4tgrVolumeMap.cbegin();
247 svite != theG4tgrVolumeMap.cend(); ++svite)
248 {
250 {
251 vols.push_back(
const_cast<G4tgrVolume*
>((*svite).second));
252 }
253 }
254
255 if(vols.size() == 0)
256 {
257 if(exists)
258 {
259 for(svite = theG4tgrVolumeMap.cbegin();
260 svite != theG4tgrVolumeMap.cend(); ++svite)
261 {
263 }
264 G4String ErrMessage =
"Volume not found... " + volname;
265 G4Exception(
"G4tgrVolumeMgr::FindVolumes()",
"InvalidSetup",
267 }
268 else
269 {
270 G4String WarMessage =
"Volume does not exists... " + volname;
272 WarMessage);
273 }
274 }
275
276 return vols;
277}
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 54 of file G4tgrVolumeMgr.cc.
55{
56 if(theInstance == nullptr)
57 {
59 }
60 return theInstance;
61}
Referenced by G4tgrVolume::AddPlace(), G4tgrVolumeAssembly::AddPlace(), G4tgrVolume::AddPlaceParam(), G4tgrVolume::AddPlaceReplica(), G4tgbDetectorConstruction::Construct(), G4tgbVolume::ConstructG4Volumes(), G4tgbVolumeMgr::CopyVolumes(), G4tgrLineProcessor::G4tgrLineProcessor(), G4tgrSolid::G4tgrSolid(), G4tgrSolidBoolean::G4tgrSolidBoolean(), 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 280 of file G4tgrVolumeMgr.cc.
281{
282
283
284
286 for(auto itetv = theG4tgrVolumeMap.cbegin();
287 itetv != theG4tgrVolumeMap.cend(); ++itetv)
288 {
290#ifdef G4VERBOSE
292 {
293 G4cout <<
" G4tgrVolumeMgr::GetTopVolume() - Vol: " << vol->
GetName()
295 }
296#endif
297
299 {
301#ifdef G4VERBOSE
303 {
304 G4cout <<
" G4tgrVolumeMgr::GetTopVolume() - Vol: " << vol->
GetName()
306 }
307#endif
308 }
309 if((topVol != nullptr) && (topVol != vol) &&
310 (topVol->
GetType() !=
"VOLDivision") &&
311 (vol->
GetType() !=
"VOLDivision"))
312 {
314 "Two world volumes found, second will be taken",
JustWarning,
315 (
G4String(
"Both volumes are at the top of a hierarchy: ") +
317 .c_str());
318 }
319 topVol = vol;
320 }
321
322 return topVol;
323}
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 131 of file G4tgrVolumeMgr.cc.
132{
133 theG4tgrVolumeList.push_back(vol);
134 if(theG4tgrVolumeMap.find(vol->
GetName()) != theG4tgrVolumeMap.cend())
135 {
137 "Cannot be two volumes with the same name... " + vol->
GetName();
139 ErrMessage);
140 }
141 theG4tgrVolumeMap.insert(G4mapsvol::value_type(vol->
GetName(), vol));
142}
◆ RegisterParentChild()
void G4tgrVolumeMgr::RegisterParentChild |
( |
const G4String & |
parentName, |
|
|
const G4tgrPlace * |
pl |
|
) |
| |
◆ UnRegisterMe() [1/2]
void G4tgrVolumeMgr::UnRegisterMe |
( |
G4tgrSolid * |
vol | ) |
|
Definition at line 115 of file G4tgrVolumeMgr.cc.
116{
117 if(theG4tgrSolidMap.find(sol->GetName()) != theG4tgrSolidMap.cend())
118 {
120 "Cannot unregister a solid that is not registered... " + sol->GetName();
122 ErrMessage);
123 }
124 else
125 {
126 theG4tgrSolidMap.erase(theG4tgrSolidMap.find(sol->GetName()));
127 }
128}
◆ UnRegisterMe() [2/2]
Definition at line 145 of file G4tgrVolumeMgr.cc.
146{
147 std::vector<G4tgrVolume*>::const_iterator ite;
148 for(ite = theG4tgrVolumeList.cbegin();
149 ite != theG4tgrVolumeList.cend(); ++ite)
150 {
151 if((*ite) == vol)
152 {
153 break;
154 }
155 }
156 if(ite == theG4tgrVolumeList.cend())
157 {
159 "Cannot unregister a volume not registered... " + vol->
GetName();
160 G4Exception(
"G4tgrVolumeMgr::unRegisterMe()",
"InvalidSetup",
162 }
163 else
164 {
165 theG4tgrVolumeList.erase(ite);
166 }
167 theG4tgrVolumeMap.erase(theG4tgrVolumeMap.find(vol->
GetName()));
168}
The documentation for this class was generated from the following files: