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 #ifndef G4VOXELNAVIGATION_HH
0037 #define G4VOXELNAVIGATION_HH
0038
0039 #include "geomdefs.hh"
0040 #include "G4VNavigation.hh"
0041 #include "G4NavigationHistory.hh"
0042 #include "G4NavigationLogger.hh"
0043 #include "G4AffineTransform.hh"
0044 #include "G4VPhysicalVolume.hh"
0045 #include "G4LogicalVolume.hh"
0046 #include "G4VSolid.hh"
0047 #include "G4ThreeVector.hh"
0048
0049 #include "G4BlockingList.hh"
0050
0051 class G4VoxelSafety;
0052
0053
0054
0055 #include "G4AuxiliaryNavServices.hh"
0056
0057
0058
0059 #include <vector>
0060 #include "G4SmartVoxelProxy.hh"
0061 #include "G4SmartVoxelNode.hh"
0062 #include "G4SmartVoxelHeader.hh"
0063
0064 class G4VoxelNavigation : public G4VNavigation
0065 {
0066 public:
0067
0068 G4VoxelNavigation();
0069 virtual ~G4VoxelNavigation();
0070
0071 G4SmartVoxelNode* VoxelLocate( G4SmartVoxelHeader* pHead,
0072 const G4ThreeVector& localPoint );
0073
0074 virtual G4bool LevelLocate( G4NavigationHistory& history,
0075 const G4VPhysicalVolume* blockedVol,
0076 const G4int blockedNum,
0077 const G4ThreeVector& globalPoint,
0078 const G4ThreeVector* globalDirection,
0079 const G4bool pLocatedOnEdge,
0080 G4ThreeVector& localPoint ) override;
0081
0082 virtual G4double ComputeStep( const G4ThreeVector& globalPoint,
0083 const G4ThreeVector& globalDirection,
0084 const G4double currentProposedStepLength,
0085 G4double& newSafety,
0086 G4NavigationHistory& history,
0087 G4bool& validExitNormal,
0088 G4ThreeVector& exitNormal,
0089 G4bool& exiting,
0090 G4bool& entering,
0091 G4VPhysicalVolume* (*pBlockedPhysical),
0092 G4int& blockedReplicaNo ) override;
0093
0094 virtual G4double ComputeSafety( const G4ThreeVector& globalpoint,
0095 const G4NavigationHistory& history,
0096 const G4double pMaxLength = DBL_MAX ) override;
0097
0098 virtual void RelocateWithinVolume( G4VPhysicalVolume* motherPhysical,
0099 const G4ThreeVector& localPoint ) override;
0100
0101 virtual G4int GetVerboseLevel() const override;
0102 virtual void SetVerboseLevel(G4int level) override;
0103
0104
0105
0106 inline void EnableBestSafety( G4bool flag = false );
0107
0108
0109 protected:
0110
0111 G4double ComputeVoxelSafety( const G4ThreeVector& localPoint ) const;
0112 G4bool LocateNextVoxel( const G4ThreeVector& localPoint,
0113 const G4ThreeVector& localDirection,
0114 const G4double currentStep );
0115
0116 G4SmartVoxelNode* VoxelLocateLight( G4SmartVoxelHeader* pHead,
0117 const G4ThreeVector& localPoint ) const;
0118
0119 private:
0120
0121 void PreComputeStepLog (const G4VPhysicalVolume* motherPhysical,
0122 G4double motherSafety,
0123 const G4ThreeVector& localPoint);
0124 void AlongComputeStepLog(const G4VSolid* sampleSolid,
0125 const G4ThreeVector& samplePoint,
0126 const G4ThreeVector& sampleDirection,
0127 const G4ThreeVector& localDirection,
0128 G4double sampleSafety,
0129 G4double sampleStep);
0130 void PostComputeStepLog (const G4VSolid* motherSolid,
0131 const G4ThreeVector& localPoint,
0132 const G4ThreeVector& localDirection,
0133 G4double motherStep,
0134 G4double motherSafety);
0135 void ComputeSafetyLog (const G4VSolid* solid,
0136 const G4ThreeVector& point,
0137 G4double safety,
0138 G4bool banner);
0139 inline void PrintDaughterLog (const G4VSolid* sampleSolid,
0140 const G4ThreeVector& samplePoint,
0141 G4double sampleSafety,
0142 G4double sampleStep);
0143 protected:
0144
0145 G4BlockingList fBList;
0146
0147
0148
0149
0150
0151
0152 G4int fVoxelDepth = -1;
0153
0154
0155
0156 std::vector<EAxis> fVoxelAxisStack;
0157
0158
0159 std::vector<G4int> fVoxelNoSlicesStack;
0160
0161
0162 std::vector<G4double> fVoxelSliceWidthStack;
0163
0164
0165 std::vector<G4int> fVoxelNodeNoStack;
0166
0167
0168 std::vector<G4SmartVoxelHeader*> fVoxelHeaderStack;
0169
0170
0171 G4SmartVoxelNode* fVoxelNode = nullptr;
0172
0173
0174
0175
0176
0177
0178 G4VoxelSafety* fpVoxelSafety = nullptr;
0179
0180
0181 G4double fHalfTolerance;
0182
0183
0184 G4bool fBestSafety = false;
0185
0186 G4NavigationLogger* fLogger;
0187
0188 };
0189
0190 #include "G4VoxelNavigation.icc"
0191
0192 #endif