222 Double_t rsq = point[0]*point[0]+point[1]*point[1];
229 norm[0] = norm[1] = 0.;
237 if (norm[0]*dir[0]+norm[1]*dir[1]<0) {
253 if (norm[0]*dir[0]+norm[1]*dir[1]<0) {
265 Double_t r2 = point[0]*point[0]+point[1]*point[1];
277 if (!
HasRmin()) numPoints = 2*(n+1);
292 if (sz<=0)
return 0.0;
295 Double_t nsq=dir[0]*dir[0]+dir[1]*dir[1];
297 Double_t rsq=point[0]*point[0]+point[1]*point[1];
298 Double_t rdotn=point[0]*dir[0]+point[1]*dir[1];
305 if (rdotn<0)
return 0.0;
318 if (rdotn>=0)
return 0.0;
334 if (iact<3 && safe) {
360 xi = point[0]+s*dir[0];
361 yi = point[1]+s*dir[1];
363 if ((rminsq<=r2) && (r2<=rmaxsq))
return s;
366 Double_t rsq = point[0]*point[0]+point[1]*point[1];
368 Double_t nsq=dir[0]*dir[0]+dir[1]*dir[1];
369 Double_t rdotn=point[0]*dir[0]+point[1]*dir[1];
375 in = inz & inrmin & inrmax;
382 if (point[2]*dir[2]<0)
return 0.0;
386 if ((rmaxsq-rsq) < (rsq-rminsq)) checkout =
kTRUE;
392 if (rdotn>=0)
return 0.0;
399 zi=point[2]+s*dir[2];
400 if (TMath::Abs(zi)<=dz)
return s;
412 zi=point[2]+s*dir[2];
413 if (TMath::Abs(zi)<=dz)
return s;
423 zi=point[2]+s*dir[2];
424 if (TMath::Abs(zi)<=dz)
return s;
438 if (iact<3 && safe) {
498 for (
id=0;
id<ndiv;
id++) {
499 shape =
new TGeoTube(start+
id*step, start+(
id+1)*step,
fDz);
514 vmulti->AddVolume(vol);
516 for (
id=0;
id<ndiv;
id++) {
522 finder =
new TGeoPatternZ(voldiv, ndiv, start, start+ndiv*step);
528 vmulti->AddVolume(vol);
530 for (
id=0;
id<ndiv;
id++) {
536 Error(
"Divide",
"In shape %s wrong axis type for division",
GetName());
593 param[0] *= param[0];
595 param[1] *= param[1];
614 if (xmax<0)
return 0;
619 if (xmin<0)
return 0;
623 if (xmax<=0)
return 0;
635 printf(
"*** Shape %s: TGeoTube ***\n",
GetName());
636 printf(
" Rmin = %11.5f\n",
fRmin);
637 printf(
" Rmax = %11.5f\n",
fRmax);
638 printf(
" dz = %11.5f\n",
fDz);
639 printf(
" Bounding box:\n");
659 nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols);
685 for (i = 0; i < 4; i++) {
686 for (j = 0; j <
n; j++) {
688 buffer.
fSegs[indx ] = c;
689 buffer.
fSegs[indx+1] = i*n+j;
690 buffer.
fSegs[indx+2] = i*n+(j+1)%n;
696 for (i = 4; i < 6; i++) {
697 for (j = 0; j <
n; j++) {
699 buffer.
fSegs[indx ] = c+1;
700 buffer.
fSegs[indx+1] = (i-4)*n+j;
701 buffer.
fSegs[indx+2] = (i-2)*n+j;
707 for (i = 6; i < 8; i++) {
708 for (j = 0; j <
n; j++) {
710 buffer.
fSegs[indx ] = c;
711 buffer.
fSegs[indx+1] = 2*(i-6)*n+j;
712 buffer.
fSegs[indx+2] = (2*(i-6)+1)*n+j;
718 for (j = 0; j <
n; j++) {
720 buffer.
fPols[indx ] = c;
721 buffer.
fPols[indx+1] = 4;
722 buffer.
fPols[indx+2] = j;
723 buffer.
fPols[indx+3] = 4*n+(j+1)%n;
724 buffer.
fPols[indx+4] = 2*n+j;
725 buffer.
fPols[indx+5] = 4*n+j;
729 for (j = 0; j <
n; j++) {
731 buffer.
fPols[indx ] = c+1;
732 buffer.
fPols[indx+1] = 4;
733 buffer.
fPols[indx+2] = n+j;
734 buffer.
fPols[indx+3] = 5*n+j;
735 buffer.
fPols[indx+4] = 3*n+j;
736 buffer.
fPols[indx+5] = 5*n+(j+1)%n;
740 for (j = 0; j <
n; j++) {
742 buffer.
fPols[indx ] = c;
743 buffer.
fPols[indx+1] = 4;
744 buffer.
fPols[indx+2] = j;
745 buffer.
fPols[indx+3] = 6*n+j;
746 buffer.
fPols[indx+4] = n+j;
747 buffer.
fPols[indx+5] = 6*n+(j+1)%n;
751 for (j = 0; j <
n; j++) {
753 buffer.
fPols[indx ] = c;
754 buffer.
fPols[indx+1] = 4;
755 buffer.
fPols[indx+2] = 2*n+j;
756 buffer.
fPols[indx+3] = 7*n+(j+1)%n;
757 buffer.
fPols[indx+4] = 3*n+j;
758 buffer.
fPols[indx+5] = 7*n+j;
766 for (i = 0; i < 2; i++) {
767 for (j = 0; j <
n; j++) {
769 buffer.
fSegs[indx ] = c;
770 buffer.
fSegs[indx+1] = 2+i*n+j;
771 buffer.
fSegs[indx+2] = 2+i*n+(j+1)%n;
775 for (j = 0; j <
n; j++) {
777 buffer.
fSegs[indx ] = c+1;
778 buffer.
fSegs[indx+1] = 2+j;
779 buffer.
fSegs[indx+2] = 2+n+j;
784 for (i = 3; i < 5; i++) {
785 for (j = 0; j <
n; j++) {
787 buffer.
fSegs[indx ] = c;
788 buffer.
fSegs[indx+1] = i-3;
789 buffer.
fSegs[indx+2] = 2+(i-3)*n+j;
794 for (j = 0; j <
n; j++) {
796 buffer.
fPols[indx ] = c+1;
797 buffer.
fPols[indx+1] = 4;
798 buffer.
fPols[indx+2] = j;
799 buffer.
fPols[indx+3] = 2*n+j;
800 buffer.
fPols[indx+4] = n+j;
801 buffer.
fPols[indx+5] = 2*n+(j+1)%n;
804 for (j = 0; j <
n; j++) {
806 buffer.
fPols[indx ] = c;
807 buffer.
fPols[indx+1] = 3;
808 buffer.
fPols[indx+2] = j;
809 buffer.
fPols[indx+3] = 3*n+(j+1)%n;
810 buffer.
fPols[indx+4] = 3*n+j;
813 for (j = 0; j <
n; j++) {
814 indx = 6*n + 5*n + 5*j;
815 buffer.
fPols[indx ] = c;
816 buffer.
fPols[indx+1] = 3;
817 buffer.
fPols[indx+2] = n+j;
818 buffer.
fPols[indx+3] = 4*n+j;
819 buffer.
fPols[indx+4] = 4*n+(j+1)%n;
836 if (safrmin < safe) safe = safrmin;
839 if (safrmax < safe) safe = safrmax;
844 if (safrmin > safe) safe = safrmin;
847 if (safrmax > safe) safe = safrmax;
852 Double_t rsq = point[0]*point[0]+point[1]*point[1];
858 for (
Int_t i=0; i<3; i++) saf[i]=-saf[i];
870 Double_t rsq = point[0]*point[0]+point[1]*point[1];
874 saf[0] = dz - point[2];
877 saf[0] = dz + point[2];
889 for (
Int_t i=0; i<3; i++) saf[i]=-saf[i];
900 out <<
" rmin = " <<
fRmin <<
";" << std::endl;
901 out <<
" rmax = " <<
fRmax <<
";" << std::endl;
902 out <<
" dz = " <<
fDz <<
";" << std::endl;
903 out <<
" TGeoShape *" <<
GetPointerName() <<
" = new TGeoTube(\"" <<
GetName() <<
"\",rmin,rmax,dz);" << std::endl;
916 Error(
"SetTubeDimensions",
"In shape %s wrong rmin=%g rmax=%g",
GetName(), rmin,rmax);
937 if (npoints > (npoints/2)*2) {
938 Error(
"GetPointsOnSegments",
"Npoints must be even number");
947 if (
HasRmin()) ntop = npoints/2 - nc*(nc-1);
948 else ntop = npoints - nc*(nc-1);
954 for (
Int_t i=0; i<nc; i++) {
955 if (i == (nc-1)) nphi = ntop;
958 for (
Int_t j=0; j<nphi; j++) {
990 for (j = 0; j <
n; j++) {
996 points[indx+6*
n] = dz;
1002 for (j = 0; j <
n; j++) {
1008 points[indx+6*
n]= dz;
1014 points[indx++] = 0.;
1015 points[indx++] = 0.;
1016 points[indx++] = -dz;
1017 points[indx++] = 0.;
1018 points[indx++] = 0.;
1019 points[indx++] = dz;
1022 for (j = 0; j <
n; j++) {
1028 points[indx+3*
n]= dz;
1053 for (j = 0; j <
n; j++) {
1059 points[indx+6*
n] = dz;
1065 for (j = 0; j <
n; j++) {
1071 points[indx+6*
n]= dz;
1077 points[indx++] = 0.;
1078 points[indx++] = 0.;
1079 points[indx++] = -dz;
1080 points[indx++] = 0.;
1081 points[indx++] = 0.;
1082 points[indx++] = dz;
1085 for (j = 0; j <
n; j++) {
1091 points[indx+3*
n]= dz;
1105 Int_t numPoints = n*4;
1106 if (!
HasRmin()) numPoints = 2*(n+1);
1161 if (buffer.
SetRawSizes(nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols)) {
1184 for (
Int_t i=0; i<vecsize; i++) inside[i] =
Contains(&points[3*i]);
1194 for (
Int_t i=0; i<vecsize; i++)
ComputeNormal(&points[3*i], &dirs[3*i], &norms[3*i]);
1202 for (
Int_t i=0; i<vecsize; i++) dists[i] =
DistFromInside(&points[3*i], &dirs[3*i], 3, step[i]);
1210 for (
Int_t i=0; i<vecsize; i++) dists[i] =
DistFromOutside(&points[3*i], &dirs[3*i], 3, step[i]);
1220 for (
Int_t i=0; i<vecsize; i++) safe[i] =
Safety(&points[3*i], inside[i]);
1230 fPhi1(0.), fPhi2(0.), fS1(0.), fC1(0.), fS2(0.), fC2(0.), fSm(0.), fCm(0.), fCdfi(0.)
1242 fPhi1(0.), fPhi2(0.), fS1(0.), fC1(0.), fS2(0.), fC2(0.), fSm(0.), fCm(0.), fCdfi(0.)
1352 if (ddp<0) ddp+= 360;
1353 if (ddp>360) ddp-=360;
1354 if (ddp<=dp) xmax =
fRmax;
1356 if (ddp<0) ddp+= 360;
1357 if (ddp>360) ddp-=360;
1358 if (ddp<=dp) ymax =
fRmax;
1360 if (ddp<0) ddp+= 360;
1361 if (ddp>360) ddp-=360;
1362 if (ddp<=dp) xmin = -
fRmax;
1364 if (ddp<0) ddp+= 360;
1365 if (ddp>360) ddp-=360;
1366 if (ddp<=dp) ymin = -
fRmax;
1381 Double_t rsq = point[0]*point[0]+point[1]*point[1];
1392 norm[0] = norm[1] = 0.;
1400 if (norm[0]*dir[0]+norm[1]*dir[1]<0) {
1414 Double_t rsq = point[0]*point[0]+point[1]*point[1];
1427 if (norm[0]*dir[0]+norm[1]*dir[1]<0) {
1449 const Int_t numPoints = 4*
n;
1462 if (stube<=0)
return 0.0;
1464 Double_t rsq = point[0]*point[0]+point[1]*point[1];
1466 Double_t cpsi=point[0]*cm+point[1]*sm;
1475 ddotn = s1*dir[0]-c1*dir[1];
1476 if (ddotn>=0)
return 0.0;
1477 ddotn = -s2*dir[0]+c2*dir[1];
1478 if (ddotn<=0)
return stube;
1479 sfmin = s2*point[0]-c2*point[1];
1480 if (sfmin<=0)
return stube;
1482 if (sfmin >= stube)
return stube;
1483 xi = point[0]+sfmin*dir[0];
1484 yi = point[1]+sfmin*dir[1];
1485 if (yi*cm-xi*sm<0)
return stube;
1488 ddotn = -s2*dir[0]+c2*dir[1];
1489 if (ddotn>=0)
return 0.0;
1490 ddotn = s1*dir[0]-c1*dir[1];
1491 if (ddotn<=0)
return stube;
1492 sfmin = -s1*point[0]+c1*point[1];
1493 if (sfmin<=0)
return stube;
1495 if (sfmin >= stube)
return stube;
1496 xi = point[0]+sfmin*dir[0];
1497 yi = point[1]+sfmin*dir[1];
1498 if (yi*cm-xi*sm>0)
return stube;
1508 if (iact<3 && safe) {
1516 return TGeoTubeSeg::DistFromInsideS(point,dir,
fRmin,
fRmax,
fDz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdfi);
1540 xi = point[0]+s*dir[0];
1541 yi = point[1]+s*dir[1];
1543 if ((rminsq<=r2) && (r2<=rmaxsq)) {
1545 if (cpsi>=cdfi)
return s;
1550 Double_t rsq = point[0]*point[0]+point[1]*point[1];
1552 Double_t nsq=dir[0]*dir[0]+dir[1]*dir[1];
1553 Double_t rdotn=point[0]*dir[0]+point[1]*dir[1];
1560 cpsi=point[0]*cm+point[1]*sm;
1562 in = inz & inrmin & inrmax & inphi;
1572 if (point[2]*dir[2]<0)
return 0.0;
1577 if ((rmaxsq-rsq) < (rsq-rminsq)) checkout =
kTRUE;
1579 if (checkout && (rmax-r<safphi)) {
1589 if (TMath::Abs(point[1]-s1*r) < TMath::Abs(point[1]-s2*r)) {
1590 un = dir[0]*s1-dir[1]*
c1;
1591 if (un < 0)
return 0.0;
1593 un = -dir[0]*s2+dir[1]*
c2;
1595 s = -point[0]*s2+point[1]*
c2;
1598 zi = point[2]+s*dir[2];
1599 if (TMath::Abs(zi)<=dz) {
1600 xi = point[0]+s*dir[0];
1601 yi = point[1]+s*dir[1];
1603 if ((rminsq<=r2) && (r2<=rmaxsq)) {
1604 if ((yi*cm-xi*sm)>0)
return s;
1610 un = -dir[0]*s2+dir[1]*
c2;
1611 if (un < 0)
return 0.0;
1613 un = dir[0]*s1-dir[1]*
c1;
1615 s = point[0]*s1-point[1]*
c1;
1618 zi = point[2]+s*dir[2];
1619 if (TMath::Abs(zi)<=dz) {
1620 xi = point[0]+s*dir[0];
1621 yi = point[1]+s*dir[1];
1623 if ((rminsq<=r2) && (r2<=rmaxsq)) {
1624 if ((yi*cm-xi*sm)<0)
return s;
1637 zi=point[2]+s*dir[2];
1638 if (TMath::Abs(zi)<=dz) {
1639 xi=point[0]+s*dir[0];
1640 yi=point[1]+s*dir[1];
1641 if ((xi*cm+yi*sm) >= rmin*cdfi)
return s;
1648 if (rdotn>=0)
return 0.0;
1653 zi=point[2]+s*dir[2];
1654 if (TMath::Abs(zi)<=dz) {
1656 xi=point[0]+s*dir[0];
1657 yi=point[1]+s*dir[1];
1659 if ((xi*cm+yi*sm) >= rmin*cdfi)
return s;
1663 s=point[0]*s1-point[1]*
c1;
1666 zi=point[2]+s*dir[2];
1667 if (TMath::Abs(zi)<=dz) {
1668 xi=point[0]+s*dir[0];
1669 yi=point[1]+s*dir[1];
1671 if ((rminsq<=r2) && (r2<=rmaxsq)) {
1672 if ((yi*cm-xi*sm)<=0) {
1679 un=dir[0]*s2-dir[1]*
c2;
1681 s=(point[1]*c2-point[0]*s2)/un;
1682 if (s>=0 && s<snxt) {
1683 zi=point[2]+s*dir[2];
1684 if (TMath::Abs(zi)<=dz) {
1685 xi=point[0]+s*dir[0];
1686 yi=point[1]+s*dir[1];
1688 if ((rminsq<=r2) && (r2<=rmaxsq)) {
1689 if ((yi*cm-xi*sm)>=0) {
1704 if (rsq>=rmax*rmax) {
1710 zi=point[2]+s*dir[2];
1711 if (TMath::Abs(zi)<=dz) {
1712 xi=point[0]+s*dir[0];
1713 yi=point[1]+s*dir[1];
1715 if (cpsi>=rmax*cdfi)
return s;
1726 zi=point[2]+s*dir[2];
1727 if (TMath::Abs(zi)<=dz) {
1728 xi=point[0]+s*dir[0];
1729 yi=point[1]+s*dir[1];
1731 if (cpsi>=rmin*cdfi) snxt=s;
1739 s=point[0]*s1-point[1]*
c1;
1742 zi=point[2]+s*dir[2];
1743 if (TMath::Abs(zi)<=dz) {
1744 xi=point[0]+s*dir[0];
1745 yi=point[1]+s*dir[1];
1747 if ((rminsq<=r2) && (r2<=rmaxsq)) {
1748 if ((yi*cm-xi*sm)<=0) {
1755 un=dir[0]*s2-dir[1]*
c2;
1757 s=point[1]*c2-point[0]*s2;
1760 zi=point[2]+s*dir[2];
1761 if (TMath::Abs(zi)<=dz) {
1762 xi=point[0]+s*dir[0];
1763 yi=point[1]+s*dir[1];
1765 if ((rminsq<=r2) && (r2<=rmaxsq)) {
1766 if ((yi*cm-xi*sm)>=0) {
1782 if (iact<3 && safe) {
1793 return TGeoTubeSeg::DistFromOutsideS(point, dir,
fRmin,
fRmax,
fDz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdfi);
1821 for (
id=0;
id<ndiv;
id++) {
1832 if (dphi<0) dphi+=360.;
1833 if (step<=0) {step=dphi/ndiv; start=
fPhi1; end=
fPhi2;}
1840 vmulti->AddVolume(vol);
1842 for (
id=0;
id<ndiv;
id++) {
1854 vmulti->AddVolume(vol);
1856 for (
id=0;
id<ndiv;
id++) {
1862 Error(
"Divide",
"In shape %s wrong axis type for division",
GetName());
1902 param[0] *= param[0];
1904 param[1] *= param[1];
1917 Error(
"GetMakeRuntimeShape",
"Invalid mother for shape %s",
GetName());
1926 rmin = ((
TGeoTube*)mother)->GetRmin();
1928 rmax = ((
TGeoTube*)mother)->GetRmax();
1938 printf(
"*** Shape %s: TGeoTubeSeg ***\n",
GetName());
1939 printf(
" Rmin = %11.5f\n",
fRmin);
1940 printf(
" Rmax = %11.5f\n",
fRmax);
1941 printf(
" dz = %11.5f\n",
fDz);
1942 printf(
" phi1 = %11.5f\n",
fPhi1);
1943 printf(
" phi2 = %11.5f\n",
fPhi2);
1944 printf(
" Bounding box:\n");
1956 Int_t nbSegs = 2*nbPnts;
1957 Int_t nbPols = nbPnts-2;
1960 nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols);
1980 for (i = 0; i < 4; i++) {
1981 for (j = 1; j <
n; j++) {
1982 buff.
fSegs[(i*n+j-1)*3 ] = c;
1983 buff.
fSegs[(i*n+j-1)*3+1] = i*n+j-1;
1984 buff.
fSegs[(i*n+j-1)*3+2] = i*n+j;
1987 for (i = 4; i < 6; i++) {
1988 for (j = 0; j <
n; j++) {
1989 buff.
fSegs[(i*n+j)*3 ] = c+1;
1990 buff.
fSegs[(i*n+j)*3+1] = (i-4)*n+j;
1991 buff.
fSegs[(i*n+j)*3+2] = (i-2)*n+j;
1994 for (i = 6; i < 8; i++) {
1995 for (j = 0; j <
n; j++) {
1996 buff.
fSegs[(i*n+j)*3 ] = c;
1997 buff.
fSegs[(i*n+j)*3+1] = 2*(i-6)*n+j;
1998 buff.
fSegs[(i*n+j)*3+2] = (2*(i-6)+1)*n+j;
2005 for (j = 0; j < n-1; j++) {
2006 buff.
fPols[indx++] = c;
2007 buff.
fPols[indx++] = 4;
2008 buff.
fPols[indx++] = (4+i)*n+j+1;
2009 buff.
fPols[indx++] = (2+i)*n+j;
2010 buff.
fPols[indx++] = (4+i)*n+j;
2011 buff.
fPols[indx++] = i*n+j;
2014 for (j = 0; j < n-1; j++) {
2015 buff.
fPols[indx++] = c;
2016 buff.
fPols[indx++] = 4;
2017 buff.
fPols[indx++] = i*n+j;
2018 buff.
fPols[indx++] = (4+i)*n+j;
2019 buff.
fPols[indx++] = (2+i)*n+j;
2020 buff.
fPols[indx++] = (4+i)*n+j+1;
2023 for (j = 0; j < n-1; j++) {
2024 buff.
fPols[indx++] = c+i;
2025 buff.
fPols[indx++] = 4;
2026 buff.
fPols[indx++] = (i-2)*2*n+j;
2027 buff.
fPols[indx++] = (4+i)*n+j;
2028 buff.
fPols[indx++] = ((i-2)*2+1)*n+j;
2029 buff.
fPols[indx++] = (4+i)*n+j+1;
2032 for (j = 0; j < n-1; j++) {
2033 buff.
fPols[indx++] = c+i;
2034 buff.
fPols[indx++] = 4;
2035 buff.
fPols[indx++] = (4+i)*n+j+1;
2036 buff.
fPols[indx++] = ((i-2)*2+1)*n+j;
2037 buff.
fPols[indx++] = (4+i)*n+j;
2038 buff.
fPols[indx++] = (i-2)*2*n+j;
2040 buff.
fPols[indx++] = c+2;
2041 buff.
fPols[indx++] = 4;
2042 buff.
fPols[indx++] = 6*
n;
2043 buff.
fPols[indx++] = 4*
n;
2044 buff.
fPols[indx++] = 7*
n;
2045 buff.
fPols[indx++] = 5*
n;
2046 buff.
fPols[indx++] = c+2;
2047 buff.
fPols[indx++] = 4;
2048 buff.
fPols[indx++] = 6*n-1;
2049 buff.
fPols[indx++] = 8*n-1;
2050 buff.
fPols[indx++] = 5*n-1;
2051 buff.
fPols[indx++] = 7*n-1;
2062 Double_t rsq = point[0]*point[0]+point[1]*point[1];
2089 saf[1] =
fRmin-rproj;
2090 saf[2] = rproj-
fRmax;
2096 return (saf[0]<0) ? safe :
TMath::Sqrt(safe*safe+saf[0]*saf[0]);
2099 return (saf[0]<0) ? safphi :
TMath::Sqrt(saf[0]*saf[0]+safphi*safphi);
2110 Double_t rsq = point[0]*point[0]+point[1]*point[1];
2115 saf[0] = dz - point[2];
2118 saf[0] = dz + point[2];
2131 if ((phi2d-phi1d)>=360.)
return safe;
2144 Double_t cpsi=point[0]*cm+point[1]*sm;
2164 saf[1] = rmin-rproj;
2165 saf[2] = rproj-rmax;
2167 if ((phi2d-phi1d)>=360.)
return TMath::Max(safe,saf[0]);
2171 return (saf[0]<0) ? safe :
TMath::Sqrt(safe*safe+saf[0]*saf[0]);
2174 return (saf[0]<0) ? safphi :
TMath::Sqrt(saf[0]*saf[0]+safphi*safphi);
2183 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
2184 out <<
" rmin = " <<
fRmin <<
";" << std::endl;
2185 out <<
" rmax = " <<
fRmax <<
";" << std::endl;
2186 out <<
" dz = " <<
fDz <<
";" << std::endl;
2187 out <<
" phi1 = " <<
fPhi1 <<
";" << std::endl;
2188 out <<
" phi2 = " <<
fPhi2 <<
";" << std::endl;
2189 out <<
" TGeoShape *" <<
GetPointerName() <<
" = new TGeoTubeSeg(\"" <<
GetName() <<
"\",rmin,rmax,dz,phi1,phi2);" << std::endl;
2231 if (npoints > (npoints/2)*2) {
2232 Error(
"GetPointsOnSegments",
"Npoints must be even number");
2239 Int_t ntop = npoints/2 - nc*(nc-1);
2245 for (
Int_t i=0; i<nc; i++) {
2248 dphi = (
fPhi2-
fPhi1)*TMath::DegToRad()/(nphi-1);
2252 for (
Int_t j=0; j<nphi; j++) {
2253 phi = phi1 + j*dphi;
2275 if (phi2<phi1) phi2+=360.;
2278 dphi = (phi2-phi1)/(n-1);
2284 for (j = 0; j <
n; j++) {
2290 points[indx+6*
n] = dz;
2294 for (j = 0; j <
n; j++) {
2300 points[indx+6*
n]= dz;
2317 if (phi2<phi1) phi2+=360.;
2320 dphi = (phi2-phi1)/(n-1);
2326 for (j = 0; j <
n; j++) {
2332 points[indx+6*
n] = dz;
2336 for (j = 0; j <
n; j++) {
2342 points[indx+6*
n]= dz;
2366 Int_t numPoints = n*4;
2397 Int_t nbSegs = 2*nbPnts;
2398 Int_t nbPols = nbPnts-2;
2399 if (buffer.
SetRawSizes(nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols)) {
2422 for (
Int_t i=0; i<vecsize; i++) inside[i] =
Contains(&points[3*i]);
2432 for (
Int_t i=0; i<vecsize; i++)
ComputeNormal(&points[3*i], &dirs[3*i], &norms[3*i]);
2440 for (
Int_t i=0; i<vecsize; i++) dists[i] =
DistFromInside(&points[3*i], &dirs[3*i], 3, step[i]);
2448 for (
Int_t i=0; i<vecsize; i++) dists[i] =
DistFromOutside(&points[3*i], &dirs[3*i], 3, step[i]);
2458 for (
Int_t i=0; i<vecsize; i++) safe[i] =
Safety(&points[3*i], inside[i]);
2466 fNlow[0] = fNlow[1] = fNhigh[0] = fNhigh[1] = 0.;
2511 SetCtubDimensions(params[0], params[1], params[2], params[3], params[4], params[5],
2512 params[6], params[7], params[8], params[9], params[10]);
2539 Error(
"ComputeBBox",
"In shape %s wrong definition of cut planes",
GetName());
2553 for (i=0; i<2; i++) {
2554 if (phi_low<0) phi_low+=360.;
2556 if (dphi < 0) dphi+=360.;
2558 if (ddp<0) ddp += 360.;
2570 in_range_low =
kTRUE;
2573 if (phi_low>360) phi_low-=360.;
2576 for (i=0; i<2; i++) {
2577 if (phi_hi<0) phi_hi+=360.;
2579 if (dphi < 0) dphi+=360.;
2581 if (ddp<0) ddp += 360.;
2593 in_range_hi =
kTRUE;
2596 if (phi_hi>360) phi_hi-=360.;
2632 fDZ = 0.5*(zmax-zmin);
2644 Double_t rsq = point[0]*point[0]+point[1]*point[1];
2659 memcpy(norm, fNlow, 3*
sizeof(
Double_t));
2660 if (norm[0]*dir[0]+norm[1]*dir[1]+norm[2]*dir[2]<0) {
2668 memcpy(norm, fNhigh, 3*
sizeof(
Double_t));
2669 if (norm[0]*dir[0]+norm[1]*dir[1]+norm[2]*dir[2]<0) {
2681 if (norm[0]*dir[0]+norm[1]*dir[1]<0) {
2694 if (zin>0)
return kFALSE;
2697 if (zin>0)
return kFALSE;
2699 Double_t r2 = point[0]*point[0]+point[1]*point[1];
2703 if (phi < 0 ) phi+=360.;
2706 if (ddp<0) ddp += 360.;
2708 if (ddp > dphi)
return kFALSE;
2752 if (iact<3 && safe) {
2763 Double_t rsq = point[0]*point[0]+point[1]*point[1];
2778 xi = point[0]+s*dir[0];
2779 yi = point[1]+s*dir[1];
2784 if (cpsi>=
fCdfi)
return s;
2792 xi = point[0]+s*dir[0];
2793 yi = point[1]+s*dir[1];
2798 if (cpsi>=
fCdfi)
return s;
2804 Double_t nsq=dir[0]*dir[0]+dir[1]*dir[1];
2806 Double_t rdotn=point[0]*dir[0]+point[1]*dir[1];
2809 if (r>
fRmax && rdotn<0) {
2814 xi=point[0]+s*dir[0];
2815 yi=point[1]+s*dir[1];
2816 zi=point[2]+s*dir[2];
2817 if ((-xi*fNlow[0]-yi*fNlow[1]-(zi+
fDz)*fNlow[2])>0) {
2818 if ((-xi*fNhigh[0]-yi*fNhigh[1]+(
fDz-zi)*fNhigh[2])>0) {
2821 if (cpsi>=
fCdfi)
return s;
2834 xi=point[0]+s*dir[0];
2835 yi=point[1]+s*dir[1];
2836 zi=point[2]+s*dir[2];
2837 if ((-xi*fNlow[0]-yi*fNlow[1]-(zi+
fDz)*fNlow[2])>0) {
2838 if ((-xi*fNhigh[0]-yi*fNhigh[1]+(
fDz-zi)*fNhigh[2])>0) {
2841 if (cpsi>=
fCdfi) snxt=s;
2848 if (tub)
return snxt;
2851 s=(point[1]*fC1-point[0]*
fS1)/un;
2853 xi=point[0]+s*dir[0];
2854 yi=point[1]+s*dir[1];
2855 zi=point[2]+s*dir[2];
2856 if ((-xi*fNlow[0]-yi*fNlow[1]-(zi+
fDz)*fNlow[2])>0) {
2857 if ((-xi*fNhigh[0]-yi*fNhigh[1]+(
fDz-zi)*fNhigh[2])>0) {
2860 if ((yi*
fCm-xi*
fSm)<=0) {
2868 un=dir[0]*
fS2-dir[1]*
fC2;
2870 s=(point[1]*fC2-point[0]*
fS2)/un;
2872 xi=point[0]+s*dir[0];
2873 yi=point[1]+s*dir[1];
2874 zi=point[2]+s*dir[2];
2875 if ((-xi*fNlow[0]-yi*fNlow[1]-(zi+
fDz)*fNlow[2])>0) {
2876 if ((-xi*fNhigh[0]-yi*fNhigh[1]+(
fDz-zi)*fNhigh[2])>0) {
2879 if ((yi*
fCm-xi*
fSm)>=0) {
2898 Double_t rsq = point[0]*point[0]+point[1]*point[1];
2908 if (calf>0) sz = saf[0]/calf;
2914 if (sz1<sz) sz = sz1;
2918 Double_t nsq=dir[0]*dir[0]+dir[1]*dir[1];
2921 Double_t rdotn=point[0]*dir[0]+point[1]*dir[1];
2930 if (sr>0) skip_outer =
kTRUE;
2955 Warning(
"Divide",
"In shape %s division of a cut tube not implemented",
GetName());
2967 Error(
"GetMakeRuntimeShape",
"Invalid mother for shape %s",
GetName());
2976 rmin = ((
TGeoTube*)mother)->GetRmin();
2978 rmax = ((
TGeoTube*)mother)->GetRmax();
2989 printf(
"*** Shape %s: TGeoCtub ***\n",
GetName());
2990 printf(
" lx = %11.5f\n",
fNlow[0]);
2991 printf(
" ly = %11.5f\n",
fNlow[1]);
2992 printf(
" lz = %11.5f\n",
fNlow[2]);
2993 printf(
" tx = %11.5f\n",
fNhigh[0]);
2994 printf(
" ty = %11.5f\n",
fNhigh[1]);
2995 printf(
" tz = %11.5f\n",
fNhigh[2]);
3006 Double_t rsq = point[0]*point[0]+point[1]*point[1];
3023 for (
Int_t i=0; i<4; i++) saf[i]=-saf[i];
3051 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
3052 out <<
" rmin = " <<
fRmin <<
";" << std::endl;
3053 out <<
" rmax = " <<
fRmax <<
";" << std::endl;
3054 out <<
" dz = " <<
fDz <<
";" << std::endl;
3055 out <<
" phi1 = " <<
fPhi1 <<
";" << std::endl;
3056 out <<
" phi2 = " <<
fPhi2 <<
";" << std::endl;
3057 out <<
" lx = " <<
fNlow[0] <<
";" << std::endl;
3058 out <<
" ly = " <<
fNlow[1] <<
";" << std::endl;
3059 out <<
" lz = " <<
fNlow[2] <<
";" << std::endl;
3060 out <<
" tx = " <<
fNhigh[0] <<
";" << std::endl;
3061 out <<
" ty = " <<
fNhigh[1] <<
";" << std::endl;
3062 out <<
" tz = " <<
fNhigh[2] <<
";" << std::endl;
3063 out <<
" TGeoShape *" <<
GetPointerName() <<
" = new TGeoCtub(\"" <<
GetName() <<
"\",rmin,rmax,dz,phi1,phi2,lx,ly,lz,tx,ty,tz);" << std::endl;
TObject::SetBit(
TGeoShape::kGeoSavePrimitive);
3072 param[6], param[7], param[8], param[9], param[10]);
3096 if (phi2<phi1) phi2+=360.;
3099 dphi = (phi2-phi1)/(n-1);
3105 for (j = 0; j <
n; j++) {
3111 points[indx+6*
n] =
GetZcoord(points[indx-2], points[indx-1], dz);
3112 points[indx] =
GetZcoord(points[indx-2], points[indx-1], -dz);
3115 for (j = 0; j <
n; j++) {
3121 points[indx+6*
n]=
GetZcoord(points[indx-2], points[indx-1], dz);
3122 points[indx] =
GetZcoord(points[indx-2], points[indx-1], -dz);
3138 if (phi2<phi1) phi2+=360.;
3141 dphi = (phi2-phi1)/(n-1);
3147 for (j = 0; j <
n; j++) {
3153 points[indx+6*
n] =
GetZcoord(points[indx-2], points[indx-1], dz);
3154 points[indx] =
GetZcoord(points[indx-2], points[indx-1], -dz);
3157 for (j = 0; j <
n; j++) {
3163 points[indx+6*
n]=
GetZcoord(points[indx-2], points[indx-1], dz);
3164 points[indx] =
GetZcoord(points[indx-2], points[indx-1], -dz);
3184 Int_t numPoints = n*4;
3205 for (
UInt_t i = 0; i < 3; i++ ) {
3214 Int_t nbSegs = 2*nbPnts;
3215 Int_t nbPols = nbPnts-2;
3216 if (buffer.
SetRawSizes(nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols)) {
3239 for (
Int_t i=0; i<vecsize; i++) inside[i] =
Contains(&points[3*i]);
3249 for (
Int_t i=0; i<vecsize; i++)
ComputeNormal(&points[3*i], &dirs[3*i], &norms[3*i]);
3257 for (
Int_t i=0; i<vecsize; i++) dists[i] =
DistFromInside(&points[3*i], &dirs[3*i], 3, step[i]);
3265 for (
Int_t i=0; i<vecsize; i++) dists[i] =
DistFromOutside(&points[3*i], &dirs[3*i], 3, step[i]);
3275 for (
Int_t i=0; i<vecsize; i++) safe[i] =
Safety(&points[3*i], inside[i]);
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
Complete tube description class - see TBuffer3DTypes for producer classes.
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
computes the closest distance from given point to this shape, according to option.
virtual Bool_t Contains(const Double_t *point) const
test if point is inside this tube segment first check if point is inside the tube ...
Double_t fHighPlaneNorm[3]
Double_t fCm
sin(0.5*(phi1+phi2))
virtual TBuffer3D * MakeBuffer3D() const
Creates a TBuffer3D describing this shape.
virtual Int_t GetNmeshVertices() const
Return number of vertices of the mesh representation.
Long64_t LocMax(Long64_t n, const T *a)
void SetFinder(TGeoPatternFinder *finder)
virtual void ComputeBBox()
compute bounding box of the tube
virtual void GetBoundingCylinder(Double_t *param) const
Fill vector param[4] with the bounding cylinder parameters.
void InitTrigonometry()
cos(0.5*(phi1-phi2))
virtual void SetSegsAndPols(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons.
void AddNodeOffset(TGeoVolume *vol, Int_t copy_no, Double_t offset=0, Option_t *option="")
Add a division node to the list of nodes.
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
computes the closest distance from given point InitTrigonometry();to this shape, according to option...
Geometrical transformation package.
Tube segment description class - see TBuffer3DTypes for producer classes.
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Compute normal to closest surface from POINT.
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Compute normal to closest surface from POINT.
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
constexpr Double_t TwoPi()
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 TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
Divide the tube along one axis.
Bool_t TestBit(UInt_t f) const
virtual void ComputeBBox()
compute bounding box of the tube segment
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
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 ComputeBBox()
compute minimum bounding box of the ctub
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
void SetCtubDimensions(Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2, Double_t lx, Double_t ly, Double_t lz, Double_t tx, Double_t ty, Double_t tz)
set dimensions of a cut tube
Cut tube segment description class - see TBuffer3DTypes for producer classes.
Short_t Min(Short_t a, Short_t b)
virtual const char * GetAxisName(Int_t iaxis) const
Returns name of axis IAXIS.
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.
static Double_t SafetyPhi(const Double_t *point, Bool_t in, Double_t phi1, Double_t phi2)
Static method to compute safety w.r.t a phi corner defined by cosines/sines of the angles phi1...
Double_t GetZcoord(Double_t xc, Double_t yc, Double_t zc) const
compute real Z coordinate of a point belonging to either lower or higher caps (z should be either +fD...
virtual void SetSegsAndPols(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons.
virtual void InspectShape() const
Prints shape parameters.
TObject * At(Int_t idx) const
static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t rmin, Double_t rmax, Double_t dz, Double_t c1, Double_t s1, Double_t c2, Double_t s2)
Compute normal to closest surface from POINT.
virtual void InspectShape() const
print shape parameters
void SetTubsDimensions(Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2)
Set dimensions of the tube segment.
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.
static Bool_t IsSameWithinTolerance(Double_t a, Double_t b)
Check if two numbers differ with less than a tolerance.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const
Returns numbers of vertices, segments and polygons composing the shape mesh.
virtual Int_t GetNmeshVertices() const
Return number of vertices of the mesh representation.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute closest distance from point px,py to each corner
static Double_t Tolerance()
Int_t GetNdaughters() const
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual Int_t GetNmeshVertices() const
Return number of vertices of the mesh representation.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute closest distance from point px,py to each corner
void AddVolume(TGeoVolume *vol)
Add a volume with valid shape to the list of volumes.
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 const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const
Get range of shape for a given axis.
constexpr Double_t DegToRad()
TGeoMedium * GetMedium() const
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const
Get range of shape for a given axis.
Double_t ATan2(Double_t, Double_t)
virtual Bool_t Contains(const Double_t *point) const
check if point is contained in the cut tube check the lower cut plane
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 void SetDimensions(Double_t *param)
Set tube dimensions starting from a list.
void SetSectionsValid(UInt_t mask)
const char * GetPointerName() const
Provide a pointer name containing uid.
virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const
Returns numbers of vertices, segments and polygons composing the shape mesh.
Base finder class for patterns.
virtual const char * GetName() const
Get the shape name.
static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t rmin, Double_t rmax, Double_t dz, Double_t c1, Double_t s1, Double_t c2, Double_t s2, Double_t cm, Double_t sm, Double_t cdfi)
Static method to compute distance to arbitrary tube segment from outside point Boundary safe algorith...
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 SetPoints(Double_t *points) const
Create mesh points for the cut tube.
Int_t GetNsegments() const
Get number of segments approximating circles.
Int_t ShapeDistancetoPrimitive(Int_t numpoints, Int_t px, Int_t py) const
Returns distance to shape primitive mesh.
Bool_t SectionsValid(UInt_t mask) const
Base abstract class for all shapes.
virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const
Returns numbers of vertices, segments and polygons composing the shape mesh.
static Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t rmin, Double_t rmax, Double_t dz)
Compute distance from inside point to surface of the tube (static) Boundary safe algorithm.
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 SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
static Double_t DistToPhiMin(const Double_t *point, const Double_t *dir, Double_t s1, Double_t c1, Double_t s2, Double_t c2, Double_t sm, Double_t cm, Bool_t in=kTRUE)
compute distance from point (inside phi) to both phi planes. Return minimum.
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.
static void DistToTube(Double_t rsq, Double_t nsq, Double_t rdotn, Double_t radius, Double_t &b, Double_t &delta)
Static method computing the distance to a tube with given radius, starting from POINT along DIR direc...
void TransformPoints(Double_t *points, UInt_t NbPoints) const
Tranform a set of points (LocalToMaster)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void SetDimensions(Double_t *param)
Set dimensions of the cut tube starting from a list.
virtual void SetPoints(Double_t *points) const
Create tube segment mesh points.
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const
computes the closest distance from given point to this shape, according to option.
Bool_t SetRawSizes(UInt_t reqPnts, UInt_t reqPntsCapacity, UInt_t reqSegs, UInt_t reqSegsCapacity, UInt_t reqPols, UInt_t reqPolsCapacity)
Set kRaw tessellation section of buffer with supplied sizes.
static Bool_t IsInPhiRange(const Double_t *point, Double_t phi1, Double_t phi2)
Static method to check if a point is in the phi range (phi1, phi2) [degrees].
Generic 3D primitive description class.
static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t rmin, Double_t rmax, Double_t dz)
Compute normal to closest surface from POINT.
Double_t fCdfi
cos(0.5*(phi1+phi2))
virtual TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
Divide this tube shape belonging to volume "voldiv" into ndiv volumes called divname, from start position with the given step.
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...
void SetDivIndex(Int_t index)
virtual Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const
Fills array with n random points located on the line segments of the shape mesh.
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...
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 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...
static Double_t SafetyS(const Double_t *point, Bool_t in, Double_t rmin, Double_t rmax, Double_t dz, Int_t skipz=0)
computes the closest distance from given point to this shape, according to option.
A tube segment cut with 2 planes.
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Compute normal to closest surface from POINT.
TGeoTube()
Default constructor.
static Bool_t IsCloseToPhi(Double_t epsil, const Double_t *point, Double_t c1, Double_t s1, Double_t c2, Double_t s2)
True if point is closer than epsil to one of the phi planes defined by c1,s1 or c2,s2.
static Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t rmin, Double_t rmax, Double_t dz, Double_t c1, Double_t s1, Double_t c2, Double_t s2, Double_t cm, Double_t sm, Double_t cdfi)
Compute distance from inside point to surface of the tube segment (static) Boundary safe algorithm...
R__EXTERN TGeoManager * gGeoManager
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
Double_t fLowPlaneNorm[3]
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.
Bool_t TestShapeBit(UInt_t f) const
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 tube segment fist localize point w...
Node containing an offset.
virtual void AfterStreamer()
Function called after streaming an object of this class.
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 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 Double_t SafetyS(const Double_t *point, Bool_t in, Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2, Int_t skipz=0)
Static method to compute the closest distance from given point to this shape.
virtual TBuffer3D * MakeBuffer3D() const
Creates a TBuffer3D describing this shape.
virtual Bool_t Contains(const Double_t *point) const
test if point is inside this tube
void SetShapeBit(UInt_t f, Bool_t set)
Equivalent of TObject::SetBit.
virtual TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step)
Divide this tube segment shape belonging to volume "voldiv" into ndiv volumes called divname...
you should not use this method at all Int_t Int_t z
virtual void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const
Fills the supplied buffer, with sections in desired frame See TBuffer3D.h for explanation of sections...
constexpr Double_t RadToDeg()
virtual void GetBoundingCylinder(Double_t *param) const
Fill vector param[4] with the bounding cylinder parameters.
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 tube segment Boundary safe algorithm.
virtual ~TGeoCtub()
destructor
virtual Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const
Fills array with n random points located on the line segments of the shape mesh.
Short_t Max(Short_t a, Short_t b)
static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t rmin, Double_t rmax, Double_t dz)
Static method to compute distance from outside point to a tube with given parameters Boundary safe al...
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const =0
virtual void Sizeof3D() const
fill size of this 3-D object
static void NormalPhi(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t c1, Double_t s1, Double_t c2, Double_t s2)
Static method to compute normal to phi planes.
virtual void Sizeof3D() const
fill size of this 3-D object
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 Double_t Capacity() const
Computes capacity of the shape in [length^3].
virtual void SetPoints(Double_t *points) const
create tube mesh points
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...
Double_t Sqrt(Double_t x)
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 tube and safe distance Boundary safe algorithm...
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void SetDimensions(Double_t *param)
Set dimensions of the tube segment starting from a list.
Long64_t LocMin(Long64_t n, const T *a)
virtual ~TGeoTube()
destructor
TGeoTubeSeg()
Default constructor.
double norm(double *x, double *p)
Int_t GetBasicColor() const
Get the basic color (0-7).
virtual void InspectShape() const
print shape parameters
virtual ~TGeoTubeSeg()
destructor
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 cut tube
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
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...
void SetTubeDimensions(Double_t rmin, Double_t rmax, Double_t dz)
Set tube dimensions.
unsigned int r2[N_CITIES]
virtual Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const
Fills array with n random points located on the line segments of the shape mesh.
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const
Get range of shape for a given axis.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
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 tube Boundary safe algorithm.
const char * Data() const
virtual void InspectShape() const
print shape parameters
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 cut tube