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
00039
00040
00041
00042
00043
00044
00045
00046 #ifndef G4VINTERSECTIONLOCATOR_HH
00047 #define G4VINTERSECTIONLOCATOR_HH
00048
00049 #include "G4Types.hh"
00050 #include "G4ThreeVector.hh"
00051 #include "G4FieldTrack.hh"
00052
00053 #include "G4Navigator.hh"
00054 #include "G4ChordFinder.hh"
00055
00056 class G4VIntersectionLocator
00057 {
00058 public:
00059
00060 G4VIntersectionLocator(G4Navigator *theNavigator);
00061
00062 virtual ~G4VIntersectionLocator();
00063
00064
00065 virtual G4bool EstimateIntersectionPoint(
00066 const G4FieldTrack& curveStartPointTangent,
00067 const G4FieldTrack& curveEndPointTangent,
00068 const G4ThreeVector& trialPoint,
00069 G4FieldTrack& intersectPointTangent,
00070 G4bool& recalculatedEndPoint,
00071 G4double& fPreviousSafety,
00072 G4ThreeVector& fPreviousSftOrigin) = 0;
00073
00074
00075
00076
00077
00078
00079 void printStatus( const G4FieldTrack& startFT,
00080 const G4FieldTrack& currentFT,
00081 G4double requestStep,
00082 G4double safety,
00083 G4int step);
00084
00085
00086 inline G4bool IntersectChord( const G4ThreeVector& StartPointA,
00087 const G4ThreeVector& EndPointB,
00088 G4double &NewSafety,
00089 G4double &PreviousSafety,
00090 G4ThreeVector &PreviousSftOrigin,
00091 G4double &LinearStepLength,
00092 G4ThreeVector &IntersectionPoint,
00093 G4bool *calledNavigator=0 );
00094
00095
00096
00097 inline void SetEpsilonStepFor( G4double EpsilonStep );
00098 inline void SetDeltaIntersectionFor( G4double deltaIntersection );
00099 inline void SetNavigatorFor( G4Navigator *fNavigator );
00100 inline void SetChordFinderFor(G4ChordFinder *fCFinder );
00101
00102
00103
00104
00105
00106
00107 inline void SetVerboseFor(G4int fVerbose);
00108 inline G4int GetVerboseFor();
00109
00110
00111 public:
00112
00113
00114 inline G4double GetDeltaIntersectionFor();
00115 inline G4double GetEpsilonStepFor();
00116 inline G4Navigator* GetNavigatorFor();
00117 inline G4ChordFinder* GetChordFinderFor();
00118
00119 inline void SetSafetyParametersFor(G4bool UseSafety );
00120
00121 inline void AddAdjustementOfFoundIntersection(G4bool UseCorrection);
00122 inline G4bool GetAdjustementOfFoundIntersection();
00123
00124 inline void AdjustIntersections(G4bool UseCorrection);
00125 inline G4bool AreIntersectionsAdjusted(){ return fUseNormalCorrection; }
00126
00127
00128 protected:
00129
00130 G4FieldTrack ReEstimateEndpoint( const G4FieldTrack &CurrentStateA,
00131 const G4FieldTrack &EstimtdEndStateB,
00132 G4double linearDistSq,
00133 G4double curveDist);
00134
00135
00136
00137
00138 G4ThreeVector GetSurfaceNormal(const G4ThreeVector &CurrentInt_Point,
00139 G4bool &validNormal);
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 G4ThreeVector GetGlobalSurfaceNormal(const G4ThreeVector &CurrentE_Point,
00151 G4bool &validNormal);
00152
00153
00154
00155 G4bool AdjustmentOfFoundIntersection(const G4ThreeVector &A,
00156 const G4ThreeVector &CurrentE_Point,
00157 const G4ThreeVector &CurrentF_Point,
00158 const G4ThreeVector &MomentumDir,
00159 const G4bool IntersectAF,
00160 G4ThreeVector &IntersectionPoint,
00161 G4double &NewSafety,
00162 G4double &fPrevSafety,
00163 G4ThreeVector &fPrevSftOrigin );
00164
00165
00166
00167 void ReportTrialStep( G4int step_no,
00168 const G4ThreeVector& ChordAB_v,
00169 const G4ThreeVector& ChordEF_v,
00170 const G4ThreeVector& NewMomentumDir,
00171 const G4ThreeVector& NormalAtEntry,
00172 G4bool validNormal );
00173
00174
00175 private:
00176
00177 G4ThreeVector GetLocalSurfaceNormal(const G4ThreeVector &CurrentE_Point,
00178 G4bool &validNormal);
00179
00180
00181 G4ThreeVector GetLastSurfaceNormal( const G4ThreeVector& intersectPoint,
00182 G4bool &validNormal) const;
00183
00184
00185
00186
00187 protected:
00188
00189 G4double kCarTolerance;
00190
00191 G4int fVerboseLevel;
00192 G4bool fUseNormalCorrection;
00193
00194 G4Navigator *fiNavigator;
00195
00196 G4ChordFinder *fiChordFinder;
00197 G4double fiEpsilonStep;
00198 G4double fiDeltaIntersection;
00199 G4bool fiUseSafety;
00200
00201
00202
00203 G4Navigator *fHelpingNavigator;
00204
00205
00206 G4TouchableHistory *fpTouchable;
00207
00208 };
00209
00210 #include "G4VIntersectionLocator.icc"
00211
00212 #endif