Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // >> 26 // >> 27 // $Id: G4VTwistSurface.hh,v 1.5 2006/06/29 18:48:17 gunter Exp $ >> 28 // GEANT4 tag $Name: geant4-08-03-patch-02 $ >> 29 // >> 30 // >> 31 // -------------------------------------------------------------------- >> 32 // GEANT 4 class header file >> 33 // >> 34 // 26 // G4VTwistSurface 35 // G4VTwistSurface 27 // 36 // 28 // Class description: 37 // Class description: 29 // 38 // 30 // Abstract base class for boundary surface of << 39 // Abstract base class for boundary surface of G4VSolid. 31 40 32 // 01-Aug-2002 - Kotoyo Hoshina (hoshina@hepbu << 41 // Author: 33 // 13-Nov-2003 - O.Link (Oliver.Link@cern.ch), << 42 // 01-Aug-2002 - Kotoyo Hoshina (hoshina@hepburn.s.chiba-u.ac.jp) 34 // from original version in Jupi << 43 // >> 44 // History: >> 45 // 13-Nov-2003 - O.Link (Oliver.Link@cern.ch), Integration in Geant4 >> 46 // from original version in Jupiter-2.5.02 application. 35 // ------------------------------------------- 47 // -------------------------------------------------------------------- 36 #ifndef G4VTWISTSURFACE_HH << 48 #ifndef __G4VTWISTSURFACE__ 37 #define G4VTWISTSURFACE_HH << 49 #define __G4VTWISTSURFACE__ 38 << 39 #include <CLHEP/Units/SystemOfUnits.h> << 40 50 41 #include "G4VSolid.hh" 51 #include "G4VSolid.hh" 42 #include "geomdefs.hh" 52 #include "geomdefs.hh" 43 53 44 #include "G4RotationMatrix.hh" 54 #include "G4RotationMatrix.hh" 45 55 46 #define G4VSURFACENXX 10 56 #define G4VSURFACENXX 10 47 57 48 class G4VTwistSurface 58 class G4VTwistSurface 49 { 59 { 50 public: << 60 public: // without description >> 61 >> 62 enum EValidate {kDontValidate = 0, kValidateWithTol = 1, >> 63 kValidateWithoutTol = 2, kUninitialized = 3}; 51 64 52 enum EValidate { kDontValidate = 0, kValida << 65 public: // with description 53 kValidateWithoutTol = 2, k << 54 66 55 G4VTwistSurface (const G4String& name); << 67 G4VTwistSurface (const G4String &name); 56 G4VTwistSurface (const G4String& name, << 68 G4VTwistSurface (const G4String &name, 57 const G4RotationMatrix& ro << 69 const G4RotationMatrix &rot, 58 const G4ThreeVector& tl << 70 const G4ThreeVector &tlate, 59 G4int ha << 71 G4int handedness, 60 const EAxis ax << 72 const EAxis axis1, 61 const EAxis ax << 73 const EAxis axis2, 62 G4double ax << 74 G4double axis0min = -kInfinity, 63 G4double ax << 75 G4double axis1min = -kInfinity, 64 G4double ax << 76 G4double axis0max = kInfinity, 65 G4double ax << 77 G4double axis1max = kInfinity); 66 78 67 virtual ~G4VTwistSurface() = default; << 79 virtual ~G4VTwistSurface(); 68 80 69 virtual G4int AmIOnLeftSide(const G4Thr << 81 virtual G4int AmIOnLeftSide(const G4ThreeVector &me, 70 const G4Thr << 82 const G4ThreeVector &vec, 71 G4boo 83 G4bool withTol = true); 72 84 73 virtual G4double DistanceToBoundary( 85 virtual G4double DistanceToBoundary( G4int areacode, 74 << 86 G4ThreeVector &xx, 75 const << 87 const G4ThreeVector &p) ; 76 88 77 virtual G4double DistanceToIn(const G4Thre << 89 78 const G4Thre << 90 virtual G4double DistanceToIn(const G4ThreeVector &gp, 79 G4Thre << 91 const G4ThreeVector &gv, 80 virtual G4double DistanceToOut(const G4Thr << 92 G4ThreeVector &gxxbest); 81 const G4Thr << 93 virtual G4double DistanceToOut(const G4ThreeVector &gp, 82 G4Thr << 94 const G4ThreeVector &gv, 83 virtual G4double DistanceTo(const G4ThreeV << 95 G4ThreeVector &gxxbest); 84 G4ThreeV << 96 virtual G4double DistanceTo(const G4ThreeVector &gp, >> 97 G4ThreeVector &gxx); 85 98 86 virtual G4int DistanceToSurface(const G << 99 virtual G4int DistanceToSurface(const G4ThreeVector &gp, 87 const G << 100 const G4ThreeVector &gv, 88 G 101 G4ThreeVector gxx[], 89 G 102 G4double distance[], 90 G 103 G4int areacode[], 91 G 104 G4bool isvalid[], 92 EValida 105 EValidate validate=kValidateWithTol) = 0; 93 106 94 virtual G4int DistanceToSurface(const G << 107 virtual G4int DistanceToSurface(const G4ThreeVector &gp, 95 G 108 G4ThreeVector gxx[], 96 G 109 G4double distance[], 97 G 110 G4int areacode[]) = 0; 98 111 99 void DebugPrint() const; 112 void DebugPrint() const; 100 113 101 virtual G4ThreeVector GetNormal(const G4Thr << 114 // get methods >> 115 >> 116 virtual G4ThreeVector GetNormal(const G4ThreeVector &xx,G4bool isGlobal) = 0; 102 117 103 virtual G4String GetName() const { ret 118 virtual G4String GetName() const { return fName; } 104 virtual void GetBoundaryParameters << 119 virtual void GetBoundaryParameters(const G4int &areacode, 105 << 120 G4ThreeVector &d, 106 << 121 G4ThreeVector &x0, 107 << 122 G4int &boundarytype) const; 108 virtual G4ThreeVector GetBoundaryAtPZ(G4int 123 virtual G4ThreeVector GetBoundaryAtPZ(G4int areacode, 109 const << 124 const G4ThreeVector &p) const; 110 125 111 inline G4double DistanceToPlaneWithV(const << 126 inline G4double DistanceToPlaneWithV(const G4ThreeVector &p, 112 const << 127 const G4ThreeVector &v, 113 const << 128 const G4ThreeVector &x0, 114 const << 129 const G4ThreeVector &n0, 115 << 130 G4ThreeVector &xx); 116 << 131 117 inline G4double DistanceToPlane(const G4Th << 132 inline G4double DistanceToPlane(const G4ThreeVector &p, 118 const G4Th << 133 const G4ThreeVector &x0, 119 const G4Th << 134 const G4ThreeVector &n0, 120 G4Th << 135 G4ThreeVector &xx); 121 136 122 inline G4double DistanceToPlane(const G4Th << 137 inline G4double DistanceToPlane(const G4ThreeVector &p, 123 const G4Th << 138 const G4ThreeVector &x0, 124 const G4Th << 139 const G4ThreeVector &t1, 125 const G4Th << 140 const G4ThreeVector &t2, 126 G4Th << 141 G4ThreeVector &xx, 127 G4Th << 142 G4ThreeVector &n); 128 << 143 129 inline G4double DistanceToLine (const G4Th << 144 inline G4double DistanceToLine (const G4ThreeVector &p, 130 const G4Th << 145 const G4ThreeVector &x0, 131 const G4Th << 146 const G4ThreeVector &d, 132 G4Th << 147 G4ThreeVector &xx); 133 << 148 134 inline G4bool IsAxis0 (G4int areacode) c << 149 inline G4bool IsAxis0 (G4int areacode) const; 135 inline G4bool IsAxis1 (G4int areacode) c << 150 inline G4bool IsAxis1 (G4int areacode) const; 136 inline G4bool IsOutside (G4int areacode) c << 151 inline G4bool IsOutside (G4int areacode) const; 137 inline G4bool IsInside (G4int areacode, G << 152 inline G4bool IsInside (G4int areacode, G4bool testbitmode = false) const; 138 inline G4bool IsBoundary (G4int areacode, G << 153 inline G4bool IsBoundary (G4int areacode, G4bool testbitmode = false) const; 139 inline G4bool IsCorner (G4int areacode, G << 154 inline G4bool IsCorner (G4int areacode, G4bool testbitmode = false) const; 140 inline G4bool IsValidNorm() const { return << 155 inline G4bool IsValidNorm() const { return fIsValidNorm; } 141 G4bool IsSameBoundary (G4VTwistSurface* sur << 156 G4bool IsSameBoundary (G4VTwistSurface *surface1, G4int areacode1, 142 G4VTwistSurface* sur << 157 G4VTwistSurface *surface2, G4int areacode2 ) const; 143 inline G4int GetAxisType(G4int areacode, G << 158 inline G4int GetAxisType(G4int areacode, G4int whichaxis) const; 144 << 159 145 inline G4ThreeVector ComputeGlobalPoint << 160 inline G4ThreeVector ComputeGlobalPoint (const G4ThreeVector &lp) const; 146 inline G4ThreeVector ComputeLocalPoint << 161 inline G4ThreeVector ComputeLocalPoint (const G4ThreeVector &gp) const; 147 inline G4ThreeVector ComputeGlobalDirection << 162 inline G4ThreeVector ComputeGlobalDirection (const G4ThreeVector &lp) const; 148 inline G4ThreeVector ComputeLocalDirection << 163 inline G4ThreeVector ComputeLocalDirection (const G4ThreeVector &gp) const; 149 164 150 // set methods 165 // set methods 151 166 152 inline void SetAxis(G4int i, const EAxis ax 167 inline void SetAxis(G4int i, const EAxis axis) { fAxis[i] = axis; } 153 inline void SetNeighbours(G4VTwistSurface* << 168 inline void SetNeighbours(G4VTwistSurface* axis0min, G4VTwistSurface* axis1min, 154 G4VTwistSurface* << 169 G4VTwistSurface* axis0max, G4VTwistSurface* axis1max); 155 170 156 virtual G4ThreeVector SurfacePoint(G4double << 171 virtual G4ThreeVector SurfacePoint(G4double , G4double, 157 G4bool i 172 G4bool isGlobal = false ) = 0 ; 158 virtual G4double GetBoundaryMin(G4double) = 173 virtual G4double GetBoundaryMin(G4double) = 0 ; 159 virtual G4double GetBoundaryMax(G4double) = 174 virtual G4double GetBoundaryMax(G4double) = 0 ; 160 virtual G4double GetSurfaceArea() = 0 ; 175 virtual G4double GetSurfaceArea() = 0 ; 161 virtual void GetFacets(G4int m, G4int n, G4 176 virtual void GetFacets(G4int m, G4int n, G4double xyz[][3], 162 G4int faces[][4], G4 177 G4int faces[][4], G4int iside) = 0 ; 163 G4int GetNode( G4int i, G4int j, G4int m, G << 178 G4int GetNode( G4int i, G4int j, G4int m, G4int n, G4int iside ) ; 164 G4int GetFace( G4int i, G4int j, G4int m, G << 179 G4int GetFace( G4int i, G4int j, G4int m, G4int n, G4int iside ) ; 165 G4int GetEdgeVisibility( G4int i, G4int j, << 180 G4int GetEdgeVisibility( G4int i, G4int j, G4int m, G4int n, G4int number, G4int orientation) ; 166 G4int number, G4in << 181 >> 182 >> 183 public: // without description 167 184 168 G4VTwistSurface(__void__&); 185 G4VTwistSurface(__void__&); 169 // Fake default constructor for usage res 186 // Fake default constructor for usage restricted to direct object 170 // persistency for clients requiring prea 187 // persistency for clients requiring preallocation of memory for 171 // persistifiable objects. 188 // persistifiable objects. 172 189 173 protected: << 190 protected: // with description 174 191 175 inline G4VTwistSurface** GetNeighbours() { << 192 // get methods 176 inline G4int GetNeighbours(G4int areacode, << 193 177 inline G4ThreeVector GetCorner(G4int areaco << 194 inline G4VTwistSurface** GetNeighbours() { return fNeighbours; } 178 void GetBoundaryAxis(G4int areacode, EAxis << 195 inline G4int GetNeighbours(G4int areacode, G4VTwistSurface* surfaces[]); 179 void GetBoundaryLimit(G4int areacode, G4dou << 196 inline G4ThreeVector GetCorner(G4int areacode) const; 180 virtual G4int GetAreaCode(const G4ThreeVect << 197 void GetBoundaryAxis(G4int areacode, EAxis axis[]) const; 181 << 198 void GetBoundaryLimit(G4int areacode, G4double limit[]) const; 182 virtual void SetBoundary(const G4int& << 199 virtual G4int GetAreaCode(const G4ThreeVector &xx, G4bool withtol=true) = 0; 183 const G4ThreeVecto << 200 184 const G4ThreeVecto << 201 // set methods 185 const G4int& << 202 >> 203 virtual void SetBoundary(const G4int &axiscode, >> 204 const G4ThreeVector &direction, >> 205 const G4ThreeVector &x0, >> 206 const G4int &boundarytype); 186 // areacode must be one of them: 207 // areacode must be one of them: 187 // sAxis0 & sAxisMin, sAxis0 & sAxisMax, 208 // sAxis0 & sAxisMin, sAxis0 & sAxisMax, 188 // sAxis1 & sAxisMin, sAxis1 & sAxisMax. 209 // sAxis1 & sAxisMin, sAxis1 & sAxisMax. 189 // boundarytype represents the shape of l 210 // boundarytype represents the shape of locus 190 // from the start point to end point of b 211 // from the start point to end point of boundary. 191 // ex. 212 // ex. 192 // sAxisRho = linear line which start poi 213 // sAxisRho = linear line which start point is fixed at origin. 193 // sAxisPhi = part of circle which center 214 // sAxisPhi = part of circle which center placed at the origin. 194 215 195 void SetCorner(G4int areacode, G4double x, 216 void SetCorner(G4int areacode, G4double x, G4double y, G4double z); 196 217 197 private: 218 private: 198 219 199 virtual void SetBoundaries() = 0; 220 virtual void SetBoundaries() = 0; 200 virtual void SetCorners() = 0; 221 virtual void SetCorners() = 0; 201 222 202 // data members ----------------------------- 223 // data members --------------------------------------------------------- 203 224 204 public: 225 public: 205 226 206 static const G4int sOutside ; 227 static const G4int sOutside ; 207 static const G4int sInside ; 228 static const G4int sInside ; 208 static const G4int sBoundary; 229 static const G4int sBoundary; 209 static const G4int sCorner; 230 static const G4int sCorner; 210 static const G4int sC0Min1Min; 231 static const G4int sC0Min1Min; 211 static const G4int sC0Max1Min; 232 static const G4int sC0Max1Min; 212 static const G4int sC0Max1Max; 233 static const G4int sC0Max1Max; 213 static const G4int sC0Min1Max; 234 static const G4int sC0Min1Max; 214 static const G4int sAxisMin; 235 static const G4int sAxisMin; 215 static const G4int sAxisMax; 236 static const G4int sAxisMax; 216 static const G4int sAxisX; 237 static const G4int sAxisX; 217 static const G4int sAxisY; 238 static const G4int sAxisY; 218 static const G4int sAxisZ; 239 static const G4int sAxisZ; 219 static const G4int sAxisRho; 240 static const G4int sAxisRho; 220 static const G4int sAxisPhi; 241 static const G4int sAxisPhi; 221 static const G4int sAxis0; 242 static const G4int sAxis0; 222 static const G4int sAxis1; 243 static const G4int sAxis1; 223 static const G4int sSizeMask; 244 static const G4int sSizeMask; 224 static const G4int sAxisMask; 245 static const G4int sAxisMask; 225 static const G4int sAreaMask; 246 static const G4int sAreaMask; 226 247 227 protected: 248 protected: 228 249 229 class CurrentStatus 250 class CurrentStatus 230 { 251 { 231 public: << 252 public: 232 253 233 CurrentStatus(); 254 CurrentStatus(); 234 virtual ~CurrentStatus(); 255 virtual ~CurrentStatus(); 235 256 236 inline G4ThreeVector GetXX(G4int i) 257 inline G4ThreeVector GetXX(G4int i) const { return fXX[i]; } 237 inline G4double GetDistance(G4int i 258 inline G4double GetDistance(G4int i) const { return fDistance[i]; } 238 inline G4int GetAreacode(G4int i 259 inline G4int GetAreacode(G4int i) const { return fAreacode[i]; } 239 inline G4int GetNXX() 260 inline G4int GetNXX() const { return fNXX; } 240 inline G4bool IsDone() 261 inline G4bool IsDone() const { return fDone; } 241 inline G4bool IsValid(G4int i) 262 inline G4bool IsValid(G4int i) const { return fIsValid[i]; } 242 263 243 void SetCurrentStatus(G4int 264 void SetCurrentStatus(G4int i, 244 G4ThreeVector& << 265 G4ThreeVector &xx, 245 G4double& << 266 G4double &dist, 246 G4int& << 267 G4int &areacode, 247 G4bool& << 268 G4bool &isvalid, 248 G4int 269 G4int nxx, 249 EValidate 270 EValidate validate, 250 const G4ThreeVector* p, << 271 const G4ThreeVector *p, 251 const G4ThreeVector* v = << 272 const G4ThreeVector *v = 0); 252 273 253 void ResetfDone(EValidate validate, << 274 void ResetfDone(EValidate validate, 254 const G4ThreeVector* p, << 275 const G4ThreeVector *p, 255 const G4ThreeVector* v = nullp << 276 const G4ThreeVector *v = 0); 256 277 257 278 258 void DebugPrint() const; 279 void DebugPrint() const; 259 280 260 private: << 281 private: 261 282 262 G4double fDistance[G4VSURFAC 283 G4double fDistance[G4VSURFACENXX]; 263 G4ThreeVector fXX[G4VSURFACENXX]; 284 G4ThreeVector fXX[G4VSURFACENXX]; 264 G4int fAreacode[G4VSURFAC 285 G4int fAreacode[G4VSURFACENXX]; 265 G4bool fIsValid[G4VSURFACE 286 G4bool fIsValid[G4VSURFACENXX]; 266 G4int fNXX; 287 G4int fNXX; 267 G4ThreeVector fLastp; 288 G4ThreeVector fLastp; 268 G4ThreeVector fLastv; 289 G4ThreeVector fLastv; 269 EValidate fLastValidate; 290 EValidate fLastValidate; 270 G4bool fDone; 291 G4bool fDone; 271 }; 292 }; 272 293 273 class Boundary 294 class Boundary 274 { 295 { 275 public: << 296 public: 276 << 297 Boundary(); 277 Boundary() = default; << 298 virtual ~Boundary(); 278 virtual ~Boundary() = default; << 279 299 280 void SetFields(const G4int& areac << 300 void SetFields(const G4int &areacode, 281 const G4ThreeVector& d, << 301 const G4ThreeVector &d, 282 const G4ThreeVector& x0, << 302 const G4ThreeVector &x0, 283 const G4int& boun << 303 const G4int &boundarytype); 284 304 285 G4bool IsEmpty() const; 305 G4bool IsEmpty() const; 286 306 287 G4bool GetBoundaryParameters(const G4int << 307 G4bool GetBoundaryParameters(const G4int &areacode, 288 G4Thr << 308 G4ThreeVector &d, 289 G4Thr << 309 G4ThreeVector &x0, 290 G4int << 310 G4int &boundarytype) const; 291 311 292 private: << 312 private: 293 << 313 G4int fBoundaryAcode; 294 G4int fBoundaryAcode{-1}; << 295 G4ThreeVector fBoundaryDirection; 314 G4ThreeVector fBoundaryDirection; 296 G4ThreeVector fBoundaryX0; 315 G4ThreeVector fBoundaryX0; 297 G4int fBoundaryType{0}; << 316 G4int fBoundaryType; 298 }; 317 }; 299 318 300 EAxis fAxis[2]; 319 EAxis fAxis[2]; 301 G4double fAxisMin[2]; 320 G4double fAxisMin[2]; 302 G4double fAxisMax[2]; 321 G4double fAxisMax[2]; 303 CurrentStatus fCurStatWithV; 322 CurrentStatus fCurStatWithV; 304 CurrentStatus fCurStat; 323 CurrentStatus fCurStat; 305 G4RotationMatrix fRot; 324 G4RotationMatrix fRot; 306 G4ThreeVector fTrans; 325 G4ThreeVector fTrans; 307 G4int fHandedness; 326 G4int fHandedness; 308 class G4SurfCurNormal 327 class G4SurfCurNormal 309 { 328 { 310 public: 329 public: 311 << 312 G4ThreeVector p; 330 G4ThreeVector p; 313 G4ThreeVector normal; 331 G4ThreeVector normal; 314 }; 332 }; 315 G4SurfCurNormal fCurrentNormal; 333 G4SurfCurNormal fCurrentNormal; 316 G4bool fIsValidNorm; 334 G4bool fIsValidNorm; 317 G4double kCarTolerance; << 318 335 319 private: 336 private: 320 337 321 G4VTwistSurface* fNeighbours[4]; // {0,1,2, << 338 G4VTwistSurface *fNeighbours[4]; // {0,1,2,3} = sAxis0min, sAxis1min, 322 // << 339 // sAxis0max, sAxis1max 323 G4ThreeVector fCorners[4]; // corners o 340 G4ThreeVector fCorners[4]; // corners of the surface in local coordinate 324 Boundary fBoundaries[4]; // boundarie 341 Boundary fBoundaries[4]; // boundaries of the surface. 325 G4String fName; 342 G4String fName; 326 343 327 class G4SurfSideQuery 344 class G4SurfSideQuery 328 { 345 { 329 public: 346 public: 330 << 331 G4ThreeVector me; 347 G4ThreeVector me; 332 G4ThreeVector vec; 348 G4ThreeVector vec; 333 G4bool withTol; 349 G4bool withTol; 334 G4int amIOnLeftSide; 350 G4int amIOnLeftSide; 335 }; 351 }; 336 G4SurfSideQuery fAmIOnLeftSide; 352 G4SurfSideQuery fAmIOnLeftSide; 337 }; 353 }; 338 354 339 //============================================ 355 //======================================================== 340 // inline functions 356 // inline functions 341 //============================================ 357 //======================================================== 342 358 343 struct Intersection 359 struct Intersection 344 { 360 { 345 G4double phi ; // parameter phi 361 G4double phi ; // parameter phi 346 G4double u ; // parameter u 362 G4double u ; // parameter u 347 G4ThreeVector xx ; // intersection point i 363 G4ThreeVector xx ; // intersection point in cartesian 348 G4double distance ; // distance to intersec 364 G4double distance ; // distance to intersection 349 G4int areacode ; // the areacode of the << 365 G4int areacode; // the areacode of the intersection 350 G4bool isvalid ; // valid intersection ? 366 G4bool isvalid ; // valid intersection ?? 351 367 352 }; 368 }; 353 369 354 inline 370 inline 355 G4bool DistanceSort( const Intersection& a, co << 371 G4bool DistanceSort( const Intersection &a, const Intersection &b) 356 { 372 { 357 return a.distance < b.distance ; 373 return a.distance < b.distance ; 358 } 374 } 359 375 360 inline 376 inline 361 G4bool EqualIntersection( const Intersection& << 377 G4bool EqualIntersection( const Intersection &a, const Intersection &b) 362 { 378 { 363 return ( ( a.xx - b.xx ).mag() < 1E-9*CLHEP: << 379 return ( ( a.xx - b.xx ).mag() < kCarTolerance ) ; 364 } 380 } 365 381 366 #include "G4VTwistSurface.icc" 382 #include "G4VTwistSurface.icc" 367 383 368 #endif 384 #endif 369 385