File indexing completed on 2025-07-09 08:30:04
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef DDG4_GEANT4VOLUMEMANAGER_H
0014 #define DDG4_GEANT4VOLUMEMANAGER_H
0015
0016
0017 #include <DD4hep/Detector.h>
0018 #include <DD4hep/IDDescriptor.h>
0019 #include <DDG4/Geant4Primitives.h>
0020
0021
0022 #include <G4VTouchable.hh>
0023
0024
0025 class G4VPhysicalVolume;
0026
0027
0028
0029 namespace dd4hep {
0030
0031
0032 namespace sim {
0033
0034
0035 class Geant4VolumeManager;
0036 class Geant4GeometryInfo;
0037
0038
0039
0040
0041
0042
0043
0044 class Geant4VolumeManager : public Handle<Geant4GeometryInfo> {
0045 protected:
0046
0047 bool checkValidity() const;
0048 protected:
0049 friend class Geant4Mapping;
0050
0051
0052 Geant4VolumeManager() = default;
0053
0054 Geant4VolumeManager(const Handle<Geant4GeometryInfo>& e)
0055 : Handle<Geant4GeometryInfo>(e) { }
0056
0057 Geant4VolumeManager(const Geant4VolumeManager& e) = default;
0058
0059 template <typename Q> Geant4VolumeManager(const Handle<Q>& e)
0060 : Handle<Geant4GeometryInfo>(e) {
0061 }
0062
0063 Geant4VolumeManager& operator=(const Geant4VolumeManager& c) = default;
0064
0065 public:
0066 static const VolumeID InvalidPath = VolumeID(-1LL);
0067 static const VolumeID Insensitive = VolumeID(-2LL);
0068 static const VolumeID NonExisting = 0ULL;
0069
0070
0071 Geant4VolumeManager(const Detector& description, Geant4GeometryInfo* info);
0072
0073
0074 std::vector<const G4VPhysicalVolume*>
0075 placementPath(const G4VTouchable* touchable, bool exception = true) const;
0076
0077 VolumeID volumeID(const G4VTouchable* touchable) const;
0078
0079 void volumeDescriptor(const std::vector<const G4VPhysicalVolume*>& path,
0080 std::pair<VolumeID,std::vector<std::pair<const BitFieldElement*, VolumeID> > >& volume_desc) const;
0081
0082 void volumeDescriptor(const G4VTouchable* touchable,
0083 std::pair<VolumeID,std::vector<std::pair<const BitFieldElement*, VolumeID> > >& volume_desc) const;
0084 };
0085 }
0086 }
0087 #endif