41 const G4String& requiredPhysicalVolumeName,
45 fRequiredPhysicalVolumeName (requiredPhysicalVolumeName),
46 fRequiredCopyNo (requiredCopyNo),
47 fpCurrentObjectTransformation (0),
51 fVerbosity (verbosity),
52 fMultipleOccurrence (
false)
57 void G4PhysicalVolumeSearchScene::FindVolume (
const G4VSolid&) {
60 typedef std::vector<PVNodeID>
PVPath;
75 if (fRequiredPhysicalVolumeName == pCurrentPV -> GetName () &&
76 (fRequiredCopyNo < 0 ||
77 fRequiredCopyNo == pCurrentPV -> GetCopyNo ())) {
80 fFoundFullPVPath = fullPVPath;
81 fFoundDepth = currentDepth;
82 fpFoundPV = pCurrentPV;
83 fpFoundLV = pCurrentLV;
84 fFoundObjectTransformation = *fpCurrentObjectTransformation;
87 if (!fMultipleOccurrence && fVerbosity > 0) {
88 fMultipleOccurrence =
true;
89 G4cout <<
"G4PhysicalVolumeSearchScene::FindVolume:"
90 <<
"\n Required volume \""
91 << fRequiredPhysicalVolumeName
93 if (fRequiredCopyNo >= 0) {
94 G4cout <<
", copy no. " << fRequiredCopyNo <<
",";
96 G4cout <<
" found more than once."
97 "\n This function is not smart enough to distinguish identical"
98 "\n physical volumes which have different parentage. It is"
99 "\n tricky to specify in general. This function gives you access"
100 "\n to the first occurrence only."
G4int GetCurrentDepth() const
G4PhysicalVolumeSearchScene(G4PhysicalVolumeModel *, const G4String &requiredPhysicalVolumeName, G4int requiredCopyNo, G4int verbosity=99)
G4GLOB_DLL std::ostream G4cout
G4PhysicalVolumeModel::G4PhysicalVolumeNodeID PVNodeID
std::vector< PVNodeID > PVPath
const std::vector< G4PhysicalVolumeNodeID > & GetFullPVPath() const
virtual ~G4PhysicalVolumeSearchScene()
G4LogicalVolume * GetCurrentLV() const
G4VPhysicalVolume * GetCurrentPV() const