File indexing completed on 2025-01-18 09:59:25
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 #ifndef G4VOXELSAFETY_HH
0038 #define G4VOXELSAFETY_HH
0039
0040 #include "geomdefs.hh"
0041 #include "G4NavigationHistory.hh"
0042 #include "G4AffineTransform.hh"
0043 #include "G4VPhysicalVolume.hh"
0044 #include "G4LogicalVolume.hh"
0045 #include "G4VSolid.hh"
0046 #include "G4ThreeVector.hh"
0047
0048 #include "G4BlockingList.hh"
0049
0050 #include <vector> // Required for voxel handling & voxel stack
0051
0052 class G4SmartVoxelNode;
0053 class G4SmartVoxelHeader;
0054
0055 class G4VoxelSafety
0056 {
0057 public:
0058
0059 G4VoxelSafety();
0060 ~G4VoxelSafety();
0061
0062 G4SmartVoxelNode* VoxelLocate( G4SmartVoxelHeader* pHead,
0063 const G4ThreeVector& localPoint );
0064
0065 G4double ComputeSafety( const G4ThreeVector& localPoint,
0066 const G4VPhysicalVolume& currentPhysical,
0067 G4double maxLength = DBL_MAX );
0068
0069 inline G4int GetVerboseLevel() const { return fVerbose; }
0070 inline void SetVerboseLevel(G4int level) { fVerbose = level; }
0071
0072
0073
0074 protected:
0075
0076 G4double SafetyForVoxelHeader( const G4SmartVoxelHeader* pHead,
0077 const G4ThreeVector& localPoint,
0078 G4double maxLength,
0079 const G4VPhysicalVolume& currentPhysical,
0080 G4double distUpperDepth = 0.0,
0081 G4double previousMinSafety = DBL_MAX
0082 );
0083
0084 G4double SafetyForVoxelNode( const G4SmartVoxelNode *curVoxelNode,
0085 const G4ThreeVector& localPoint );
0086
0087 G4SmartVoxelNode* VoxelLocateLight( G4SmartVoxelHeader* pHead,
0088 const G4ThreeVector& localPoint ) const;
0089 private:
0090
0091
0092
0093 G4BlockingList fBlockList;
0094
0095
0096 G4LogicalVolume* fpMotherLogical = nullptr;
0097
0098
0099
0100 G4int fVoxelDepth = -1;
0101
0102
0103
0104 std::vector<EAxis> fVoxelAxisStack;
0105
0106
0107 std::vector<G4int> fVoxelNoSlicesStack;
0108
0109
0110 std::vector<G4double> fVoxelSliceWidthStack;
0111
0112
0113 std::vector<G4int> fVoxelNodeNoStack;
0114
0115
0116 std::vector<const G4SmartVoxelHeader*> fVoxelHeaderStack;
0117
0118
0119 G4SmartVoxelNode* fVoxelNode = nullptr;
0120
0121
0122
0123
0124
0125 G4bool fCheck = false;
0126 G4int fVerbose = 0;
0127 G4double kCarTolerance;
0128 };
0129
0130 #endif