74 r[0] = tail->
r;
z[0] = tail->
z;
75 r[1] = head->
r;
z[1] = head->
z;
111 b1(
r[1]*std::cos(phi),
r[1]*std::sin(phi),
z[1] ),
112 c1( prevRZ->
r*std::cos(phi), prevRZ->
r*std::sin(phi), prevRZ->
z ),
113 d1( nextRZ->
r*std::cos(phi), nextRZ->
r*std::sin(phi), nextRZ->
z ),
126 c2 =
G4ThreeVector( prevRZ->
r*std::cos(phi), prevRZ->
r*std::sin(phi), prevRZ->
z );
127 d2 =
G4ThreeVector( nextRZ->
r*std::cos(phi), nextRZ->
r*std::sin(phi), nextRZ->
z );
136 vec->
center = 0.25*( a1 + a2 + b1 + b2 );
138 tt = b2 + b1 - a2 - a1;
142 tt = b2 - b1 + a2 - a1;
171 adj = 0.5*(
c1+c2-a1-a2);
172 adj = adj.
cross(a12);
177 adj = 0.5*(d1+d2-b1-b2);
178 adj = adj.
cross(a12);
187 vec->
edges[0] = edge;
191 vec->
edges[1] = edge;
219 edge = vec->
edges[0];
239 }
while( prev=vec, ++vec <
vecs + numSide );
257 if (normvec.
dot(vec->
surfPhi) > 0) normvec = -normvec;
269 vec =
vecs + numSide - 1;
273 if (normvec.
dot(vec->
surfPhi) < 0) normvec = -normvec;
297 : numSide(0), startPhi(0.), deltaPhi(0.), endPhi(0.),
298 phiIsOpen(false), allBehind(false), cone(0), vecs(0), edges(0),
299 lenRZ(0.), edgeNorm(0.), kCarTolerance(0.), fSurfaceArea(0.)
333 if (
this == &source)
return *
this;
369 kCarTolerance = source.kCarTolerance;
370 fSurfaceArea = source.fSurfaceArea;
381 *sourceEdge = source.
edges;
385 }
while( ++sourceEdge, ++edge <
edges + numEdges);
393 *sourceVec = source.
vecs;
453 G4double normSign = outgoing ? +1 : -1;
493 if (dotProd <= 0)
continue;
499 distFromSurface = -normSign*delta.
dot(vec->
normal);
501 if (distFromSurface < -surfTolerance)
continue;
515 if (normSign*qc.
cross(qd).
dot(v) < 0)
continue;
520 if (normSign*qa.
cross(qb).
dot(v) > 0)
continue;
527 if (
r[0] > 1/kInfinity && normSign*qa.
cross(qc).
dot(v) < 0)
return false;
528 if (
r[1] > 1/kInfinity && normSign*qb.
cross(qd).
dot(v) > 0)
return false;
535 if (distFromSurface < 0)
540 if (std::fabs(rz) >
lenRZ+surfTolerance)
return false;
543 if (std::fabs(pp) >
lenPhi[0] +
lenPhi[1]*rz + surfTolerance)
return false;
550 distance = distFromSurface/dotProd;
554 }
while( ++vec, ++face <
numSide );
565 G4double normSign = outgoing ? -1 : +1;
575 if (normSign*normDist > -0.5*kCarTolerance)
615 if ( (std::fabs(norm) < tolerance) && (*bestDistance < 2.0*tolerance) )
680 i1 = iPhi; i2 = iPhi;
696 if (answer > best) best = answer;
697 }
while( ++vec < list+4 );
793 if (dotProd <= 0)
return false;
800 distFromSurface = -normSign*delta.
dot(vec.
normal);
802 if (distFromSurface < -surfTolerance)
return false;
808 distance = distFromSurface/dotProd;
830 if (
r[0]==0)
return true;
832 if (atRZ < -
lenRZ*1.2)
return false;
838 if (normSign*qacb.
dot(v) < 0)
return false;
840 if (distFromSurface < 0)
842 if (atRZ < -
lenRZ-surfTolerance)
return false;
847 if (
r[1]==0)
return true;
849 if (atRZ >
lenRZ*1.2)
return false;
855 if (normSign*qacb.
dot(v) >= 0)
return false;
857 if (distFromSurface < 0)
859 if (atRZ >
lenRZ+surfTolerance)
return false;
889 *i1 =
PhiSegment( std::atan2( p.
y() + s1*v.
y(), p.
x() + s1*v.
x() ) );
892 return (*i1 < 0) ? 0 : 1;
898 *i2 =
PhiSegment( std::atan2( p.
y() + s2*v.
y(), p.
x() + s2*v.
x() ) );
899 if (*i1 == *i2)
return 0;
903 if (*i2 < 0)
return 0;
908 if (*i2 < 0)
return 1;
923 if (iPhi >= 0)
return iPhi;
937 return (d2 < d1) ? 0 :
numSide-1;
955 while( phi < 0 ) phi +=
twopi;
1067 if (pcDotRZ < -
lenRZ)
1074 if (pcDotPhi < -lenPhiZ)
1079 G4double distOutPhi = pcDotPhi+lenPhiZ;
1080 distOut2 = distOutPhi*distOutPhi + distOutZ*distOutZ;
1084 else if (pcDotPhi > lenPhiZ)
1089 G4double distOutPhi = pcDotPhi-lenPhiZ;
1090 distOut2 = distOutPhi*distOutPhi + distOutZ*distOutZ;
1100 distOut2 = distOutZ*distOutZ;
1104 else if (pcDotRZ >
lenRZ)
1111 if (pcDotPhi < -lenPhiZ)
1116 G4double distOutPhi = pcDotPhi+lenPhiZ;
1117 distOut2 = distOutPhi*distOutPhi + distOutZ*distOutZ;
1121 else if (pcDotPhi > lenPhiZ)
1126 G4double distOutPhi = pcDotPhi-lenPhiZ;
1127 distOut2 = distOutPhi*distOutPhi + distOutZ*distOutZ;
1136 distOut2 = distOutZ*distOutZ;
1147 if (pcDotPhi < -lenPhiZ)
1153 distOut2 = distOut*distOut;
1157 else if (pcDotPhi > lenPhiZ)
1163 distOut2 = distOut*distOut;
1172 return std::fabs(distFaceNorm);
1175 return std::sqrt( distFaceNorm*distFaceNorm + distOut2 );
1195 *p4=p2 + lambda1*w + lambda2*
v;
1196 return 0.5*(v.cross(w)).mag();
1217 if( (chose>=0.) && (chose < aOne) )
1230 if( fSurfaceArea==0. )
1256 return fSurfaceArea;
1267 std::vector<G4double>areas;
1268 std::vector<G4ThreeVector>points;
1286 points.push_back(point1);
1287 areas.push_back(result1);
1295 Achose1=0;Achose2=0.;
1300 if(chose>=Achose1 && chose<Achose2)
1302 point1=points[i] ;
break;
1304 i++; Achose1=Achose2;