00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #ifndef G4VOXELSAFETY_HH
00039 #define G4VOXELSAFETY_HH
00040
00041 #include "geomdefs.hh"
00042 #include "G4NavigationHistory.hh"
00043 #include "G4AffineTransform.hh"
00044 #include "G4VPhysicalVolume.hh"
00045 #include "G4LogicalVolume.hh"
00046 #include "G4VSolid.hh"
00047 #include "G4ThreeVector.hh"
00048
00049 #include "G4BlockingList.hh"
00050
00051 #include <vector>
00052
00053 class G4SmartVoxelNode;
00054 class G4SmartVoxelHeader;
00055
00056 class G4VoxelSafety
00057 {
00058 public:
00059
00060 G4VoxelSafety();
00061 ~G4VoxelSafety();
00062
00063 G4SmartVoxelNode* VoxelLocate( G4SmartVoxelHeader* pHead,
00064 const G4ThreeVector& localPoint );
00065
00066 G4double ComputeSafety( const G4ThreeVector& localPoint,
00067 const G4VPhysicalVolume& currentPhysical,
00068 G4double maxLength=DBL_MAX );
00069
00070 inline G4int GetVerboseLevel() const { return fVerbose; }
00071 inline void SetVerboseLevel(G4int level) { fVerbose= level; }
00072
00073
00074
00075 protected:
00076
00077 G4double SafetyForVoxelHeader( const G4SmartVoxelHeader* pHead,
00078 const G4ThreeVector& localPoint,
00079 G4double maxLength,
00080 const G4VPhysicalVolume& currentPhysical,
00081 G4double distUpperDepth = 0.0,
00082 G4double previousMinSafety= DBL_MAX
00083 );
00084
00085 G4double SafetyForVoxelNode( const G4SmartVoxelNode *curVoxelNode,
00086 const G4ThreeVector& localPoint );
00087
00088 G4SmartVoxelNode* VoxelLocateLight( G4SmartVoxelHeader* pHead,
00089 const G4ThreeVector& localPoint ) const;
00090 private:
00091
00092
00093
00094 G4BlockingList fBlockList;
00095
00096
00097 G4LogicalVolume* fpMotherLogical;
00098
00099
00100
00101 G4int fVoxelDepth;
00102
00103
00104
00105 std::vector<EAxis> fVoxelAxisStack;
00106
00107
00108 std::vector<G4int> fVoxelNoSlicesStack;
00109
00110
00111 std::vector<G4double> fVoxelSliceWidthStack;
00112
00113
00114 std::vector<G4int> fVoxelNodeNoStack;
00115
00116
00117 std::vector<const G4SmartVoxelHeader*> fVoxelHeaderStack;
00118
00119
00120 G4SmartVoxelNode* fVoxelNode;
00121
00122
00123
00124
00125
00126 G4bool fCheck;
00127 G4int fVerbose;
00128 G4double kCarTolerance;
00129 };
00130
00131 #endif