Warning, file /include/Geant4/G4VIntersectionLocator.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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
0038
0039 #ifndef G4VINTERSECTIONLOCATOR_HH
0040 #define G4VINTERSECTIONLOCATOR_HH
0041
0042 #include "G4Types.hh"
0043 #include "G4ThreeVector.hh"
0044 #include "G4FieldTrack.hh"
0045
0046 #include "G4Navigator.hh"
0047 #include "G4ChordFinder.hh"
0048
0049 class G4VIntersectionLocator
0050 {
0051 public:
0052
0053 G4VIntersectionLocator(G4Navigator *theNavigator);
0054
0055 virtual ~G4VIntersectionLocator();
0056
0057
0058 virtual G4bool EstimateIntersectionPoint(
0059 const G4FieldTrack& curveStartPointTangent,
0060 const G4FieldTrack& curveEndPointTangent,
0061 const G4ThreeVector& trialPoint,
0062 G4FieldTrack& intersectPointTangent,
0063 G4bool& recalculatedEndPoint,
0064 G4double& fPreviousSafety,
0065 G4ThreeVector& fPreviousSftOrigin) = 0;
0066
0067
0068
0069
0070
0071
0072 void printStatus( const G4FieldTrack& startFT,
0073 const G4FieldTrack& currentFT,
0074 G4double requestStep,
0075 G4double safety,
0076 G4int stepNum);
0077
0078
0079 inline G4bool IntersectChord( const G4ThreeVector& StartPointA,
0080 const G4ThreeVector& EndPointB,
0081 G4double& NewSafety,
0082 G4double& PreviousSafety,
0083 G4ThreeVector& PreviousSftOrigin,
0084 G4double& LinearStepLength,
0085 G4ThreeVector& IntersectionPoint,
0086 G4bool* calledNavigator = nullptr );
0087
0088
0089
0090 inline void SetEpsilonStepFor( G4double EpsilonStep );
0091 inline void SetDeltaIntersectionFor( G4double deltaIntersection );
0092 inline void SetNavigatorFor( G4Navigator* fNavigator );
0093 inline void SetChordFinderFor(G4ChordFinder* fCFinder );
0094
0095
0096
0097
0098
0099 inline void SetVerboseFor(G4int fVerbose);
0100 inline G4int GetVerboseFor();
0101
0102
0103 public:
0104
0105
0106
0107 inline G4double GetDeltaIntersectionFor();
0108 inline G4double GetEpsilonStepFor();
0109 inline G4Navigator* GetNavigatorFor();
0110 inline G4ChordFinder* GetChordFinderFor();
0111
0112 inline void SetSafetyParametersFor(G4bool UseSafety );
0113
0114 inline void AddAdjustementOfFoundIntersection(G4bool UseCorrection);
0115 inline G4bool GetAdjustementOfFoundIntersection();
0116
0117 inline void AdjustIntersections(G4bool UseCorrection);
0118 inline G4bool AreIntersectionsAdjusted(){ return fUseNormalCorrection; }
0119
0120
0121 static void printStatus( const G4FieldTrack& startFT,
0122 const G4FieldTrack& currentFT,
0123 G4double requestStep,
0124 G4double safety,
0125 G4int stepNum,
0126 std::ostream& oss,
0127 G4int verboseLevel );
0128
0129
0130 inline void SetCheckMode( G4bool value ) { fCheckMode = value; }
0131 inline G4bool GetCheckMode() { return fCheckMode; }
0132
0133 protected:
0134
0135 G4FieldTrack ReEstimateEndpoint( const G4FieldTrack& CurrentStateA,
0136 const G4FieldTrack& EstimtdEndStateB,
0137 G4double linearDistSq,
0138 G4double curveDist );
0139
0140
0141
0142
0143 G4bool CheckAndReEstimateEndpoint( const G4FieldTrack& CurrentStartA,
0144 const G4FieldTrack& EstimatedEndB,
0145 G4FieldTrack& RevisedEndPoint,
0146 G4int & errorCode);
0147
0148
0149
0150
0151
0152 G4ThreeVector GetSurfaceNormal(const G4ThreeVector& CurrentInt_Point,
0153 G4bool& validNormal);
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164 G4ThreeVector GetGlobalSurfaceNormal(const G4ThreeVector& CurrentE_Point,
0165 G4bool& validNormal);
0166
0167
0168
0169 G4bool AdjustmentOfFoundIntersection(const G4ThreeVector& A,
0170 const G4ThreeVector& CurrentE_Point,
0171 const G4ThreeVector& CurrentF_Point,
0172 const G4ThreeVector& MomentumDir,
0173 const G4bool IntersectAF,
0174 G4ThreeVector& IntersectionPoint,
0175 G4double& NewSafety,
0176 G4double& fPrevSafety,
0177 G4ThreeVector& fPrevSftOrigin );
0178
0179
0180
0181 void ReportTrialStep( G4int step_no,
0182 const G4ThreeVector& ChordAB_v,
0183 const G4ThreeVector& ChordEF_v,
0184 const G4ThreeVector& NewMomentumDir,
0185 const G4ThreeVector& NormalAtEntry,
0186 G4bool validNormal );
0187
0188
0189
0190 G4bool LocateGlobalPointWithinVolumeAndCheck( const G4ThreeVector& pos );
0191
0192
0193
0194
0195
0196
0197
0198 void LocateGlobalPointWithinVolumeCheckAndReport( const G4ThreeVector& pos,
0199 const G4String& CodeLocationInfo,
0200 G4int CheckMode );
0201
0202
0203
0204 protected:
0205
0206
0207
0208 void ReportReversedPoints( std::ostringstream& ossMsg,
0209 const G4FieldTrack& StartPointVel,
0210 const G4FieldTrack& EndPointVel,
0211 G4double NewSafety, G4double epsStep,
0212 const G4FieldTrack& CurrentA_PointVelocity,
0213 const G4FieldTrack& CurrentB_PointVelocity,
0214 const G4FieldTrack& SubStart_PointVelocity,
0215 const G4ThreeVector& CurrentE_Point,
0216 const G4FieldTrack& ApproxIntersecPointV,
0217 G4int sbstp_no, G4int sbstp_no_p, G4int depth );
0218
0219
0220
0221 void ReportProgress( std::ostream& oss,
0222 const G4FieldTrack& StartPointVel,
0223 const G4FieldTrack& EndPointVel,
0224 G4int substep_no,
0225 const G4FieldTrack& A_PtVel,
0226 const G4FieldTrack& B_PtVel,
0227 G4double safetyLast,
0228 G4int depth= -1 );
0229
0230
0231 void ReportImmediateHit( const char* MethodName,
0232 const G4ThreeVector& StartPosition,
0233 const G4ThreeVector& TrialPoint,
0234 G4double tolerance,
0235 unsigned long int numCalls );
0236
0237
0238 private:
0239
0240 G4ThreeVector GetLocalSurfaceNormal(const G4ThreeVector& CurrentE_Point,
0241 G4bool& validNormal);
0242
0243
0244 G4ThreeVector GetLastSurfaceNormal( const G4ThreeVector& intersectPoint,
0245 G4bool& validNormal) const;
0246
0247
0248
0249
0250 protected:
0251
0252 G4double kCarTolerance;
0253
0254 G4int fVerboseLevel = 0;
0255 G4bool fUseNormalCorrection = false;
0256 G4bool fCheckMode = false;
0257 G4bool fiUseSafety = false;
0258
0259 G4Navigator* fiNavigator;
0260
0261 G4ChordFinder* fiChordFinder = nullptr;
0262 G4double fiEpsilonStep = -1.0;
0263 G4double fiDeltaIntersection = -1.0;
0264
0265
0266
0267 G4Navigator *fHelpingNavigator;
0268
0269
0270 G4TouchableHistory *fpTouchable = nullptr;
0271
0272 };
0273
0274 #include "G4VIntersectionLocator.icc"
0275
0276 #endif