Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // Class G4VIntersectionLocator 27 // 28 // class description: 29 // 30 // Base class for the calculation of the inter 31 // when PropagationInField is used. 32 // Gives possibility to choose the method of i 33 // implemented are: G4SimpleLocator, G4MultiLe 34 // 35 // Key Method: EstimateIntersectionPoint() 36 37 // 27.10.08 - John Apostolakis, Tatiana Nikiti 38 // ------------------------------------------- 39 #ifndef G4VINTERSECTIONLOCATOR_HH 40 #define G4VINTERSECTIONLOCATOR_HH 41 42 #include "G4Types.hh" 43 #include "G4ThreeVector.hh" 44 #include "G4FieldTrack.hh" 45 46 #include "G4Navigator.hh" 47 #include "G4ChordFinder.hh" 48 49 class G4VIntersectionLocator 50 { 51 public: // with description 52 53 G4VIntersectionLocator(G4Navigator *theNa 54 // Constructor 55 virtual ~G4VIntersectionLocator(); 56 // Default destructor 57 58 virtual G4bool EstimateIntersectionPoint( 59 const G4FieldTrack& curveStartP 60 const G4FieldTrack& curveEndPoi 61 const G4ThreeVector& trialPoint, 62 G4FieldTrack& intersectPo 63 G4bool& recalculate 64 G4double& fPreviousSa 65 G4ThreeVector& fPreviousSf 66 // If such an intersection exists, this 67 // intersection point of the true path 68 // of the current volume (or of one of 69 // Should use lateral displacement as m 70 // NOTE: changes the safety! 71 72 void printStatus( const G4FieldTrack& sta 73 const G4FieldTrack& cur 74 G4double req 75 G4double saf 76 G4int ste 77 // Print Method, useful mostly for debu 78 79 inline G4bool IntersectChord( const G4Thr 80 const G4Thr 81 G4double& 82 G4double& 83 G4ThreeVect 84 G4double& 85 G4ThreeVect 86 G4bool* 87 // Intersect the chord from StartPointA 88 // whether an intersection occurred. NO 89 90 inline void SetEpsilonStepFor( G4double E 91 inline void SetDeltaIntersectionFor( G4do 92 inline void SetNavigatorFor( G4Navigator* 93 inline void SetChordFinderFor(G4ChordFind 94 // These parameters must be set at each 95 // Note: This simple approach ensures t 96 // Future refinement may identify 97 // track, run or event 98 99 inline void SetVerboseFor(G4int fVerbose 100 inline G4int GetVerboseFor(); 101 // Controling verbosity enables checkin 102 103 public: // without description 104 105 // Additional inline Set/Get methods for p 106 107 inline G4double GetDeltaIntersection 108 inline G4double GetEpsilonStepFor(); 109 inline G4Navigator* GetNavigatorFor(); 110 inline G4ChordFinder* GetChordFinderFor(); 111 112 inline void SetSafetyParametersFor(G4bool 113 114 inline void AddAdjustementOfFoundIntersect 115 inline G4bool GetAdjustementOfFoundInterse 116 // Methods to be made Obsolete - replace 117 inline void AdjustIntersections(G4bool Use 118 inline G4bool AreIntersectionsAdjusted(){ 119 // Change adjustment flag ( New Interfa 120 121 static void printStatus( const G4FieldTrac 122 const G4FieldTrac 123 G4double 124 G4double 125 G4int 126 std::ostrea 127 G4int 128 // Print Method for any ostream - e.g. c 129 130 inline void SetCheckMode( G4bool value ) { 131 inline G4bool GetCheckMode() { 132 133 protected: // with description 134 135 G4FieldTrack ReEstimateEndpoint( const G4F 136 const G4F 137 G4d 138 G4d 139 // Return new estimate for state after c 140 // CurrentStateA, to replace EstimtdEndS 141 // (if field is compiled verbose) 142 143 G4bool CheckAndReEstimateEndpoint( const G 144 const G 145 G 146 G 147 // Check whether EndB is too far from St 148 // and if, re-estimate new value for End 149 // Report error if EndB is before Start 150 // In that case return errorCode = 2. 151 152 G4ThreeVector GetSurfaceNormal(const G4Thr 153 G4boo 154 // Position *must* be the intersection p 155 // to G4Navigator's ComputeStep (via In 156 // Will try to use cached (last) value i 157 // if it was kept and valid. 158 // Value returned is in global coordinat 159 // It does NOT guarantee to obtain Norma 160 // - the "Intersection" Point is not on 161 // - inaccuracies in the transformation 162 // - issues with the Solid. 163 164 G4ThreeVector GetGlobalSurfaceNormal(const 165 166 // Return the SurfaceNormal of Intersect 167 // Costlier then GetSurfaceNormal 168 169 G4bool AdjustmentOfFoundIntersection(const 170 const 171 const 172 const 173 const 174 175 176 177 178 // Optional method for adjustment of loc 179 // using the surface-normal 180 181 void ReportTrialStep( G4int step_no, 182 const G4ThreeVector& 183 const G4ThreeVector& 184 const G4ThreeVector& 185 const G4ThreeVector& 186 G4bool validNormal 187 // Print a three-line report on the curr 188 // intersection 189 190 G4bool LocateGlobalPointWithinVolumeAndChe 191 // Locate point using navigator - update 192 // By default, it assumes that the point 193 // and returns true. 194 // In check mode, checks whether the poi 195 // If it is inside, it returns true. 196 // If not, issues a warning and return 197 198 void LocateGlobalPointWithinVolumeCheckAnd 199 co 200 201 // As above, but report information abou 202 // If CheckMode > 1, report extra inform 203 204 protected: // without description 205 206 // Auxiliary methods -- to report issues 207 208 void ReportReversedPoints( std::ostringstr 209 const G4FieldTr 210 const G4FieldTr 211 G4double 212 const G4FieldTr 213 const G4FieldTr 214 const G4FieldTr 215 const G4ThreeVe 216 const G4FieldTr 217 G4int sbstp_no, 218 // Build error messsage (in ossMsg) to r 219 // gone past 'A' 220 221 void ReportProgress( std::ostream& oss, 222 const G4FieldTrack& S 223 const G4FieldTrack& E 224 G4int s 225 const G4FieldTrack& A 226 const G4FieldTrack& B 227 G4double s 228 G4int d 229 // Report the current status / progress 230 231 void ReportImmediateHit( const char* 232 const G4ThreeVec 233 const G4ThreeVec 234 G4double 235 unsigned long 236 // Report case: trial point is 'close' t 237 238 private: // no description 239 240 G4ThreeVector GetLocalSurfaceNormal(const 241 242 // Return the SurfaceNormal of Intersect 243 244 G4ThreeVector GetLastSurfaceNormal( const 245 246 // Position *must* be the intersection p 247 // to G4Navigator's ComputeStep (via In 248 // Temporary - will use the same method 249 250 protected: 251 252 G4double kCarTolerance; / 253 254 G4int fVerboseLevel = 0; / 255 G4bool fUseNormalCorrection = false; / 256 G4bool fCheckMode = false; 257 G4bool fiUseSafety = false; // Whethe 258 259 G4Navigator* fiNavigator; 260 261 G4ChordFinder* fiChordFinder = nullptr; / 262 G4double fiEpsilonStep = -1.0; / 263 G4double fiDeltaIntersection = -1.0; / 264 // Parameters set at each physical step 265 // by G4PropagatorInField 266 267 G4Navigator *fHelpingNavigator; 268 // Helper for location 269 270 G4TouchableHistory *fpTouchable = nullptr; 271 // Touchable history hook 272 }; 273 274 #include "G4VIntersectionLocator.icc" 275 276 #endif 277