File indexing completed on 2025-01-18 09:59:02
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 G4REPLICANAVIGATION_HH
0038 #define G4REPLICANAVIGATION_HH
0039
0040 #include <CLHEP/Units/SystemOfUnits.h>
0041
0042 #include "G4Types.hh"
0043 #include "G4NavigationHistory.hh"
0044 #include "G4LogicalVolume.hh"
0045 #include "G4VPhysicalVolume.hh"
0046 #include "G4ThreeVector.hh"
0047 #include "G4BlockingList.hh"
0048
0049
0050
0051 #include "G4SmartVoxelHeader.hh"
0052
0053 class G4VSolid;
0054
0055 struct G4ExitNormal
0056 {
0057
0058
0059
0060
0061 enum ESide {kNull,kRMin,kRMax,kSPhi,kEPhi,kPX,kMX,kPY,kMY,kPZ,kMZ,kMother};
0062
0063
0064 G4ThreeVector exitNormal;
0065 G4bool calculated;
0066 G4bool validConvex;
0067 ESide exitSide;
0068
0069 public:
0070
0071 G4ExitNormal(const G4ThreeVector& norm = G4ThreeVector(0.,0.,0.),
0072 G4bool calc = false,
0073 G4bool valid= false,
0074 ESide side = kNull )
0075 { exitNormal= norm; calculated= calc; validConvex=valid; exitSide=side;}
0076 };
0077
0078 class G4ReplicaNavigation
0079 {
0080 public:
0081
0082 G4ReplicaNavigation();
0083 ~G4ReplicaNavigation();
0084
0085 inline G4bool LevelLocate( G4NavigationHistory& history,
0086 const G4VPhysicalVolume* blockedVol,
0087 const G4int blockedNum,
0088 const G4ThreeVector& globalPoint,
0089 const G4ThreeVector* globalDirection,
0090 const G4bool pLocatedOnEdge,
0091 G4ThreeVector& localPoint );
0092
0093 G4double ComputeStep( const G4ThreeVector& globalPoint,
0094 const G4ThreeVector& globalDirection,
0095 const G4ThreeVector& localPoint,
0096 const G4ThreeVector& localDirection,
0097 const G4double currentProposedStepLength,
0098 G4double& newSafety,
0099 G4NavigationHistory& history,
0100 G4bool& validExitNormal,
0101 G4bool& calculatedExitNormal,
0102 G4ThreeVector &exitNormal,
0103 G4bool& exiting,
0104 G4bool& entering,
0105 G4VPhysicalVolume* (*pBlockedPhysical),
0106 G4int &blockedReplicaNo );
0107
0108 G4double ComputeSafety( const G4ThreeVector& globalPoint,
0109 const G4ThreeVector& localPoint,
0110 const G4NavigationHistory& history,
0111 const G4double pProposedMaxLength = DBL_MAX ) const;
0112
0113 EInside BackLocate( G4NavigationHistory &history,
0114 const G4ThreeVector& globalPoint,
0115 G4ThreeVector& localPoint,
0116 const G4bool& exiting,
0117 G4bool& notKnownInside ) const;
0118
0119 void ComputeTransformation( const G4int replicaNo,
0120 G4VPhysicalVolume* pVol,
0121 G4ThreeVector& point ) const;
0122 void ComputeTransformation( const G4int replicaNo,
0123 G4VPhysicalVolume* pVol ) const;
0124
0125 EInside Inside( const G4VPhysicalVolume* pVol,
0126 const G4int replicaNo,
0127 const G4ThreeVector& localPoint ) const;
0128 G4double DistanceToOut( const G4VPhysicalVolume* pVol,
0129 const G4int replicaNo,
0130 const G4ThreeVector &localPoint ) const;
0131 G4double DistanceToOut( const G4VPhysicalVolume* pVol,
0132 const G4int replicaNo,
0133 const G4ThreeVector& localPoint,
0134 const G4ThreeVector& localDirection,
0135 G4ExitNormal& candidateNormal ) const;
0136
0137 inline G4int GetVerboseLevel() const;
0138 inline void SetVerboseLevel(G4int level);
0139
0140
0141
0142 inline void CheckMode(G4bool mode);
0143
0144
0145
0146
0147 private:
0148
0149 inline G4int VoxelLocate( const G4SmartVoxelHeader* pHead,
0150 const G4ThreeVector& localPoint,
0151 const G4int blocked=-1 ) const;
0152
0153 G4double DistanceToOutPhi( const G4ThreeVector& localPoint,
0154 const G4ThreeVector& localDirection,
0155 const G4double width,
0156 G4ExitNormal& foundNormal ) const;
0157
0158 G4double DistanceToOutRad( const G4ThreeVector& localPoint,
0159 const G4ThreeVector& localDirection,
0160 const G4double width,
0161 const G4double offset,
0162 const G4int replicaNo,
0163 G4ExitNormal& foundNormal ) const;
0164 inline void SetPhiTransformation( const G4double ang,
0165 G4VPhysicalVolume* pVol=nullptr ) const;
0166 private:
0167
0168
0169
0170
0171 G4bool fCheck = false;
0172 G4int fVerbose = 0;
0173
0174
0175 G4double kCarTolerance, kRadTolerance, kAngTolerance,
0176 halfkCarTolerance, halfkRadTolerance, halfkAngTolerance,
0177 fMinStep;
0178
0179 };
0180
0181 #include "G4ReplicaNavigation.icc"
0182
0183 #endif