File indexing completed on 2025-01-18 10:13:56
0001
0002
0003
0004
0005
0006
0007 #ifndef VECGEOM_MANAGEMENT_FLATVOXELMANAGER_H_
0008 #define VECGEOM_MANAGEMENT_FLATVOXELMANAGER_H_
0009
0010 #include "VecGeom/base/Global.h"
0011 #include "VecGeom/volumes/PlacedVolume.h"
0012 #include "VecGeom/volumes/LogicalVolume.h"
0013 #include "VecGeom/base/Vector3D.h"
0014 #include "VecGeom/management/GeoManager.h"
0015 #include "VecGeom/base/FlatVoxelHashMap.h"
0016 #include <vector>
0017
0018 namespace vecgeom {
0019 inline namespace VECGEOM_IMPL_NAMESPACE {
0020
0021 class VPlacedVolume;
0022
0023
0024 class FlatVoxelManager {
0025
0026 public:
0027
0028 struct VoxelStructure {
0029 FlatVoxelHashMap<float, true> *fVoxels = nullptr;
0030 FlatVoxelHashMap<int, false> *fVoxelToCandidate =
0031 nullptr;
0032 FlatVoxelHashMap<int, false> *fVoxelToLocateCandidates =
0033 nullptr;
0034
0035 LogicalVolume const *fVol = nullptr;
0036 };
0037
0038 private:
0039
0040 std::vector<VoxelStructure const *> fStructureHolder;
0041
0042 public:
0043
0044 void InitStructure(LogicalVolume const *lvol);
0045
0046 static FlatVoxelManager &Instance()
0047 {
0048 static FlatVoxelManager manager;
0049 return manager;
0050 }
0051
0052
0053 void RemoveStructure(LogicalVolume const *lvol);
0054
0055 VoxelStructure const *GetStructure(LogicalVolume const *lvol) const { return fStructureHolder[lvol->id()]; }
0056
0057 static VoxelStructure *BuildStructure(LogicalVolume const *lvol);
0058
0059 static FlatVoxelHashMap<int, false> *BuildLocateVoxels(LogicalVolume const *lvol);
0060 static FlatVoxelHashMap<int, false> *BuildSafetyVoxels(LogicalVolume const *lvol);
0061 };
0062 }
0063 }
0064
0065 #endif