37#if !defined(G4GEOM_USE_UTRAP)
70 fTthetaCphi = std::tan(pTheta)*std::cos(pPhi);
71 fTthetaSphi = std::tan(pTheta)*std::sin(pPhi);
73 fDy1 = pDy1; fDx1 = pDx1; fDx2 = pDx2; fTalpha1 = std::tan(pAlp1);
74 fDy2 = pDy2; fDx3 = pDx3; fDx4 = pDx4; fTalpha2 = std::tan(pAlp2);
94 || pt[0].z() != pt[1].z()
95 || pt[0].z() != pt[2].z()
96 || pt[0].z() != pt[3].z()
99 || pt[4].z() != pt[5].z()
100 || pt[4].z() != pt[6].z()
101 || pt[4].z() != pt[7].z()
105 || pt[0].y() != pt[1].y()
106 || pt[2].y() != pt[3].y()
107 || pt[4].y() != pt[5].y()
108 || pt[6].y() != pt[7].y()
110 || std::fabs(pt[0].y()+pt[2].y()+pt[4].y()+pt[6].y()) >=
kCarTolerance
111 || std::fabs(pt[0].x()+pt[1].x()+pt[4].x()+pt[5].x() +
114 std::ostringstream message;
115 message <<
"Invalid vertice coordinates for Solid: " <<
GetName();
124 fDy1 = ((pt[2]).y()-(pt[1]).y())*0.5;
125 fDx1 = ((pt[1]).x()-(pt[0]).x())*0.5;
126 fDx2 = ((pt[3]).x()-(pt[2]).x())*0.5;
127 fTalpha1 = ((pt[2]).x()+(pt[3]).x()-(pt[1]).x()-(pt[0]).x())*0.25/fDy1;
129 fDy2 = ((pt[6]).y()-(pt[5]).y())*0.5;
130 fDx3 = ((pt[5]).x()-(pt[4]).x())*0.5;
131 fDx4 = ((pt[7]).x()-(pt[6]).x())*0.5;
132 fTalpha2 = ((pt[6]).x()+(pt[7]).x()-(pt[5]).x()-(pt[4]).x())*0.25/fDy2;
134 fTthetaCphi = ((pt[4]).x()+fDy2*fTalpha2+fDx3)/fDz;
135 fTthetaSphi = ((pt[4]).y()+fDy2)/fDz;
151 fDz = 0.5*pZ; fTthetaCphi = 0; fTthetaSphi = 0;
152 fDy1 = 0.5*pY; fDx1 = 0.5*pX; fDx2 = 0.5*pLTX; fTalpha1 = 0.5*(pLTX - pX)/pY;
153 fDy2 = fDy1; fDx3 = fDx1; fDx4 = fDx2; fTalpha2 = fTalpha1;
169 fDz = pDz; fTthetaCphi = 0; fTthetaSphi = 0;
170 fDy1 = pDy1; fDx1 = pDx1; fDx2 = pDx1; fTalpha1 = 0;
171 fDy2 = pDy2; fDx3 = pDx2; fDx4 = pDx2; fTalpha2 = 0;
189 fTthetaCphi = std::tan(pTheta)*std::cos(pPhi);
190 fTthetaSphi = std::tan(pTheta)*std::sin(pPhi);
192 fDy1 = pDy; fDx1 = pDx; fDx2 = pDx; fTalpha1 = std::tan(pAlpha);
193 fDy2 = pDy; fDx3 = pDx; fDx4 = pDx; fTalpha2 = fTalpha1;
207 fDz(1.), fTthetaCphi(0.), fTthetaSphi(0.),
208 fDy1(1.), fDx1(1.), fDx2(1.), fTalpha1(0.),
209 fDy2(1.), fDx3(1.), fDx4(1.), fTalpha2(0.)
221 fDz(1.), fTthetaCphi(0.), fTthetaSphi(0.),
222 fDy1(1.), fDx1(1.), fDx2(1.), fTalpha1(0.),
223 fDy2(1.), fDx3(1.), fDx4(1.), fTalpha2(0.)
239 :
G4CSGSolid(rhs), halfCarTolerance(rhs.halfCarTolerance),
240 fDz(rhs.fDz), fTthetaCphi(rhs.fTthetaCphi), fTthetaSphi(rhs.fTthetaSphi),
241 fDy1(rhs.fDy1), fDx1(rhs.fDx1), fDx2(rhs.fDx2), fTalpha1(rhs.fTalpha1),
242 fDy2(rhs.fDy2), fDx3(rhs.fDx3), fDx4(rhs.fDx4), fTalpha2(rhs.fTalpha2)
244 for (
G4int i=0; i<4; ++i) { fPlanes[i] = rhs.fPlanes[i]; }
245 for (
G4int i=0; i<6; ++i) { fAreas[i] = rhs.fAreas[i]; }
246 fTrapType = rhs.fTrapType;
257 if (
this == &rhs) {
return *
this; }
265 halfCarTolerance = rhs.halfCarTolerance;
266 fDz = rhs.fDz; fTthetaCphi = rhs.fTthetaCphi; fTthetaSphi = rhs.fTthetaSphi;
267 fDy1 = rhs.fDy1; fDx1 = rhs.fDx1; fDx2 = rhs.fDx2; fTalpha1 = rhs.fTalpha1;
268 fDy2 = rhs.fDy2; fDx3 = rhs.fDx3; fDx4 = rhs.fDx4; fTalpha2 = rhs.fTalpha2;
269 for (
G4int i=0; i<4; ++i) { fPlanes[i] = rhs.fPlanes[i]; }
270 for (
G4int i=0; i<6; ++i) { fAreas[i] = rhs.fAreas[i]; }
271 fTrapType = rhs.fTrapType;
299 fTthetaCphi = std::tan(pTheta)*std::cos(pPhi);
300 fTthetaSphi = std::tan(pTheta)*std::sin(pPhi);
302 fDy1 = pDy1; fDx1 = pDx1; fDx2 = pDx2; fTalpha1 = std::tan(pAlp1);
303 fDy2 = pDy2; fDx3 = pDx3; fDx4 = pDx4; fTalpha2 = std::tan(pAlp2);
313void G4Trap::CheckParameters()
316 fDy1<=0 || fDx1<=0 || fDx2<=0 ||
317 fDy2<=0 || fDx3<=0 || fDx4<=0)
319 std::ostringstream message;
320 message <<
"Invalid Length Parameters for Solid: " <<
GetName()
321 <<
"\n X - " <<fDx1<<
", "<<fDx2<<
", "<<fDx3<<
", "<<fDx4
322 <<
"\n Y - " <<fDy1<<
", "<<fDy2
324 G4Exception(
"G4Trap::CheckParameters()",
"GeomSolids0002",
335 G4double DzTthetaCphi = fDz*fTthetaCphi;
336 G4double DzTthetaSphi = fDz*fTthetaSphi;
337 G4double Dy1Talpha1 = fDy1*fTalpha1;
338 G4double Dy2Talpha2 = fDy2*fTalpha2;
342 G4ThreeVector(-DzTthetaCphi-Dy1Talpha1-fDx1,-DzTthetaSphi-fDy1,-fDz),
343 G4ThreeVector(-DzTthetaCphi-Dy1Talpha1+fDx1,-DzTthetaSphi-fDy1,-fDz),
344 G4ThreeVector(-DzTthetaCphi+Dy1Talpha1-fDx2,-DzTthetaSphi+fDy1,-fDz),
345 G4ThreeVector(-DzTthetaCphi+Dy1Talpha1+fDx2,-DzTthetaSphi+fDy1,-fDz),
346 G4ThreeVector( DzTthetaCphi-Dy2Talpha2-fDx3, DzTthetaSphi-fDy2, fDz),
347 G4ThreeVector( DzTthetaCphi-Dy2Talpha2+fDx3, DzTthetaSphi-fDy2, fDz),
348 G4ThreeVector( DzTthetaCphi+Dy2Talpha2-fDx4, DzTthetaSphi+fDy2, fDz),
349 G4ThreeVector( DzTthetaCphi+Dy2Talpha2+fDx4, DzTthetaSphi+fDy2, fDz)
361 constexpr G4int iface[4][4] = { {0,4,5,1}, {2,3,7,6}, {0,2,6,4}, {1,5,7,3} };
362 const static G4String side[4] = {
"~-Y",
"~+Y",
"~-X",
"~+X" };
364 for (
G4int i=0; i<4; ++i)
370 fPlanes[i]))
continue;
373 G4ThreeVector normal(fPlanes[i].a,fPlanes[i].b,fPlanes[i].c);
375 for (
G4int k=0; k<4; ++k)
377 G4double dist = normal.
dot(pt[iface[i][k]]) + fPlanes[i].
d;
378 if (std::abs(dist) > std::abs(dmax)) dmax = dist;
380 std::ostringstream message;
381 message <<
"Side face " << side[i] <<
" is not planar for solid: "
382 <<
GetName() <<
"\nDiscrepancy: " << dmax/mm <<
" mm\n";
384 G4Exception(
"G4Trap::MakePlanes()",
"GeomSolids0002",
410 normal = normal.
unit();
413 plane.
a = normal.
x();
414 plane.
b = normal.
y();
415 plane.
c = normal.
z();
416 plane.
d = -normal.
dot(centre);
423 G4double dmax = std::max(std::max(std::max(d1,d2),d3),d4);
435 constexpr G4int iface[6][4] =
436 { {0,1,3,2}, {0,4,5,1}, {2,3,7,6}, {0,2,6,4}, {1,5,7,3}, {4,6,7,5} };
443 for (
G4int i=0; i<6; ++i)
448 pt[iface[i][3]]).
mag();
450 for (
G4int i=1; i<6; ++i) { fAreas[i] += fAreas[i - 1]; }
454 if (fPlanes[0].b == -1 && fPlanes[1].b == 1 &&
461 if (std::abs(fPlanes[2].a + fPlanes[3].a) <
DBL_EPSILON &&
462 std::abs(fPlanes[2].c - fPlanes[3].c) <
DBL_EPSILON &&
467 fPlanes[2].
a = -fPlanes[3].
a;
468 fPlanes[2].
c = fPlanes[3].
c;
470 if (std::abs(fPlanes[2].a + fPlanes[3].a) <
DBL_EPSILON &&
471 std::abs(fPlanes[2].b - fPlanes[3].b) <
DBL_EPSILON &&
476 fPlanes[2].
a = -fPlanes[3].
a;
477 fPlanes[2].
b = fPlanes[3].
b;
502 (dx4 + dx3 - dx2 - dx1)*(dy2 - dy1)/3)*dz*0.125;
517 { {0,1,3,2}, {0,4,5,1}, {2,3,7,6}, {0,2,6,4}, {1,5,7,3}, {4,6,7,5} };
520 for (
const auto & i : iface)
552 G4double xmin = kInfinity, xmax = -kInfinity;
553 G4double ymin = kInfinity, ymax = -kInfinity;
554 for (
const auto & i : pt)
557 if (x < xmin) xmin = x;
558 if (x > xmax) xmax = x;
560 if (y < ymin) ymin = y;
561 if (y > ymax) ymax = y;
565 pMin.
set(xmin,ymin,-dz);
566 pMax.
set(xmax,ymax, dz);
570 if (pMin.
x() >= pMax.
x() || pMin.
y() >= pMax.
y() || pMin.
z() >= pMax.
z())
572 std::ostringstream message;
573 message <<
"Bad bounding box (min >= max) for solid: "
575 <<
"\npMin = " << pMin
576 <<
"\npMax = " << pMax;
577 G4Exception(
"G4Trap::BoundingLimits()",
"GeomMgt0001",
604 return exist = pMin < pMax;
623 std::vector<const G4ThreeVectorList *> polygons(2);
624 polygons[0] = &baseA;
625 polygons[1] = &baseB;
643 G4double dy1 = fPlanes[0].
b*p.
y()+fPlanes[0].
c*p.
z()+fPlanes[0].
d;
644 G4double dy2 = fPlanes[1].
b*p.
y()+fPlanes[1].
c*p.
z()+fPlanes[1].
d;
645 G4double dy = std::max(dz,std::max(dy1,dy2));
648 + fPlanes[2].
c*p.
z()+fPlanes[2].
d;
650 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
651 G4double dist = std::max(dy,std::max(dx1,dx2));
653 return (dist > halfCarTolerance) ?
kOutside :
659 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
661 + fPlanes[2].
c*p.
z()+fPlanes[2].
d;
663 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
664 G4double dist = std::max(dy,std::max(dx1,dx2));
666 return (dist > halfCarTolerance) ?
kOutside :
672 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
674 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
677 return (dist > halfCarTolerance) ?
kOutside :
683 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
685 + fPlanes[3].
b*p.
y()+fPlanes[3].
d;
688 return (dist > halfCarTolerance) ?
kOutside :
703 nz = std::copysign(
G4double(std::abs(dz) <= halfCarTolerance), p.
z());
709 for (
G4int i=0; i<2; ++i)
711 G4double dy = fPlanes[i].
b*p.
y() + fPlanes[i].
c*p.
z() + fPlanes[i].
d;
712 if (std::abs(dy) > halfCarTolerance)
continue;
717 for (
G4int i=2; i<4; ++i)
720 fPlanes[i].
b*p.
y() + fPlanes[i].
c*p.
z() + fPlanes[i].
d;
721 if (std::abs(dx) > halfCarTolerance)
continue;
732 ny = std::copysign(
G4double(std::abs(dy) <= halfCarTolerance), p.
y());
733 for (
G4int i=2; i<4; ++i)
736 fPlanes[i].
b*p.
y() + fPlanes[i].
c*p.
z() + fPlanes[i].
d;
737 if (std::abs(dx) > halfCarTolerance)
continue;
748 ny = std::copysign(
G4double(std::abs(dy) <= halfCarTolerance), p.
y());
750 fPlanes[3].
c*p.
z() + fPlanes[3].
d;
751 G4double k = std::abs(dx) <= halfCarTolerance;
752 nx = std::copysign(k, p.
x())*fPlanes[3].
a;
753 nz += k*fPlanes[3].
c;
759 ny = std::copysign(
G4double(std::abs(dy) <= halfCarTolerance), p.
y());
761 fPlanes[3].
b*p.
y() + fPlanes[3].
d;
762 G4double k = std::abs(dx) <= halfCarTolerance;
763 nx = std::copysign(k, p.
x())*fPlanes[3].
a;
764 ny += k*fPlanes[3].
b;
771 G4double mag2 = nx*nx + ny*ny + nz*nz;
772 if (mag2 == 1)
return { nx,ny,nz };
779 std::ostringstream message;
780 G4long oldprc = message.precision(16);
781 message <<
"Point p is not on surface (!?) of solid: "
783 message <<
"Position:\n";
784 message <<
" p.x() = " << p.
x()/mm <<
" mm\n";
785 message <<
" p.y() = " << p.
y()/mm <<
" mm\n";
786 message <<
" p.z() = " << p.
z()/mm <<
" mm";
787 G4cout.precision(oldprc) ;
788 G4Exception(
"G4Trap::SurfaceNormal(p)",
"GeomSolids1002",
792 return ApproxSurfaceNormal(p);
805 for (
G4int i=0; i<4; ++i)
809 fPlanes[i].
c*p.
z() + fPlanes[i].
d;
810 if (d > dist) { dist = d; iside = i; }
815 return { fPlanes[iside].
a, fPlanes[iside].
b, fPlanes[iside].
c };
817 return { 0, 0, (
G4double)((p.
z() < 0) ? -1 : 1) };
830 if ((std::abs(p.
z()) - fDz) >= -halfCarTolerance && p.
z()*v.
z() >= 0)
833 G4double dz = (invz < 0) ? fDz : -fDz;
843 G4double cosa = fPlanes[i].
b*v.
y() + fPlanes[i].
c*v.
z();
844 G4double dist = fPlanes[i].
b*p.
y() + fPlanes[i].
c*p.
z() + fPlanes[i].
d;
845 if (dist >= -halfCarTolerance)
847 if (cosa >= 0)
return kInfinity;
849 if (tymin < tmp) tymin = tmp;
854 if (tymax > tmp) tymax = tmp;
863 G4double cosa = fPlanes[i].
a*v.
x()+fPlanes[i].
b*v.
y()+fPlanes[i].
c*v.
z();
864 G4double dist = fPlanes[i].
a*p.
x()+fPlanes[i].
b*p.
y()+fPlanes[i].
c*p.
z() +
866 if (dist >= -halfCarTolerance)
868 if (cosa >= 0)
return kInfinity;
870 if (txmin < tmp) txmin = tmp;
875 if (txmax > tmp) txmax = tmp;
881 G4double tmin = std::max(std::max(txmin,tymin),tzmin);
882 G4double tmax = std::min(std::min(txmax,tymax),tzmax);
884 if (tmax <= tmin + halfCarTolerance)
return kInfinity;
885 return (tmin < halfCarTolerance ) ? 0. : tmin;
901 G4double dy1 = fPlanes[0].
b*p.
y()+fPlanes[0].
c*p.
z()+fPlanes[0].
d;
902 G4double dy2 = fPlanes[1].
b*p.
y()+fPlanes[1].
c*p.
z()+fPlanes[1].
d;
903 G4double dy = std::max(dz,std::max(dy1,dy2));
906 + fPlanes[2].
c*p.
z()+fPlanes[2].
d;
908 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
909 G4double dist = std::max(dy,std::max(dx1,dx2));
910 return (dist > 0) ? dist : 0.;
915 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
917 + fPlanes[2].
c*p.
z()+fPlanes[2].
d;
919 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
920 G4double dist = std::max(dy,std::max(dx1,dx2));
921 return (dist > 0) ? dist : 0.;
926 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
928 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
930 return (dist > 0) ? dist : 0.;
935 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
937 + fPlanes[3].
b*p.
y()+fPlanes[3].
d;
939 return (dist > 0) ? dist : 0.;
957 if ((std::abs(p.
z()) - fDz) >= -halfCarTolerance && p.
z()*v.
z() > 0)
962 n->set(0, 0, (p.
z() < 0) ? -1 : 1);
968 G4int iside = (vz < 0) ? -4 : -2;
975 G4double cosa = fPlanes[i].
b*v.
y() + fPlanes[i].
c*v.
z();
978 G4double dist = fPlanes[i].
b*p.
y() + fPlanes[i].
c*p.
z() + fPlanes[i].
d;
979 if (dist >= -halfCarTolerance)
984 n->set(0, fPlanes[i].b, fPlanes[i].c);
989 if (tmax > tmp) { tmax = tmp; iside = i; }
997 G4double cosa = fPlanes[i].
a*v.
x()+fPlanes[i].
b*v.
y()+fPlanes[i].
c*v.
z();
1001 fPlanes[i].
b*p.
y() + fPlanes[i].
c*p.
z() + fPlanes[i].
d;
1002 if (dist >= -halfCarTolerance)
1007 n->set(fPlanes[i].a, fPlanes[i].b, fPlanes[i].c);
1012 if (tmax > tmp) { tmax = tmp; iside = i; }
1022 n->set(0, 0, iside + 3);
1024 n->set(fPlanes[iside].a, fPlanes[iside].b, fPlanes[iside].c);
1039 std::ostringstream message;
1040 G4long oldprc = message.precision(16);
1041 message <<
"Point p is outside (!?) of solid: " <<
GetName() <<
G4endl;
1042 message <<
"Position:\n";
1043 message <<
" p.x() = " << p.
x()/mm <<
" mm\n";
1044 message <<
" p.y() = " << p.
y()/mm <<
" mm\n";
1045 message <<
" p.z() = " << p.
z()/mm <<
" mm";
1046 G4cout.precision(oldprc);
1047 G4Exception(
"G4Trap::DistanceToOut(p)",
"GeomSolids1002",
1057 G4double dy1 = fPlanes[0].
b*p.
y()+fPlanes[0].
c*p.
z()+fPlanes[0].
d;
1058 G4double dy2 = fPlanes[1].
b*p.
y()+fPlanes[1].
c*p.
z()+fPlanes[1].
d;
1059 G4double dy = std::max(dz,std::max(dy1,dy2));
1062 + fPlanes[2].
c*p.
z()+fPlanes[2].
d;
1064 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
1065 G4double dist = std::max(dy,std::max(dx1,dx2));
1066 return (dist < 0) ? -dist : 0.;
1071 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
1073 + fPlanes[2].
c*p.
z()+fPlanes[2].
d;
1075 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
1076 G4double dist = std::max(dy,std::max(dx1,dx2));
1077 return (dist < 0) ? -dist : 0.;
1082 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
1084 + fPlanes[3].
c*p.
z()+fPlanes[3].
d;
1086 return (dist < 0) ? -dist : 0.;
1091 G4double dy = std::max(dz,std::abs(p.
y())+fPlanes[1].
d);
1093 + fPlanes[3].
b*p.
y()+fPlanes[3].
d;
1095 return (dist < 0) ? -dist : 0.;
1116 return new G4Trap(*
this);
1130 G4long oldprc = os.precision(16);
1131 os <<
"-----------------------------------------------------------\n"
1132 <<
" *** Dump for solid: " <<
GetName() <<
" ***\n"
1133 <<
" ===================================================\n"
1134 <<
" Solid type: G4Trap\n"
1136 <<
" half length Z: " << fDz/mm <<
" mm\n"
1137 <<
" half length Y, face -Dz: " << fDy1/mm <<
" mm\n"
1138 <<
" half length X, face -Dz, side -Dy1: " << fDx1/mm <<
" mm\n"
1139 <<
" half length X, face -Dz, side +Dy1: " << fDx2/mm <<
" mm\n"
1140 <<
" half length Y, face +Dz: " << fDy2/mm <<
" mm\n"
1141 <<
" half length X, face +Dz, side -Dy2: " << fDx3/mm <<
" mm\n"
1142 <<
" half length X, face +Dz, side +Dy2: " << fDx4/mm <<
" mm\n"
1143 <<
" theta: " << theta/degree <<
" degrees\n"
1144 <<
" phi: " << phi/degree <<
" degrees\n"
1145 <<
" alpha, face -Dz: " << alpha1/degree <<
" degrees\n"
1146 <<
" alpha, face +Dz: " <<
alpha2/degree <<
" degrees\n"
1147 <<
"-----------------------------------------------------------\n";
1148 os.precision(oldprc);
1159 for (
G4int i=0; i<8; ++i)
1161 G4int iy = (i==0 || i==1 || i==4 || i==5) ? 0 : 1;
1162 G4int ix = (i==0 || i==2 || i==4 || i==6) ? 2 : 3;
1164 G4double y = -(fPlanes[iy].
c*z + fPlanes[iy].
d)/fPlanes[iy].b;
1165 G4double x = -(fPlanes[ix].
b*y + fPlanes[ix].
c*z
1166 + fPlanes[ix].
d)/fPlanes[ix].a;
1178 constexpr G4int iface [6][4] =
1179 { {0,1,3,2}, {0,4,5,1}, {2,3,7,6}, {0,2,6,4}, {1,5,7,3}, {4,6,7,5} };
1189 k -= (
G4int)(select <= fAreas[4]);
1190 k -= (
G4int)(select <= fAreas[3]);
1191 k -= (
G4int)(select <= fAreas[2]);
1192 k -= (
G4int)(select <= fAreas[1]);
1193 k -= (
G4int)(select <= fAreas[0]);
1197 G4int i0 = iface[k][0];
1198 G4int i1 = iface[k][1];
1199 G4int i2 = iface[k][2];
1200 G4int i3 = iface[k][3];
1202 if (select > fAreas[k] - s2) i0 = i2;
1208 if (u + v > 1.) { u = 1. - u; v = 1. - v; }
1209 return (1.-u-v)*pt[i0] + u*pt[i1] + v*pt[i3];
1223 G4double phi = std::atan2(fTthetaSphi, fTthetaCphi);
1224 G4double alpha1 = std::atan(fTalpha1);
1226 G4double theta = std::atan(std::sqrt(fTthetaCphi*fTthetaCphi
1227 +fTthetaSphi*fTthetaSphi));
1230 fDy1, fDx1, fDx2, alpha1,
1231 fDy2, fDx3, fDx4,
alpha2);
const G4double kCarTolerance
std::vector< G4ThreeVector > G4ThreeVectorList
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
double dot(const Hep3Vector &) const
void set(double x, double y, double z)
G4bool BoundingBoxVsVoxelLimits(const EAxis pAxis, const G4VoxelLimits &pVoxelLimits, const G4Transform3D &pTransform3D, G4double &pMin, G4double &pMax) const
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimits, const G4Transform3D &pTransform3D, G4double &pMin, G4double &pMax) const
G4bool fRebuildPolyhedron
G4CSGSolid & operator=(const G4CSGSolid &rhs)
G4double GetCubicVolume() override
void ComputeDimensions(G4VPVParameterisation *p, const G4int n, const G4VPhysicalVolume *pRep) override
G4bool CalculateExtent(const EAxis pAxis, const G4VoxelLimits &pVoxelLimit, const G4AffineTransform &pTransform, G4double &pMin, G4double &pMax) const override
G4GeometryType GetEntityType() const override
void SetAllParameters(G4double pDz, G4double pTheta, G4double pPhi, G4double pDy1, G4double pDx1, G4double pDx2, G4double pAlp1, G4double pDy2, G4double pDx3, G4double pDx4, G4double pAlp2)
G4ThreeVector GetPointOnSurface() const override
G4double GetAlpha2() const
G4double GetAlpha1() const
G4double GetTheta() const
G4VSolid * Clone() const override
G4double DistanceToIn(const G4ThreeVector &p, const G4ThreeVector &v) const override
G4ThreeVector SurfaceNormal(const G4ThreeVector &p) const override
std::ostream & StreamInfo(std::ostream &os) const override
EInside Inside(const G4ThreeVector &p) const override
G4double GetSurfaceArea() override
G4double GetZHalfLength() const
G4Polyhedron * CreatePolyhedron() const override
G4Trap(const G4String &pName, G4double pDz, G4double pTheta, G4double pPhi, G4double pDy1, G4double pDx1, G4double pDx2, G4double pAlp1, G4double pDy2, G4double pDx3, G4double pDx4, G4double pAlp2)
G4double DistanceToOut(const G4ThreeVector &p, const G4ThreeVector &v, const G4bool calcNorm=false, G4bool *validNorm=nullptr, G4ThreeVector *n=nullptr) const override
G4bool MakePlane(const G4ThreeVector &p1, const G4ThreeVector &p2, const G4ThreeVector &p3, const G4ThreeVector &p4, TrapSidePlane &plane)
void DescribeYourselfTo(G4VGraphicsScene &scene) const override
void BoundingLimits(G4ThreeVector &pMin, G4ThreeVector &pMax) const override
G4Trap & operator=(const G4Trap &rhs)
virtual void AddSolid(const G4Box &)=0
virtual void ComputeDimensions(G4Box &, const G4int, const G4VPhysicalVolume *) const