File indexing completed on 2025-01-18 09:58:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 #ifndef G4PHYSICALVOLUMESSEARCHSCENE_HH
0039 #define G4PHYSICALVOLUMESSEARCHSCENE_HH
0040
0041 #include "G4PseudoScene.hh"
0042
0043 #include "G4VPhysicalVolume.hh"
0044 #include "G4PhysicalVolumeModel.hh"
0045
0046 class G4PhysicalVolumesSearchScene: public G4PseudoScene
0047 {
0048 public:
0049
0050 G4PhysicalVolumesSearchScene
0051 (G4PhysicalVolumeModel* pSearchVolumeModel,
0052 const G4String& requiredPhysicalVolumeName,
0053 G4int requiredCopyNo = -1);
0054
0055 virtual ~G4PhysicalVolumesSearchScene () {}
0056
0057 struct Findings
0058 {
0059 Findings
0060 (G4VPhysicalVolume* pSearchPV,
0061 G4VPhysicalVolume* pFoundPV,
0062 G4int foundPVCopyNo = 0,
0063 G4int foundDepth = 0,
0064 std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>
0065 foundBasePVPath =
0066 std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>(),
0067 std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>
0068 foundFullPVPath =
0069 std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>(),
0070 G4Transform3D foundObjectTransformation = G4Transform3D())
0071 : fpSearchPV(pSearchPV)
0072 , fpFoundPV(pFoundPV)
0073 , fFoundPVCopyNo(foundPVCopyNo)
0074 , fFoundDepth(foundDepth)
0075 , fFoundBasePVPath(foundBasePVPath)
0076 , fFoundFullPVPath(foundFullPVPath)
0077 , fFoundObjectTransformation(foundObjectTransformation) {}
0078 Findings(const G4PhysicalVolumeModel::TouchableProperties& tp)
0079 : fpSearchPV(nullptr)
0080 , fpFoundPV(tp.fpTouchablePV)
0081 , fFoundPVCopyNo(tp.fCopyNo)
0082 , fFoundDepth(0)
0083 , fFoundBasePVPath(tp.fTouchableBaseFullPVPath)
0084 , fFoundFullPVPath(tp.fTouchableFullPVPath)
0085 , fFoundObjectTransformation(tp.fTouchableGlobalTransform) {}
0086 G4VPhysicalVolume* fpSearchPV;
0087 G4VPhysicalVolume* fpFoundPV;
0088 G4int fFoundPVCopyNo;
0089 G4int fFoundDepth;
0090 std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>
0091 fFoundBasePVPath;
0092 std::vector<G4PhysicalVolumeModel::G4PhysicalVolumeNodeID>
0093 fFoundFullPVPath;
0094 G4Transform3D fFoundObjectTransformation;
0095 };
0096
0097 const std::vector<Findings>& GetFindings() const
0098 {return fFindings;}
0099
0100 private:
0101
0102 class Matcher {
0103 public:
0104 Matcher(const G4String& requiredMatch);
0105 G4bool Match(const G4String&);
0106
0107
0108
0109 private:
0110 G4bool fRegexFlag;
0111 G4String fRequiredMatch;
0112 };
0113
0114 void ProcessVolume(const G4VSolid&);
0115
0116 const G4PhysicalVolumeModel* fpSearchVolumesModel;
0117 Matcher fMatcher;
0118 G4int fRequiredCopyNo;
0119 std::vector<Findings> fFindings;
0120 };
0121
0122 #endif