49 #define G4MT_phphix ((subInstanceManager.offset[instanceID]).fPhix)
50 #define G4MT_phphiy ((subInstanceManager.offset[instanceID]).fPhiy)
51 #define G4MT_phphiz ((subInstanceManager.offset[instanceID]).fPhiz)
52 #define G4MT_phphik ((subInstanceManager.offset[instanceID]).fPhik)
86 r[0] = tail->
r;
z[0] = tail->
z;
87 r[1] = head->
r;
z[1] = head->
z;
124 b1(
r[1]*std::cos(phi),
r[1]*std::sin(phi),
z[1] ),
125 c1( prevRZ->
r*std::cos(phi), prevRZ->
r*std::sin(phi), prevRZ->
z ),
126 d1( nextRZ->
r*std::cos(phi), nextRZ->
r*std::sin(phi), nextRZ->
z ),
139 c2 =
G4ThreeVector( prevRZ->
r*std::cos(phi), prevRZ->
r*std::sin(phi), prevRZ->
z );
140 d2 =
G4ThreeVector( nextRZ->
r*std::cos(phi), nextRZ->
r*std::sin(phi), nextRZ->
z );
149 vec->
center = 0.25*( a1 + a2 + b1 + b2 );
151 tt = b2 + b1 - a2 - a1;
155 tt = b2 - b1 + a2 - a1;
184 adj = 0.5*(
c1+c2-a1-a2);
185 adj = adj.
cross(a12);
190 adj = 0.5*(
d1+d2-b1-b2);
191 adj = adj.
cross(a12);
200 vec->
edges[0] = edge;
204 vec->
edges[1] = edge;
232 edge = vec->
edges[0];
252 }
while( prev=vec, ++vec <
vecs + numSide );
270 if (normvec.
dot(vec->
surfPhi) > 0) normvec = -normvec;
282 vec =
vecs + numSide - 1;
286 if (normvec.
dot(vec->
surfPhi) < 0) normvec = -normvec;
308 : startPhi(0.), deltaPhi(0.), endPhi(0.),
342 if (
this == &source)
return *
this;
388 *sourceEdge = source.
edges;
392 }
while( ++sourceEdge, ++edge <
edges + numEdges);
400 *sourceVec = source.
vecs;
458 G4double normSign = outgoing ? +1 : -1;
498 if (dotProd <= 0)
continue;
504 distFromSurface = -normSign*delta.
dot(vec->
normal);
506 if (distFromSurface < -surfTolerance)
continue;
520 if (normSign*qc.
cross(qd).
dot(v) < 0)
continue;
525 if (normSign*qa.
cross(qb).
dot(v) > 0)
continue;
540 if (distFromSurface < 0)
545 if (std::fabs(rz) >
lenRZ+surfTolerance)
return false;
548 if (std::fabs(pp) >
lenPhi[0]+
lenPhi[1]*rz+surfTolerance)
return false;
555 distance = distFromSurface/dotProd;
559 }
while( ++vec, ++face <
numSide );
571 G4double normSign = outgoing ? -1 : +1;
619 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 );
789 if (dotProd <= 0)
return false;
796 distFromSurface = -normSign*delta.
dot(vec.
normal);
798 if (distFromSurface < -surfTolerance)
return false;
804 distance = distFromSurface/dotProd;
826 if (
r[0]==0)
return true;
828 if (atRZ < -
lenRZ*1.2)
return false;
834 if (normSign*qacb.
dot(v) < 0)
return false;
836 if (distFromSurface < 0)
838 if (atRZ < -
lenRZ-surfTolerance)
return false;
843 if (
r[1]==0)
return true;
845 if (atRZ >
lenRZ*1.2)
return false;
851 if (normSign*qacb.
dot(v) >= 0)
return false;
853 if (distFromSurface < 0)
855 if (atRZ >
lenRZ+surfTolerance)
return false;
883 *i1 =
PhiSegment( std::atan2( p.
y() + s1*v.
y(), p.
x() + s1*v.
x() ) );
886 return (*i1 < 0) ? 0 : 1;
892 *i2 =
PhiSegment( std::atan2( p.
y() + s2*v.
y(), p.
x() + s2*v.
x() ) );
893 if (*i1 == *i2)
return 0;
897 if (*i2 < 0)
return 0;
902 if (*i2 < 0)
return 1;
915 if (iPhi >= 0)
return iPhi;
931 return (d2 < d1) ? 0 :
numSide-1;
1056 if (pcDotRZ < -
lenRZ)
1063 if (pcDotPhi < -lenPhiZ)
1068 G4double distOutPhi = pcDotPhi+lenPhiZ;
1069 distOut2 = distOutPhi*distOutPhi + distOutZ*distOutZ;
1073 else if (pcDotPhi > lenPhiZ)
1078 G4double distOutPhi = pcDotPhi-lenPhiZ;
1079 distOut2 = distOutPhi*distOutPhi + distOutZ*distOutZ;
1089 distOut2 = distOutZ*distOutZ;
1093 else if (pcDotRZ >
lenRZ)
1100 if (pcDotPhi < -lenPhiZ)
1105 G4double distOutPhi = pcDotPhi+lenPhiZ;
1106 distOut2 = distOutPhi*distOutPhi + distOutZ*distOutZ;
1110 else if (pcDotPhi > lenPhiZ)
1115 G4double distOutPhi = pcDotPhi-lenPhiZ;
1116 distOut2 = distOutPhi*distOutPhi + distOutZ*distOutZ;
1125 distOut2 = distOutZ*distOutZ;
1136 if (pcDotPhi < -lenPhiZ)
1142 distOut2 = distOut*distOut;
1146 else if (pcDotPhi > lenPhiZ)
1152 distOut2 = distOut*distOut;
1161 return std::fabs(distFaceNorm);
1164 return std::sqrt( distFaceNorm*distFaceNorm + distOut2 );
1182 *p4=p2 + lambda1*w + lambda2*
v;
1183 return 0.5*(v.cross(w)).mag();
1202 if( (chose>=0.) && (chose < aOne) )
1248 std::vector<G4double>areas;
1249 std::vector<G4ThreeVector>points;
1267 points.push_back(point1);
1268 areas.push_back(result1);
1280 if(chose>=Achose1 && chose<Achose2)
1282 point1=points[i] ;
break;
1284 ++i; Achose1=Achose2;