148 for (
Int_t i=0; i<8; i++) {
165 for (
Int_t i=0; i<8; i++) {
166 fXY[i][0] = vertices[2*i];
167 fXY[i][1] = vertices[2*i+1];
172 for (
Int_t i=0; i<8; i++) {
189 for (
Int_t i=0; i<8; i++) {
190 fXY[i][0] = vertices[2*i];
191 fXY[i][1] = vertices[2*i+1];
196 for (
Int_t i=0; i<8; i++) {
210 for(
Int_t i=0; i<8; i++) {
226 for(
Int_t i=0; i<8; i++) {
263 for (i=0; i<4; i++) {
265 capacity += 0.25*
fDz*((
fXY[i][0]+
fXY[i+4][0])*(
fXY[j][1]+
fXY[j+4][1]) -
267 (1./3)*((
fXY[i+4][0]-
fXY[i][0])*(
fXY[j+4][1]-
fXY[j][1]) -
282 for (
Int_t i=1; i<8; i++) {
310 for (i=0; i<4; i++) {
311 dx1 =
fXY[(i+1)%4][0]-
fXY[i][0];
312 dy1 =
fXY[(i+1)%4][1]-
fXY[i][1];
318 dx2 =
fXY[4+(i+1)%4][0]-
fXY[4+i][0];
319 dy2 =
fXY[4+(i+1)%4][1]-
fXY[4+i][1];
325 twist[i] = dy1*dx2 - dx1*dy2;
337 for (i=0; i<4; i++) {
338 fXY[i][0] += 1.E-8*
fXY[i+4][0];
339 fXY[i][1] += 1.E-8*
fXY[i+4][1];
343 for (i=0; i<4; i++) {
344 fXY[i+4][0] += 1.E-8*
fXY[i][0];
345 fXY[i+4][1] += 1.E-8*
fXY[i][1];
351 for (i=0; i<4; i++) {
354 sum2 +=
fXY[i+4][0]*
fXY[j+4][1]-
fXY[j+4][0]*
fXY[i+4][1];
357 Fatal(
"ComputeTwist",
"Shape %s type Arb8: Lower/upper faces defined with opposite clockwise",
GetName());
361 Error(
"ComputeTwist",
"Shape %s type Arb8: Vertices must be defined clockwise in XY planes. Re-ordering...",
GetName());
384 Error(
"ComputeTwist",
"Shape %s type Arb8: Malformed polygon with crossing opposite segments",
GetName());
394 return (!
fTwist || iseg<0 || iseg>3) ? 0. :
fTwist[iseg];
408 Double_t lsq, ssq, dx, dy, dpx, dpy, u;
411 for (i1=0; i1<4; i1++) {
418 p1[1] = vert[2*i1+1];
420 p2[1] = vert[2*i2+1];
423 dpx = point[0] - p1[0];
424 dpy = point[1] - p1[1];
428 ssq = dpx*dpx + dpy*dpy;
437 u = (dpx*dx + dpy*dy)/lsq;
441 dpx = point[0]-p2[0];
442 dpy = point[1]-p2[1];
454 ssq = dpx*dpx + dpy*dpy;
478 norm[2] = (dir[2]>0)?1:(-1);
486 if (frac<0) frac = 0.;
487 Int_t jseg = (iseg+1)%4;
499 x1 += frac*(
fXY[jseg+4][0]-
x1);
500 y1 += frac*(
fXY[jseg+4][1]-y1);
509 norm[0] = ay*bz-az*by;
510 norm[1] = az*bx-ax*bz;
511 norm[2] = ax*by-ay*bx;
512 fn =
TMath::Sqrt(norm[0]*norm[0]+norm[1]*norm[1]+norm[2]*norm[2]);
524 if (dir[0]>-2. && dir[0]*norm[0]+dir[1]*norm[1]+dir[2]*norm[2] < 0) {
544 for (i=0; i<4; i++) {
545 poly[2*i] =
fXY[i+4][0]+cf*(
fXY[i][0]-
fXY[i+4][0]);
546 poly[2*i+1] =
fXY[i+4][1]+cf*(
fXY[i][1]-
fXY[i+4][1]);
589 Double_t a=(dtx*dir[1]-dty*dir[0]+(tx1*ty2-tx2*ty1)*dir[2])*dir[2];
591 Double_t b=dxs*dir[1]-dys*dir[0]+(dtx*point[1]-dty*point[0]+ty2*xs1-ty1*xs2
592 +tx1*ys2-tx2*ys1)*dir[2];
593 Double_t c=dxs*point[1]-dys*point[0]+xs1*ys2-xs2*ys1;
601 memcpy(dirp,dir,3*
sizeof(
Double_t));
604 ((
TGeoArb8*)
this)->ComputeNormal(point,dirp,norm);
605 ndotd = dir[0]*norm[0]+dir[1]*norm[1]+dir[2]*norm[2];
609 zi = (point[0]-xs1)*(point[0]-xs2)+(point[1]-ys1)*(point[1]-ys2);
622 memcpy(dirp,dir,3*
sizeof(
Double_t));
625 ((
TGeoArb8*)
this)->ComputeNormal(point,dirp,norm);
626 ndotd = dir[0]*norm[0]+dir[1]*norm[1]+dir[2]*norm[2];
633 zi=point[2]+
s*dir[2];
637 xp=point[0]+
s*dir[0];
640 yp=point[1]+
s*dir[1];
641 zi = (xp-
x1)*(xp-
x2)+(yp-y1)*(yp-y2);
648 memcpy(dirp,dir,3*
sizeof(
Double_t));
651 ((
TGeoArb8*)
this)->ComputeNormal(point,dirp,norm);
652 ndotd = dir[0]*norm[0]+dir[1]*norm[1]+dir[2]*norm[2];
661 zi=point[2]+
s*dir[2];
665 xp=point[0]+
s*dir[0];
668 yp=point[1]+
s*dir[1];
669 zi = (xp-
x1)*(xp-
x2)+(yp-y1)*(yp-y2);
687 if (point[2]*dir[2]<0) {
697 for (
Int_t i=0; i<4; i++) {
715 distz=(-
fDz-point[2])/dir[2];
718 if (dir[2]>0) distz=(
fDz-point[2])/dir[2];
721 for (i=0; i<4; i++) {
726 pt[0] = point[0]+distz*dir[0];
727 pt[1] = point[1]+distz*dir[1];
731 if (dist<0 || dist>1.E10)
return 0.;
743 distmin=(-
fDz-point[2])/dir[2];
745 if (dir[2]>0) distmin =(
fDz-point[2])/dir[2];
752 for (
Int_t ipl=0;ipl<4;ipl++) {
776 Double_t a=(dtx*dir[1]-dty*dir[0]+(tx1*ty2-tx2*ty1)*dir[2])*dir[2];
777 Double_t b=dxs*dir[1]-dys*dir[0]+(dtx*point[1]-dty*point[0]+ty2*xs1-ty1*xs2
778 +tx1*ys2-tx2*ys1)*dir[2];
779 Double_t c=dxs*point[1]-dys*point[0]+xs1*ys2-xs2*ys1;
784 if (
s>eps &&
s < distmin) {
797 lateral_cross =
kTRUE;
802 if (
s>eps &&
s < distmin) {
804 lateral_cross =
kTRUE;
810 if (!lateral_cross) {
814 pt[0] = point[0]+distmin*dir[0];
815 pt[1] = point[1]+distmin*dir[1];
820 for (
Int_t j=0; j<4; j++) {
821 poly[2*j] =
fXY[j+i][0];
822 poly[2*j+1] =
fXY[j+i][1];
836 Error(
"Divide",
"Division of an arbitrary trapezoid not implemented");
867 for (i=0; i<8; i++) {
884 Error(
"GetFittingBox",
"cannot handle parametrized rotated volumes");
891 Error(
"GetFittingBox",
"wrong matrix - parametrized box is outside this");
896 dd[0] = parambox->
GetDX();
897 dd[1] = parambox->
GetDY();
898 dd[2] = parambox->
GetDZ();
903 Error(
"GetFittingBox",
"wrong matrix");
907 if (dd[0]>=0 && dd[1]>=0) {
919 for (
Int_t iaxis=0; iaxis<2; iaxis++) {
920 if (dd[iaxis]>=0)
continue;
922 for (
Int_t ivert=0; ivert<4; ivert++) {
942 for (i=0; i<3; i++) {
943 v1[i] = p2[i] - p1[i];
944 v2[i] = p3[i] - p1[i];
947 cross += norm[0]*norm[0];
949 cross += norm[1]*norm[1];
951 cross += norm[2]*norm[2];
954 for (i=0; i<3; i++) norm[i] *= cross;
1026 for (i=0; i<4; i++) {
1032 cross = (
x-
x1)*(y2-y1)-(
y-y1)*(
x2-
x1);
1033 if (cross<0)
return kFALSE;
1043 printf(
"*** Shape %s: TGeoArb8 ***\n",
GetName());
1044 if (
IsTwisted()) printf(
" = TWISTED\n");
1045 for (
Int_t ip=0; ip<8; ip++) {
1046 printf(
" point #%i : x=%11.5f y=%11.5f z=%11.5f\n",
1047 ip,
fXY[ip][0],
fXY[ip][1],
fDz*((ip<4)?-1:1));
1049 printf(
" Bounding box:\n");
1059 if (!in) safz = -safz;
1062 Double_t lsq, ssq, dx, dy, dpx, dpy, u;
1074 for (iseg=0; iseg<4; iseg++) {
1077 p2 = &vert[2*((iseg+1)%4)];
1080 dpx = point[0] - p1[0];
1081 dpy = point[1] - p1[1];
1083 lsq = dx*dx + dy*dy;
1084 u = (dpx*dx + dpy*dy)/lsq;
1086 dpx = point[0]-p2[0];
1087 dpy = point[1]-p2[1];
1094 ssq = dpx*dpx + dpy*dpy;
1101 if (umin<0) umin = 0.;
1103 isegmin = (isegmin+1)%4;
1107 Int_t i2 = (isegmin+1)%4;
1112 dx = dx1 + umin*(dx2-dx1);
1113 dy = dy1 + umin*(dy2-dy1);
1123 for (iseg=0; iseg<4; iseg++) saf[iseg+1] =
SafetyToFace(point,iseg,in);
1126 if (safe<0)
return 0.;
1137 Int_t ipln = (iseg+1)%4;
1139 vertices[0] =
fXY[iseg][0];
1140 vertices[1] =
fXY[iseg][1];
1143 vertices[3] =
fXY[ipln][0];
1144 vertices[4] =
fXY[ipln][1];
1147 vertices[6] =
fXY[ipln+4][0];
1148 vertices[7] =
fXY[ipln+4][1];
1151 vertices[9] =
fXY[iseg+4][0];
1152 vertices[10] =
fXY[iseg+4][1];
1165 safe = (point[0]-p1[0])*norm[0]+(point[1]-p1[1])*norm[1]+(point[2]-p1[2])*norm[2];
1166 if (in)
return (-safe);
1176 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
1177 out <<
" dz = " <<
fDz <<
";" << std::endl;
1178 out <<
" vert[0] = " <<
fXY[0][0] <<
";" << std::endl;
1179 out <<
" vert[1] = " <<
fXY[0][1] <<
";" << std::endl;
1180 out <<
" vert[2] = " <<
fXY[1][0] <<
";" << std::endl;
1181 out <<
" vert[3] = " <<
fXY[1][1] <<
";" << std::endl;
1182 out <<
" vert[4] = " <<
fXY[2][0] <<
";" << std::endl;
1183 out <<
" vert[5] = " <<
fXY[2][1] <<
";" << std::endl;
1184 out <<
" vert[6] = " <<
fXY[3][0] <<
";" << std::endl;
1185 out <<
" vert[7] = " <<
fXY[3][1] <<
";" << std::endl;
1186 out <<
" vert[8] = " <<
fXY[4][0] <<
";" << std::endl;
1187 out <<
" vert[9] = " <<
fXY[4][1] <<
";" << std::endl;
1188 out <<
" vert[10] = " <<
fXY[5][0] <<
";" << std::endl;
1189 out <<
" vert[11] = " <<
fXY[5][1] <<
";" << std::endl;
1190 out <<
" vert[12] = " <<
fXY[6][0] <<
";" << std::endl;
1191 out <<
" vert[13] = " <<
fXY[6][1] <<
";" << std::endl;
1192 out <<
" vert[14] = " <<
fXY[7][0] <<
";" << std::endl;
1193 out <<
" vert[15] = " <<
fXY[7][1] <<
";" << std::endl;
1194 out <<
" TGeoShape *" <<
GetPointerName() <<
" = new TGeoArb8(\"" <<
GetName() <<
"\", dz,vert);" << std::endl;
1204 for (
Int_t i=0; i<4; i++) {
1205 vertices[2*i] =
fXY[i+4][0]+cf*(
fXY[i][0]-
fXY[i+4][0]);
1206 vertices[2*i+1] =
fXY[i+4][1]+cf*(
fXY[i][1]-
fXY[i+4][1]);
1220 for (
Int_t i=0; i<8; i++) {
1221 fXY[i][0] = param[2*i+1];
1222 fXY[i][1] = param[2*i+2];
1233 for (
Int_t i=0; i<8; i++) {
1245 for (
Int_t i=0; i<8; i++) {
1257 if (vnum<0 || vnum >7) {
1258 Error(
"SetVertex",
"Invalid vertex number");
1280void TGeoArb8::Streamer(
TBuffer &R__b)
1384 fXY[0][0] = -dz*tx-
h1*ta1-bl1;
fXY[0][1] = -dz*ty-
h1;
1385 fXY[1][0] = -dz*tx+
h1*ta1-tl1;
fXY[1][1] = -dz*ty+
h1;
1386 fXY[2][0] = -dz*tx+
h1*ta1+tl1;
fXY[2][1] = -dz*ty+
h1;
1387 fXY[3][0] = -dz*tx-
h1*ta1+bl1;
fXY[3][1] = -dz*ty-
h1;
1388 fXY[4][0] = dz*tx-h2*ta2-bl2;
fXY[4][1] = dz*ty-h2;
1389 fXY[5][0] = dz*tx+h2*ta2-tl2;
fXY[5][1] = dz*ty+h2;
1390 fXY[6][0] = dz*tx+h2*ta2+tl2;
fXY[6][1] = dz*ty+h2;
1391 fXY[7][0] = dz*tx-h2*ta2+bl2;
fXY[7][1] = dz*ty-h2;
1393 if ((dz<0) || (
h1<0) || (bl1<0) || (tl1<0) ||
1394 (h2<0) || (bl2<0) || (tl2<0)) {
1420 for (
Int_t i=0; i<8; i++) {
1428 fXY[0][0] = -dz*tx-
h1*ta1-bl1;
fXY[0][1] = -dz*ty-
h1;
1429 fXY[1][0] = -dz*tx+
h1*ta1-tl1;
fXY[1][1] = -dz*ty+
h1;
1430 fXY[2][0] = -dz*tx+
h1*ta1+tl1;
fXY[2][1] = -dz*ty+
h1;
1431 fXY[3][0] = -dz*tx-
h1*ta1+bl1;
fXY[3][1] = -dz*ty-
h1;
1432 fXY[4][0] = dz*tx-h2*ta2-bl2;
fXY[4][1] = dz*ty-h2;
1433 fXY[5][0] = dz*tx+h2*ta2-tl2;
fXY[5][1] = dz*ty+h2;
1434 fXY[6][0] = dz*tx+h2*ta2+tl2;
fXY[6][1] = dz*ty+h2;
1435 fXY[7][0] = dz*tx-h2*ta2+bl2;
fXY[7][1] = dz*ty-h2;
1437 if ((dz<0) || (
h1<0) || (bl1<0) || (tl1<0) ||
1438 (h2<0) || (bl2<0) || (tl2<0)) {
1456 if (iact<3 && safe) {
1472 distmin=(-
fDz-point[2])/dir[2];
1474 if (dir[2]>0) distmin =(
fDz-point[2])/dir[2];
1479 for (
Int_t ipl=0;ipl<4;ipl++) {
1480 Int_t j = (ipl+1)%4;
1494 Double_t ddotn = -dir[0]*az*by + dir[1]*az*bx+dir[2]*(ax*by-ay*bx);
1495 if (ddotn<=0)
continue;
1496 Double_t saf = -(point[0]-xa)*az*by + (point[1]-ya)*az*bx + (point[2]+
fDz)*(ax*by-ay*bx);
1497 if (saf>=0.0)
return 0.0;
1499 if (
s<distmin) distmin=
s;
1509 if (iact<3 && safe) {
1527 snxt = -(
fDz+point[2])/dir[2];
1528 xnew = point[0] + snxt*dir[0];
1529 ynew = point[1] + snxt*dir[1];
1533 pts[j+1] =
fXY[i][1];
1539 snxt = (
fDz-point[2])/dir[2];
1540 xnew = point[0] + snxt*dir[0];
1541 ynew = point[1] + snxt*dir[1];
1544 pts[j] =
fXY[i+4][0];
1545 pts[j+1] =
fXY[i+4][1];
1561 for (i=0; i<4; i++) {
1576 ddotn = -dir[0]*az*by + dir[1]*az*bx+dir[2]*(ax*by-ay*bx);
1577 saf = (point[0]-xa)*az*by - (point[1]-ya)*az*bx - (point[2]+
fDz)*(ax*by-ay*bx);
1584 znew = point[2]+snxt*dir[2];
1586 xnew = point[0]+snxt*dir[0];
1587 ynew = point[1]+snxt*dir[1];
1598 if ((xnew-xs1)*(xs2-xnew)>=0)
return snxt;
1600 if ((ynew-ys1)*(ys2-ynew)>=0)
return snxt;
1606 if (ddotn>=0) exiting =
kTRUE;
1613 if (saf>0 && saf<safmin) exiting = (point[2]*dir[2] > 0)?
kTRUE:
kFALSE;
1635 Error(
"Divide",
"cannot divide trapezoids on other axis than Z");
1649 for (
Int_t idiv=0; idiv<ndiv; idiv++) {
1650 zmin = start+idiv*step;
1651 zmax = start+(idiv+1)*step;
1652 oz = start+idiv*step+step/2;
1658 for (
Int_t vert1=0; vert1<4; vert1++)
1659 ((
TGeoArb8*)shape)->SetVertex(vert1, points_lo[2*vert1]-ox, points_lo[2*vert1+1]-oy);
1660 for (
Int_t vert2=0; vert2<4; vert2++)
1661 ((
TGeoArb8*)shape)->SetVertex(vert2+4, points_hi[2*vert2]-ox, points_hi[2*vert2+1]-oy);
1678 Error(
"GetMakeRuntimeShape",
"invalid mother");
1703 return (
new TGeoTrap(dz,
fTheta,
fPhi,
h1, bl1, tl1,
fAlpha1, h2, bl2, tl2,
fAlpha2));
1719 for (i=0; i<4; i++) {
1743 norm[2] = ax*by-ay*bx;
1744 fn =
TMath::Sqrt(norm[0]*norm[0]+norm[1]*norm[1]+norm[2]*norm[2]);
1745 if (fn<1
E-10)
continue;
1746 saf[i] = (x0-point[0])*norm[0]+(y0-point[1])*norm[1]+(-
fDz-point[2])*norm[2];
1750 saf[i] = -saf[i]/fn;
1756 for (j=1;j<5;j++)
if (saf[j] <safe) safe = saf[j];
1760 for (j=1;j<5;j++)
if (saf[j] >safe) safe = saf[j];
1771 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
1772 out <<
" dz = " <<
fDz <<
";" << std::endl;
1773 out <<
" theta = " <<
fTheta <<
";" << std::endl;
1774 out <<
" phi = " <<
fPhi <<
";" << std::endl;
1775 out <<
" h1 = " <<
fH1<<
";" << std::endl;
1776 out <<
" bl1 = " <<
fBl1<<
";" << std::endl;
1777 out <<
" tl1 = " <<
fTl1<<
";" << std::endl;
1778 out <<
" alpha1 = " <<
fAlpha1 <<
";" << std::endl;
1779 out <<
" h2 = " <<
fH2 <<
";" << std::endl;
1780 out <<
" bl2 = " <<
fBl2<<
";" << std::endl;
1781 out <<
" tl2 = " <<
fTl2<<
";" << std::endl;
1782 out <<
" alpha2 = " <<
fAlpha2 <<
";" << std::endl;
1783 out <<
" TGeoShape *" <<
GetPointerName() <<
" = new TGeoTrap(\"" <<
GetName() <<
"\", dz,theta,phi,h1,bl1,tl1,alpha1,h2,bl2,tl2,alpha2);" << std::endl;
1877 :
TGeoTrap(dz, theta, phi,
h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2)
1889 for (i=0; i<4; i++) {
1898 for (i=4; i<8; i++) {
1905 if ((dz<0) || (
h1<0) || (bl1<0) || (tl1<0) ||
1916 :
TGeoTrap(
name, dz, theta, phi,
h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2)
1928 for (i=0; i<4; i++) {
1937 for (i=4; i<8; i++) {
1944 if ((dz<0) || (
h1<0) || (bl1<0) || (tl1<0) ||
1961 if (iact<3 && safe) {
1976 if (iact<3 && safe) {
1994 Error(
"GetMakeRuntimeShape",
"invalid mother");
2009 bl1 = ((
TGeoTrap*)mother)->GetBl1();
2013 bl2 = ((
TGeoTrap*)mother)->GetBl2();
2017 tl1 = ((
TGeoTrap*)mother)->GetTl1();
2021 tl2 = ((
TGeoTrap*)mother)->GetTl2();
2024 return (
new TGeoGtra(dz,
fTheta,
fPhi,
fTwistAngle ,
h1, bl1, tl1,
fAlpha1, h2, bl2, tl2,
fAlpha2));
2041 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
2042 out <<
" dz = " <<
fDz <<
";" << std::endl;
2043 out <<
" theta = " <<
fTheta <<
";" << std::endl;
2044 out <<
" phi = " <<
fPhi <<
";" << std::endl;
2045 out <<
" twist = " <<
fTwistAngle <<
";" << std::endl;
2046 out <<
" h1 = " <<
fH1<<
";" << std::endl;
2047 out <<
" bl1 = " <<
fBl1<<
";" << std::endl;
2048 out <<
" tl1 = " <<
fTl1<<
";" << std::endl;
2049 out <<
" alpha1 = " <<
fAlpha1 <<
";" << std::endl;
2050 out <<
" h2 = " <<
fH2 <<
";" << std::endl;
2051 out <<
" bl2 = " <<
fBl2<<
";" << std::endl;
2052 out <<
" tl2 = " <<
fTl2<<
";" << std::endl;
2053 out <<
" alpha2 = " <<
fAlpha2 <<
";" << std::endl;
2054 out <<
" TGeoShape *" <<
GetPointerName() <<
" = new TGeoGtra(\"" <<
GetName() <<
"\", dz,theta,phi,twist,h1,bl1,tl1,alpha1,h2,bl2,tl2,alpha2);" << std::endl;
2087 for (i=0; i<4; i++) {
2096 for (i=4; i<8; i++) {
static const double x2[5]
static const double x1[5]
R__EXTERN TGeoManager * gGeoManager
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
An arbitrary trapezoid with less than 8 vertices standing on two parallel planes perpendicular to Z a...
TGeoArb8 & operator=(const TGeoArb8 &)
Assignment operator.
virtual void SetVertex(Int_t vnum, Double_t x, Double_t y)
Set values for a given vertex.
virtual Bool_t GetPointsOnFacet(Int_t, Int_t, Double_t *) const
Fills array with n random points located on the surface of indexed facet.
virtual TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
Divide this shape along one axis.
Double_t GetClosestEdge(const Double_t *point, Double_t *vert, Int_t &isegment) const
Get index of the edge of the quadrilater represented by vert closest to point.
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const
Get shape range on a given axis.
Double_t fXY[8][2]
[4] tangents of twist angles
virtual void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specified by dirs. Store output in dist...
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
Computes the closest distance from given point to this shape.
void CopyTwist(Double_t *twist=nullptr)
Copy twist values from source array.
virtual ~TGeoArb8()
Destructor.
static void GetPlaneNormal(Double_t *p1, Double_t *p2, Double_t *p3, Double_t *norm)
Computes normal to plane defined by P1, P2 and P3.
virtual Bool_t Contains(const Double_t *point) const
Test if point is inside this shape.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual void SetPoints(Double_t *points) const
Creates arb8 mesh points.
virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
Computes distance from outside point to surface of the shape.
void ComputeTwist()
Computes tangents of twist angles (angles between projections on XY plane of corresponding -dz +dz ed...
virtual void Sizeof3D() const
Fill size of this 3-D object.
virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
Compute distance from inside point to surface of the shape.
Double_t DistToPlane(const Double_t *point, const Double_t *dir, Int_t ipl, Bool_t in) const
Computes distance to plane ipl :
virtual void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize)
Compute the normal for an array o points so that norm.dot.dir is positive Input: Arrays of point coor...
static Bool_t InsidePolygon(Double_t x, Double_t y, Double_t *pts)
Finds if a point in XY plane is inside the polygon defines by PTS.
virtual void ComputeBBox()
Computes bounding box for an Arb8 shape.
virtual void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const
Compute safe distance from each of the points in the input array.
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
Double_t SafetyToFace(const Double_t *point, Int_t iseg, Bool_t in) const
Estimate safety to lateral plane defined by segment iseg in range [0,3] Might be negative: plane seen...
TGeoArb8()
Default constructor.
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Compute normal to closest surface from POINT.
virtual void GetBoundingCylinder(Double_t *param) const
Fill vector param[4] with the bounding cylinder parameters.
Double_t GetTwist(Int_t iseg) const
Get twist for segment I in range [0,3].
static Bool_t IsSamePoint(const Double_t *p1, const Double_t *p2)
virtual void SetDimensions(Double_t *param)
Set all arb8 params in one step.
void SetPlaneVertices(Double_t zpl, Double_t *vertices) const
Computes intersection points between plane at zpl and non-horizontal edges.
virtual void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const
Check the inside status for each of the points in the array.
virtual void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specified by dirs. Store output in dist...
virtual void InspectShape() const
Prints shape parameters.
virtual Int_t GetFittingBox(const TGeoBBox *parambox, TGeoMatrix *mat, Double_t &dx, Double_t &dy, Double_t &dz) const
Fills real parameters of a positioned box inside this arb8. Returns 0 if successful.
virtual const Double_t * GetOrigin() const
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
Computes the closest distance from given point to this shape.
virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
Compute distance from outside point to surface of the box.
virtual void InspectShape() const
Prints shape parameters.
virtual Double_t GetDX() const
virtual Double_t GetDZ() const
virtual void Sizeof3D() const
virtual Double_t GetDY() const
virtual Bool_t Contains(const Double_t *point) const
Test if point is inside this shape.
Gtra is a twisted trapezoid.
virtual void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const
Compute safe distance from each of the points in the input array.
virtual ~TGeoGtra()
Destructor.
virtual TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const
In case shape has some negative parameters, these has to be computed in order to fit the mother.
virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
Compute distance from inside point to surface of the shape.
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
Computes the closest distance from given point to this shape.
virtual void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specified by dirs. Store output in dist...
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
Compute distance from inside point to surface of the shape.
virtual void SetDimensions(Double_t *param)
Set all arb8 params in one step.
virtual void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specified by dirs. Store output in dist...
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
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
Node containing an offset.
Base finder class for patterns.
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.
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.
virtual const char * GetName() const
Get the shape name.
static Double_t Tolerance()
Bool_t TestShapeBit(UInt_t f) const
TRAP is a general trapezoid, i.e.
virtual void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specified by dirs. Store output in dist...
virtual TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
Divide this trapezoid shape belonging to volume "voldiv" into ndiv volumes called divname,...
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual TGeoShape * GetMakeRuntimeShape(TGeoShape *mother, TGeoMatrix *mat) const
In case shape has some negative parameters, these have to be computed in order to fit the mother.
virtual void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const
Compute safe distance from each of the points in the input array.
virtual Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
Compute distance from inside point to surface of the trapezoid.
virtual void SetDimensions(Double_t *param)
Set all arb8 params in one step.
virtual ~TGeoTrap()
Destructor.
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
Computes the closest distance from given point to this shape.
virtual void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const
Compute distance from array of input points having directions specified by dirs. Store output in dist...
virtual Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=0) const
Compute distance from outside point to surface of the trapezoid.
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
virtual void SetName(const char *name)
Set the name of the TNamed.
TNamed & operator=(const TNamed &rhs)
TNamed assignment operator.
TObject * At(Int_t idx) const
R__ALWAYS_INLINE 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)
static constexpr double s
Long64_t LocMin(Long64_t n, const T *a)
Return index of array with the minimum element.
Short_t Max(Short_t a, Short_t b)
Long64_t LocMax(Long64_t n, const T *a)
Return index of array with the maximum element.
constexpr Double_t E()
Base of natural log:
constexpr Double_t DegToRad()
Conversion from degree to radian:
Double_t Sqrt(Double_t x)
Short_t Min(Short_t a, Short_t b)
#define snext(osub1, osub2)