168 for (
Int_t i = 0; i < 8; i++) {
182 SetShapeBit(kGeoArb8);
184 for (
Int_t i = 0; i < 8; i++) {
185 fXY[i][0] = vertices[2 * i];
186 fXY[i][1] = vertices[2 * i + 1];
191 for (
Int_t i = 0; i < 8; i++) {
205 SetShapeBit(kGeoArb8);
207 for (
Int_t i = 0; i < 8; i++) {
208 fXY[i][0] = vertices[2 * i];
209 fXY[i][1] = vertices[2 * i + 1];
214 for (
Int_t i = 0; i < 8; i++) {
252 for (i = 0; i < 4; i++) {
254 capacity += 0.25 *
fDz *
255 ((
fXY[i][0] +
fXY[i + 4][0]) * (
fXY[j][1] +
fXY[j + 4][1]) -
256 (
fXY[j][0] +
fXY[j + 4][0]) * (
fXY[i][1] +
fXY[i + 4][1]) +
257 (1. / 3) * ((
fXY[i + 4][0] -
fXY[i][0]) * (
fXY[j + 4][1] -
fXY[j][1]) -
258 (
fXY[j][0] -
fXY[j + 4][0]) * (
fXY[i][1] -
fXY[i + 4][1])));
272 for (
Int_t i = 1; i < 8; i++) {
304 for (i = 0; i < 4; i++) {
305 dx1 =
fXY[(i + 1) % 4][0] -
fXY[i][0];
306 dy1 =
fXY[(i + 1) % 4][1] -
fXY[i][1];
312 dx2 =
fXY[4 + (i + 1) % 4][0] -
fXY[4 + i][0];
313 dy2 =
fXY[4 + (i + 1) % 4][1] -
fXY[4 + i][1];
319 twist[i] = dy1 * dx2 - dx1 * dy2;
331 for (i = 0; i < 4; i++) {
332 fXY[i][0] += 1.E-8 *
fXY[i + 4][0];
333 fXY[i][1] += 1.E-8 *
fXY[i + 4][1];
337 for (i = 0; i < 4; i++) {
338 fXY[i + 4][0] += 1.E-8 *
fXY[i][0];
339 fXY[i + 4][1] += 1.E-8 *
fXY[i][1];
345 for (i = 0; i < 4; i++) {
348 sum2 +=
fXY[i + 4][0] *
fXY[j + 4][1] -
fXY[j + 4][0] *
fXY[i + 4][1];
351 Fatal(
"ComputeTwist",
"Shape %s type Arb8: Lower/upper faces defined with opposite clockwise",
GetName());
355 Error(
"ComputeTwist",
"Shape %s type Arb8: Vertices must be defined clockwise in XY planes. Re-ordering...",
379 Error(
"ComputeTwist",
"Shape %s type Arb8: Malformed polygon with crossing opposite segments",
GetName());
389 return (!
fTwist || iseg < 0 || iseg > 3) ? 0. :
fTwist[iseg];
406 for (i1 = 0; i1 < 4; i1++) {
412 p1[0] = vert[2 * i1];
413 p1[1] = vert[2 * i1 + 1];
414 p2[0] = vert[2 * i2];
415 p2[1] = vert[2 * i2 + 1];
418 dpx = point[0] - p1[0];
419 dpy = point[1] - p1[1];
423 ssq = dpx * dpx + dpy * dpy;
436 dpx = point[0] - p2[0];
437 dpy = point[1] - p2[1];
449 ssq = dpx * dpx + dpy * dpy;
467 Double_t x0, y0, z0, x1, y1, z1, x2, y2, z2;
472 memset(norm, 0, 3 *
sizeof(
Double_t));
473 norm[2] = (dir[2] > 0) ? 1 : (-1);
483 Int_t jseg = (iseg + 1) % 4;
485 y0 = vert[2 * iseg + 1];
488 y2 = vert[2 * jseg + 1];
490 x0 += frac * (x2 - x0);
491 y0 += frac * (y2 - y0);
492 x1 =
fXY[iseg + 4][0];
493 y1 =
fXY[iseg + 4][1];
495 x1 += frac * (
fXY[jseg + 4][0] - x1);
496 y1 += frac * (
fXY[jseg + 4][1] - y1);
505 norm[0] = ay * bz - az * by;
506 norm[1] = az * bx - ax * bz;
507 norm[2] = ax * by - ay * bx;
508 fn =
TMath::Sqrt(norm[0] * norm[0] + norm[1] * norm[1] + norm[2] * norm[2]);
520 if (dir[0] > -2. && dir[0] * norm[0] + dir[1] * norm[1] + dir[2] * norm[2] < 0) {
541 for (i = 0; i < 4; i++) {
542 poly[2 * i] =
fXY[i + 4][0] + cf * (
fXY[i][0] -
fXY[i + 4][0]);
543 poly[2 * i + 1] =
fXY[i + 4][1] + cf * (
fXY[i][1] -
fXY[i + 4][1]);
563 Int_t j = (ipl + 1) % 4;
566 xb =
fXY[ipl + 4][0];
567 yb =
fXY[ipl + 4][1];
586 Double_t a = (dtx * dir[1] - dty * dir[0] + (tx1 * ty2 - tx2 * ty1) * dir[2]) * dir[2];
588 Double_t b = dxs * dir[1] - dys * dir[0] +
589 (dtx * point[1] - dty * point[0] + ty2 * xs1 - ty1 * xs2 + tx1 * ys2 - tx2 * ys1) * dir[2];
590 Double_t c = dxs * point[1] - dys * point[0] + xs1 * ys2 - xs2 * ys1;
591 Double_t x1, x2, y1, y2, xp, yp, zi, s;
598 memcpy(dirp, dir, 3 *
sizeof(
Double_t));
601 ((
TGeoArb8 *)
this)->ComputeNormal(point, dirp, norm);
602 ndotd = dir[0] * norm[0] + dir[1] * norm[1] + dir[2] * norm[2];
607 zi = (point[0] - xs1) * (point[0] - xs2) + (point[1] - ys1) * (point[1] - ys2);
623 memcpy(dirp, dir, 3 *
sizeof(
Double_t));
626 ((
TGeoArb8 *)
this)->ComputeNormal(point, dirp, norm);
627 ndotd = dir[0] * norm[0] + dir[1] * norm[1] + dir[2] * norm[2];
636 zi = point[2] + s * dir[2];
638 x1 = xs1 + tx1 * dir[2] * s;
639 x2 = xs2 + tx2 * dir[2] * s;
640 xp = point[0] + s * dir[0];
641 y1 = ys1 + ty1 * dir[2] * s;
642 y2 = ys2 + ty2 * dir[2] * s;
643 yp = point[1] + s * dir[1];
644 zi = (xp - x1) * (xp - x2) + (yp - y1) * (yp - y2);
652 memcpy(dirp, dir, 3 *
sizeof(
Double_t));
655 ((
TGeoArb8 *)
this)->ComputeNormal(point, dirp, norm);
656 ndotd = dir[0] * norm[0] + dir[1] * norm[1] + dir[2] * norm[2];
668 zi = point[2] + s * dir[2];
670 x1 = xs1 + tx1 * dir[2] * s;
671 x2 = xs2 + tx2 * dir[2] * s;
672 xp = point[0] + s * dir[0];
673 y1 = ys1 + ty1 * dir[2] * s;
674 y2 = ys2 + ty2 * dir[2] * s;
675 yp = point[1] + s * dir[1];
676 zi = (xp - x1) * (xp - x2) + (yp - y1) * (yp - y2);
697 if (point[2] * dir[2] < 0) {
700 for (
Int_t j = 0; j < 2; j++)
701 pt[j] = point[j] + snext * dir[j];
709 for (
Int_t i = 0; i < 4; i++) {
729 distz = (-
fDz - point[2]) / dir[2];
733 distz = (
fDz - point[2]) / dir[2];
736 for (i = 0; i < 4; i++) {
742 pt[0] = point[0] + distz * dir[0];
743 pt[1] = point[1] + distz * dir[1];
748 if (dist < 0 || dist > 1.E10)
761 distmin = (-
fDz - point[2]) / dir[2];
764 distmin = (
fDz - point[2]) / dir[2];
772 for (
Int_t ipl = 0; ipl < 4; ipl++) {
773 Int_t j = (ipl + 1) % 4;
776 xb =
fXY[ipl + 4][0];
777 yb =
fXY[ipl + 4][1];
796 Double_t a = (dtx * dir[1] - dty * dir[0] + (tx1 * ty2 - tx2 * ty1) * dir[2]) * dir[2];
797 Double_t b = dxs * dir[1] - dys * dir[0] +
798 (dtx * point[1] - dty * point[0] + ty2 * xs1 - ty1 * xs2 + tx1 * ys2 - tx2 * ys1) * dir[2];
799 Double_t c = dxs * point[1] - dys * point[0] + xs1 * ys2 - xs2 * ys1;
805 if (s > eps && s < distmin) {
807 lateral_cross =
kTRUE;
820 lateral_cross =
kTRUE;
827 if (s > eps && s < distmin) {
829 lateral_cross =
kTRUE;
835 if (!lateral_cross) {
840 pt[0] = point[0] + distmin * dir[0];
841 pt[1] = point[1] + distmin * dir[1];
847 for (
Int_t j = 0; j < 4; j++) {
848 poly[2 * j] =
fXY[j + i][0];
849 poly[2 * j + 1] =
fXY[j + i][1];
864 Error(
"Divide",
"Division of an arbitrary trapezoid not implemented");
895 for (i = 0; i < 8; i++) {
912 Error(
"GetFittingBox",
"cannot handle parametrized rotated volumes");
919 Error(
"GetFittingBox",
"wrong matrix - parametrized box is outside this");
924 dd[0] = parambox->
GetDX();
925 dd[1] = parambox->
GetDY();
926 dd[2] = parambox->
GetDZ();
931 Error(
"GetFittingBox",
"wrong matrix");
935 if (dd[0] >= 0 && dd[1] >= 0) {
946 for (
Int_t iaxis = 0; iaxis < 2; iaxis++) {
950 for (
Int_t ivert = 0; ivert < 4; ivert++) {
970 for (i = 0; i < 3; i++) {
971 v1[i] = p2[i] - p1[i];
972 v2[i] = p3[i] - p1[i];
974 norm[0] =
v1[1] *
v2[2] -
v1[2] *
v2[1];
975 cross += norm[0] * norm[0];
976 norm[1] =
v1[2] *
v2[0] -
v1[0] *
v2[2];
977 cross += norm[1] * norm[1];
978 norm[2] =
v1[0] *
v2[1] -
v1[1] *
v2[0];
979 cross += norm[2] * norm[2];
983 for (i = 0; i < 3; i++)
1056 for (i = 0; i < 4; i++) {
1059 y1 = pts[(i << 1) + 1];
1061 y2 = pts[(j << 1) + 1];
1062 cross = (
x - x1) * (y2 - y1) - (
y - y1) * (x2 - x1);
1074 printf(
"*** Shape %s: TGeoArb8 ***\n",
GetName());
1076 printf(
" = TWISTED\n");
1077 for (
Int_t ip = 0; ip < 8; ip++) {
1078 printf(
" point #%i : x=%11.5f y=%11.5f z=%11.5f\n", ip,
fXY[ip][0],
fXY[ip][1],
fDz * ((ip < 4) ? -1 : 1));
1080 printf(
" Bounding box:\n");
1107 for (iseg = 0; iseg < 4; iseg++) {
1110 p1 = &vert[2 * iseg];
1111 p2 = &vert[2 * ((iseg + 1) % 4)];
1114 dpx = point[0] - p1[0];
1115 dpy = point[1] - p1[1];
1120 dpx = point[0] - p2[0];
1121 dpy = point[1] - p2[1];
1128 ssq = dpx * dpx + dpy * dpy;
1138 isegmin = (isegmin + 1) % 4;
1142 Int_t i2 = (isegmin + 1) % 4;
1147 dx = dx1 + umin * (dx2 - dx1);
1148 dy = dy1 + umin * (dy2 - dy1);
1159 for (iseg = 0; iseg < 4; iseg++)
1177 Int_t ipln = (iseg + 1) % 4;
1179 vertices[0] =
fXY[iseg][0];
1180 vertices[1] =
fXY[iseg][1];
1183 vertices[3] =
fXY[ipln][0];
1184 vertices[4] =
fXY[ipln][1];
1187 vertices[6] =
fXY[ipln + 4][0];
1188 vertices[7] =
fXY[ipln + 4][1];
1191 vertices[9] =
fXY[iseg + 4][0];
1192 vertices[10] =
fXY[iseg + 4][1];
1206 safe = (point[0] - p1[0]) * norm[0] + (point[1] - p1[1]) * norm[1] + (point[2] - p1[2]) * norm[2];
1219 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
1220 out <<
" dz = " <<
fDz <<
";" << std::endl;
1221 out <<
" vert[0] = " <<
fXY[0][0] <<
";" << std::endl;
1222 out <<
" vert[1] = " <<
fXY[0][1] <<
";" << std::endl;
1223 out <<
" vert[2] = " <<
fXY[1][0] <<
";" << std::endl;
1224 out <<
" vert[3] = " <<
fXY[1][1] <<
";" << std::endl;
1225 out <<
" vert[4] = " <<
fXY[2][0] <<
";" << std::endl;
1226 out <<
" vert[5] = " <<
fXY[2][1] <<
";" << std::endl;
1227 out <<
" vert[6] = " <<
fXY[3][0] <<
";" << std::endl;
1228 out <<
" vert[7] = " <<
fXY[3][1] <<
";" << std::endl;
1229 out <<
" vert[8] = " <<
fXY[4][0] <<
";" << std::endl;
1230 out <<
" vert[9] = " <<
fXY[4][1] <<
";" << std::endl;
1231 out <<
" vert[10] = " <<
fXY[5][0] <<
";" << std::endl;
1232 out <<
" vert[11] = " <<
fXY[5][1] <<
";" << std::endl;
1233 out <<
" vert[12] = " <<
fXY[6][0] <<
";" << std::endl;
1234 out <<
" vert[13] = " <<
fXY[6][1] <<
";" << std::endl;
1235 out <<
" vert[14] = " <<
fXY[7][0] <<
";" << std::endl;
1236 out <<
" vert[15] = " <<
fXY[7][1] <<
";" << std::endl;
1237 out <<
" TGeoShape *" <<
GetPointerName() <<
" = new TGeoArb8(\"" <<
GetName() <<
"\", dz,vert);" << std::endl;
1247 for (
Int_t i = 0; i < 4; i++) {
1248 vertices[2 * i] =
fXY[i + 4][0] + cf * (
fXY[i][0] -
fXY[i + 4][0]);
1249 vertices[2 * i + 1] =
fXY[i + 4][1] + cf * (
fXY[i][1] -
fXY[i + 4][1]);
1263 for (
Int_t i = 0; i < 8; i++) {
1264 fXY[i][0] = param[2 * i + 1];
1265 fXY[i][1] = param[2 * i + 2];
1276 for (
Int_t i = 0; i < 8; i++) {
1288 for (
Int_t i = 0; i < 8; i++) {
1300 if (vnum < 0 || vnum > 7) {
1301 Error(
"SetVertex",
"Invalid vertex number");
1340 for (
Int_t i = 0; i < vecsize; i++)
1351 for (
Int_t i = 0; i < vecsize; i++)
1361 for (
Int_t i = 0; i < vecsize; i++)
1371 for (
Int_t i = 0; i < vecsize; i++)
1382 for (
Int_t i = 0; i < vecsize; i++)
1406 fH1 = fH2 = fBl1 = fBl2 = fTl1 = fTl2 = fAlpha1 = fAlpha2 = 0;
1432 fXY[0][1] = -dz * ty -
h1;
1434 fXY[1][1] = -dz * ty +
h1;
1436 fXY[2][1] = -dz * ty +
h1;
1438 fXY[3][1] = -dz * ty -
h1;
1439 fXY[4][0] = dz * tx - h2 * ta2 - bl2;
1440 fXY[4][1] = dz * ty - h2;
1441 fXY[5][0] = dz * tx + h2 * ta2 - tl2;
1442 fXY[5][1] = dz * ty + h2;
1443 fXY[6][0] = dz * tx + h2 * ta2 + tl2;
1444 fXY[6][1] = dz * ty + h2;
1445 fXY[7][0] = dz * tx - h2 * ta2 + bl2;
1446 fXY[7][1] = dz * ty - h2;
1448 if ((dz < 0) || (
h1 < 0) || (bl1 < 0) || (tl1 < 0) || (h2 < 0) || (bl2 < 0) || (tl2 < 0)) {
1449 SetShapeBit(kGeoRunTimeShape);
1473 for (
Int_t i = 0; i < 8; i++) {
1482 fXY[0][1] = -dz * ty -
h1;
1484 fXY[1][1] = -dz * ty +
h1;
1486 fXY[2][1] = -dz * ty +
h1;
1488 fXY[3][1] = -dz * ty -
h1;
1489 fXY[4][0] = dz * tx - h2 * ta2 - bl2;
1490 fXY[4][1] = dz * ty - h2;
1491 fXY[5][0] = dz * tx + h2 * ta2 - tl2;
1492 fXY[5][1] = dz * ty + h2;
1493 fXY[6][0] = dz * tx + h2 * ta2 + tl2;
1494 fXY[6][1] = dz * ty + h2;
1495 fXY[7][0] = dz * tx - h2 * ta2 + bl2;
1496 fXY[7][1] = dz * ty - h2;
1498 if ((dz < 0) || (
h1 < 0) || (bl1 < 0) || (tl1 < 0) || (h2 < 0) || (bl2 < 0) || (tl2 < 0)) {
1499 SetShapeBit(kGeoRunTimeShape);
1515 if (iact < 3 && safe) {
1520 if (iact == 1 && step < *safe)
1533 distmin = (-
fDz - point[2]) / dir[2];
1536 distmin = (
fDz - point[2]) / dir[2];
1542 for (
Int_t ipl = 0; ipl < 4; ipl++) {
1543 Int_t j = (ipl + 1) % 4;
1546 xb =
fXY[ipl + 4][0];
1547 yb =
fXY[ipl + 4][1];
1557 Double_t ddotn = -dir[0] * az * by + dir[1] * az * bx + dir[2] * (ax * by - ay * bx);
1560 Double_t saf = -(point[0] - xa) * az * by + (point[1] - ya) * az * bx + (point[2] +
fDz) * (ax * by - ay * bx);
1576 if (iact < 3 && safe) {
1581 if (iact == 1 && step < *safe)
1598 xnew = point[0] + snxt * dir[0];
1599 ynew = point[1] + snxt * dir[1];
1600 for (i = 0; i < 4; i++) {
1603 pts[j + 1] =
fXY[i][1];
1612 xnew = point[0] + snxt * dir[0];
1613 ynew = point[1] + snxt * dir[1];
1614 for (i = 0; i < 4; i++) {
1616 pts[j] =
fXY[i + 4][0];
1617 pts[j + 1] =
fXY[i + 4][1];
1631 for (i = 0; i < 4; i++) {
1646 ddotn = -dir[0] * az * by + dir[1] * az * bx + dir[2] * (ax * by - ay * bx);
1647 saf = (point[0] - xa) * az * by - (point[1] - ya) * az * bx - (point[2] +
fDz) * (ax * by - ay * bx);
1655 znew = point[2] + snxt * dir[2];
1657 xnew = point[0] + snxt * dir[0];
1658 ynew = point[1] + snxt * dir[1];
1669 if ((xnew - xs1) * (xs2 - xnew) >= 0)
1672 if ((ynew - ys1) * (ys2 - ynew) >= 0)
1688 if (saf > 0 && saf < safmin)
1689 exiting = (point[2] * dir[2] > 0) ?
kTRUE :
kFALSE;
1709 TGeoVolumeMulti *vmulti;
1710 TGeoPatternFinder *finder;
1713 Error(
"Divide",
"cannot divide trapezoids on other axis than Z");
1719 finder =
new TGeoPatternTrapZ(voldiv, ndiv,
start, end);
1724 Double_t txz = ((TGeoPatternTrapZ *)finder)->GetTxz();
1725 Double_t tyz = ((TGeoPatternTrapZ *)finder)->GetTyz();
1727 for (
Int_t idiv = 0; idiv < ndiv; idiv++) {
1728 zmin =
start + idiv * step;
1729 zmax =
start + (idiv + 1) * step;
1730 oz =
start + idiv * step + step / 2;
1736 for (
Int_t vert1 = 0; vert1 < 4; vert1++)
1737 ((
TGeoArb8 *)shape)->SetVertex(vert1, points_lo[2 * vert1] - ox, points_lo[2 * vert1 + 1] - oy);
1738 for (
Int_t vert2 = 0; vert2 < 4; vert2++)
1739 ((
TGeoArb8 *)shape)->SetVertex(vert2 + 4, points_hi[2 * vert2] - ox, points_hi[2 * vert2 + 1] - oy);
1740 vol =
new TGeoVolume(divname, shape, voldiv->
GetMedium());
1757 Error(
"GetMakeRuntimeShape",
"invalid mother");
1772 h2 = ((
TGeoTrap *)mother)->GetH2();
1777 bl1 = ((
TGeoTrap *)mother)->GetBl1();
1782 bl2 = ((
TGeoTrap *)mother)->GetBl2();
1787 tl1 = ((
TGeoTrap *)mother)->GetTl1();
1792 tl2 = ((
TGeoTrap *)mother)->GetTl2();
1796 return (
new TGeoTrap(dz,
fTheta,
fPhi,
h1, bl1, tl1,
fAlpha1, h2, bl2, tl2,
fAlpha2));
1808 Double_t ax, ay, az = z1 - z0, bx, by;
1811 for (i = 0; i < 4; i++) {
1837 norm[2] = ax * by - ay * bx;
1838 fn =
TMath::Sqrt(norm[0] * norm[0] + norm[1] * norm[1] + norm[2] * norm[2]);
1841 saf[i] = (x0 - point[0]) * norm[0] + (y0 - point[1]) * norm[1] + (-
fDz - point[2]) * norm[2];
1845 saf[i] = -saf[i] / fn;
1851 for (j = 1; j < 5; j++)
1857 for (j = 1; j < 5; j++)
1871 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
1872 out <<
" dz = " <<
fDz <<
";" << std::endl;
1873 out <<
" theta = " <<
fTheta <<
";" << std::endl;
1874 out <<
" phi = " <<
fPhi <<
";" << std::endl;
1875 out <<
" h1 = " <<
fH1 <<
";" << std::endl;
1876 out <<
" bl1 = " <<
fBl1 <<
";" << std::endl;
1877 out <<
" tl1 = " <<
fTl1 <<
";" << std::endl;
1878 out <<
" alpha1 = " <<
fAlpha1 <<
";" << std::endl;
1879 out <<
" h2 = " <<
fH2 <<
";" << std::endl;
1880 out <<
" bl2 = " <<
fBl2 <<
";" << std::endl;
1881 out <<
" tl2 = " <<
fTl2 <<
";" << std::endl;
1882 out <<
" alpha2 = " <<
fAlpha2 <<
";" << std::endl;
1884 <<
"\", dz,theta,phi,h1,bl1,tl1,alpha1,h2,bl2,tl2,alpha2);" << std::endl;
1948 for (
Int_t i = 0; i < vecsize; i++)
1958 for (
Int_t i = 0; i < vecsize; i++)
1969 for (
Int_t i = 0; i < vecsize; i++)
1987 :
TGeoTrap(dz, theta, phi,
h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2)
1989 fTwistAngle = twist;
1999 for (i = 0; i < 4; i++) {
2010 for (i = 4; i < 8; i++) {
2019 if ((dz < 0) || (
h1 < 0) || (bl1 < 0) || (tl1 < 0) || (h2 < 0) || (bl2 < 0) || (tl2 < 0))
2020 SetShapeBit(kGeoRunTimeShape);
2031 :
TGeoTrap(
name, dz, theta, phi,
h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2)
2033 fTwistAngle = twist;
2043 for (i = 0; i < 4; i++) {
2054 for (i = 4; i < 8; i++) {
2063 if ((dz < 0) || (
h1 < 0) || (bl1 < 0) || (tl1 < 0) || (h2 < 0) || (bl2 < 0) || (tl2 < 0))
2064 SetShapeBit(kGeoRunTimeShape);
2080 if (iact < 3 && safe) {
2085 if (iact == 1 && step < *safe)
2098 if (iact < 3 && safe) {
2103 if (iact == 1 && step < *safe)
2119 Error(
"GetMakeRuntimeShape",
"invalid mother");
2132 h2 = ((
TGeoTrap *)mother)->GetH2();
2136 bl1 = ((
TGeoTrap *)mother)->GetBl1();
2140 bl2 = ((
TGeoTrap *)mother)->GetBl2();
2144 tl1 = ((
TGeoTrap *)mother)->GetTl1();
2148 tl2 = ((
TGeoTrap *)mother)->GetTl2();
2151 return (
new TGeoGtra(dz,
fTheta,
fPhi,
fTwistAngle,
h1, bl1, tl1,
fAlpha1, h2, bl2, tl2,
fAlpha2));
2169 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
2170 out <<
" dz = " <<
fDz <<
";" << std::endl;
2171 out <<
" theta = " <<
fTheta <<
";" << std::endl;
2172 out <<
" phi = " <<
fPhi <<
";" << std::endl;
2173 out <<
" twist = " <<
fTwistAngle <<
";" << std::endl;
2174 out <<
" h1 = " <<
fH1 <<
";" << std::endl;
2175 out <<
" bl1 = " <<
fBl1 <<
";" << std::endl;
2176 out <<
" tl1 = " <<
fTl1 <<
";" << std::endl;
2177 out <<
" alpha1 = " <<
fAlpha1 <<
";" << std::endl;
2178 out <<
" h2 = " <<
fH2 <<
";" << std::endl;
2179 out <<
" bl2 = " <<
fBl2 <<
";" << std::endl;
2180 out <<
" tl2 = " <<
fTl2 <<
";" << std::endl;
2181 out <<
" alpha2 = " <<
fAlpha2 <<
";" << std::endl;
2183 <<
"\", dz,theta,phi,twist,h1,bl1,tl1,alpha1,h2,bl2,tl2,alpha2);" << std::endl;
2216 for (i = 0; i < 4; i++) {
2227 for (i = 4; i < 8; i++) {
2248 for (
Int_t i = 0; i < vecsize; i++)
2258 for (
Int_t i = 0; i < vecsize; i++)
2269 for (
Int_t i = 0; i < vecsize; i++)
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
externTGeoManager * gGeoManager
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Double_t GetClosestEdge(const Double_t *point, Double_t *vert, Int_t &isegment) const
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void SetPoints(Double_t *points) const override
virtual void SetVertex(Int_t vnum, Double_t x, Double_t y)
void CopyTwist(Double_t *twist=nullptr)
void SetDimensions(Double_t *param) override
Bool_t Contains(const Double_t *point) const override
Bool_t GetPointsOnFacet(Int_t, Int_t, Double_t *) const override
TGeoArb8(const TGeoArb8 &)=delete
Double_t DistToPlane(const Double_t *point, const Double_t *dir, Int_t ipl, Bool_t in) const
void Streamer(TBuffer &) override
Stream an object of class TObject.
static Bool_t InsidePolygon(Double_t x, Double_t y, Double_t *pts)
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
void GetBoundingCylinder(Double_t *param) const override
Double_t * fTwist
! [4] tangents of twist angles
Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override
static void GetPlaneNormal(Double_t *p1, Double_t *p2, Double_t *p3, Double_t *norm)
Double_t Capacity() const override
Double_t SafetyToFace(const Double_t *point, Int_t iseg, Bool_t in) const
void Sizeof3D() const override
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
void InspectShape() const override
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
Double_t GetTwist(Int_t iseg) const
Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
static Bool_t IsSamePoint(const Double_t *p1, const Double_t *p2)
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
void SetPlaneVertices(Double_t zpl, Double_t *vertices) const
void ComputeBBox() override
Int_t GetFittingBox(const TGeoBBox *parambox, TGeoMatrix *mat, Double_t &dx, Double_t &dy, Double_t &dz) const override
virtual const Double_t * GetOrigin() const
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
virtual Double_t GetDX() const
virtual Double_t GetDZ() const
virtual Double_t GetDY() const
void InspectShape() const override
Bool_t Contains(const Double_t *point) const override
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
void Sizeof3D() const override
void SetDimensions(Double_t *param) override
Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
Geometrical transformation package.
Bool_t IsRotation() const
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
void SetDivIndex(Int_t index)
Base abstract class for all shapes.
static Bool_t IsSegCrossing(Double_t x1, Double_t y1, Double_t x2, Double_t y2, Double_t x3, Double_t y3, Double_t x4, Double_t y4)
Check if segments (A,B) and (C,D) are crossing, where: A(x1,y1), B(x2,y2), C(x3,y3),...
void SetShapeBit(UInt_t f, Bool_t set)
Equivalent of TObject::SetBit.
TGeoShape()
Default constructor.
static Bool_t IsSameWithinTolerance(Double_t a, Double_t b)
Check if two numbers differ with less than a tolerance.
Bool_t IsRunTimeShape() const
const char * GetPointerName() const
Provide a pointer name containing uid.
const char * GetName() const override
Get the shape name.
static Double_t Tolerance()
Bool_t TestShapeBit(UInt_t f) const
void SetDimensions(Double_t *param) override
Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const override
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
void AddVolume(TGeoVolume *vol)
Add a volume with valid shape to the list of volumes.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
void AddNodeOffset(TGeoVolume *vol, Int_t copy_no, Double_t offset=0, Option_t *option="")
Add a division node to the list of nodes.
TGeoMedium * GetMedium() const
void SetFinder(TGeoPatternFinder *finder)
Int_t GetNdaughters() const
TObject * At(Int_t idx) const override
Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
const char * Data() const
double dist(Rotation3D const &r1, Rotation3D const &r2)
Long64_t LocMin(Long64_t n, const T *a)
Returns index of array with the minimum element.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
T1 Sign(T1 a, T2 b)
Returns a value with the magnitude of a and the sign of b.
Long64_t LocMax(Long64_t n, const T *a)
Returns index of array with the maximum element.
constexpr Double_t DegToRad()
Conversion from degree to radian: .
Double_t Sqrt(Double_t x)
Returns the square root of x.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
BVH_ALWAYS_INLINE Vec< T, 3 > cross(const Vec< T, 3 > &a, const Vec< T, 3 > &b)