206 Double_t rsq = point[0]*point[0]+point[1]*point[1];
213 norm[0] = norm[1] = 0.;
221 if (norm[0]*dir[0]+norm[1]*dir[1]<0) {
237 if (norm[0]*dir[0]+norm[1]*dir[1]<0) {
249 Double_t r2 = point[0]*point[0]+point[1]*point[1];
261 if (!
HasRmin()) numPoints = 2*(n+1);
276 if (sz<=0)
return 0.0;
279 Double_t nsq=dir[0]*dir[0]+dir[1]*dir[1];
281 Double_t rsq=point[0]*point[0]+point[1]*point[1];
282 Double_t rdotn=point[0]*dir[0]+point[1]*dir[1];
289 if (rdotn<0)
return 0.0;
302 if (rdotn>=0)
return 0.0;
318 if (iact<3 && safe) {
344 xi = point[0]+s*dir[0];
345 yi = point[1]+s*dir[1];
347 if ((rminsq<=r2) && (r2<=rmaxsq))
return s;
350 Double_t rsq = point[0]*point[0]+point[1]*point[1];
352 Double_t nsq=dir[0]*dir[0]+dir[1]*dir[1];
353 Double_t rdotn=point[0]*dir[0]+point[1]*dir[1];
359 in = inz & inrmin & inrmax;
366 if (point[2]*dir[2]<0)
return 0.0;
370 if ((rmaxsq-rsq) < (rsq-rminsq)) checkout =
kTRUE;
376 if (rdotn>=0)
return 0.0;
383 zi=point[2]+s*dir[2];
384 if (TMath::Abs(zi)<=dz)
return s;
396 zi=point[2]+s*dir[2];
397 if (TMath::Abs(zi)<=dz)
return s;
407 zi=point[2]+s*dir[2];
408 if (TMath::Abs(zi)<=dz)
return s;
422 if (iact<3 && safe) {
482 for (
id=0;
id<ndiv;
id++) {
483 shape =
new TGeoTube(start+
id*step, start+(
id+1)*step,
fDz);
498 vmulti->AddVolume(vol);
500 for (
id=0;
id<ndiv;
id++) {
506 finder =
new TGeoPatternZ(voldiv, ndiv, start, start+ndiv*step);
512 vmulti->AddVolume(vol);
514 for (
id=0;
id<ndiv;
id++) {
520 Error(
"Divide",
"In shape %s wrong axis type for division",
GetName());
577 param[0] *= param[0];
579 param[1] *= param[1];
598 if (xmax<0)
return 0;
603 if (xmin<0)
return 0;
607 if (xmax<=0)
return 0;
623 printf(
" Bounding box:\n");
643 nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols);
669 for (i = 0; i < 4; i++) {
670 for (j = 0; j <
n; j++) {
673 buffer.
fSegs[indx+1] = i*n+j;
674 buffer.
fSegs[indx+2] = i*n+(j+1)%n;
680 for (i = 4; i < 6; i++) {
681 for (j = 0; j <
n; j++) {
683 buffer.
fSegs[indx ] = c+1;
684 buffer.
fSegs[indx+1] = (i-4)*n+j;
685 buffer.
fSegs[indx+2] = (i-2)*n+j;
691 for (i = 6; i < 8; i++) {
692 for (j = 0; j <
n; j++) {
695 buffer.
fSegs[indx+1] = 2*(i-6)*n+j;
696 buffer.
fSegs[indx+2] = (2*(i-6)+1)*n+j;
702 for (j = 0; j <
n; j++) {
705 buffer.
fPols[indx+1] = 4;
706 buffer.
fPols[indx+2] = j;
707 buffer.
fPols[indx+3] = 4*n+(j+1)%n;
708 buffer.
fPols[indx+4] = 2*n+j;
709 buffer.
fPols[indx+5] = 4*n+j;
713 for (j = 0; j <
n; j++) {
715 buffer.
fPols[indx ] = c+1;
716 buffer.
fPols[indx+1] = 4;
717 buffer.
fPols[indx+2] = n+j;
718 buffer.
fPols[indx+3] = 5*n+j;
719 buffer.
fPols[indx+4] = 3*n+j;
720 buffer.
fPols[indx+5] = 5*n+(j+1)%n;
724 for (j = 0; j <
n; j++) {
727 buffer.
fPols[indx+1] = 4;
728 buffer.
fPols[indx+2] = j;
729 buffer.
fPols[indx+3] = 6*n+j;
730 buffer.
fPols[indx+4] = n+j;
731 buffer.
fPols[indx+5] = 6*n+(j+1)%n;
735 for (j = 0; j <
n; j++) {
738 buffer.
fPols[indx+1] = 4;
739 buffer.
fPols[indx+2] = 2*n+j;
740 buffer.
fPols[indx+3] = 7*n+(j+1)%n;
741 buffer.
fPols[indx+4] = 3*n+j;
742 buffer.
fPols[indx+5] = 7*n+j;
750 for (i = 0; i < 2; i++) {
751 for (j = 0; j <
n; j++) {
754 buffer.
fSegs[indx+1] = 2+i*n+j;
755 buffer.
fSegs[indx+2] = 2+i*n+(j+1)%n;
759 for (j = 0; j <
n; j++) {
761 buffer.
fSegs[indx ] = c+1;
762 buffer.
fSegs[indx+1] = 2+j;
763 buffer.
fSegs[indx+2] = 2+n+j;
768 for (i = 3; i < 5; i++) {
769 for (j = 0; j <
n; j++) {
772 buffer.
fSegs[indx+1] = i-3;
773 buffer.
fSegs[indx+2] = 2+(i-3)*n+j;
778 for (j = 0; j <
n; j++) {
780 buffer.
fPols[indx ] = c+1;
781 buffer.
fPols[indx+1] = 4;
782 buffer.
fPols[indx+2] = j;
783 buffer.
fPols[indx+3] = 2*n+j;
784 buffer.
fPols[indx+4] = n+j;
785 buffer.
fPols[indx+5] = 2*n+(j+1)%n;
788 for (j = 0; j <
n; j++) {
791 buffer.
fPols[indx+1] = 3;
792 buffer.
fPols[indx+2] = j;
793 buffer.
fPols[indx+3] = 3*n+(j+1)%n;
794 buffer.
fPols[indx+4] = 3*n+j;
797 for (j = 0; j <
n; j++) {
798 indx = 6*n + 5*n + 5*j;
800 buffer.
fPols[indx+1] = 3;
801 buffer.
fPols[indx+2] = n+j;
802 buffer.
fPols[indx+3] = 4*n+j;
803 buffer.
fPols[indx+4] = 4*n+(j+1)%n;
820 if (safrmin < safe) safe = safrmin;
823 if (safrmax < safe) safe = safrmax;
828 if (safrmin > safe) safe = safrmin;
831 if (safrmax > safe) safe = safrmax;
836 Double_t rsq = point[0]*point[0]+point[1]*point[1];
842 for (
Int_t i=0; i<3; i++) saf[i]=-saf[i];
854 Double_t rsq = point[0]*point[0]+point[1]*point[1];
858 saf[0] = dz - point[2];
861 saf[0] = dz + point[2];
873 for (
Int_t i=0; i<3; i++) saf[i]=-saf[i];
884 out <<
" rmin = " <<
fRmin <<
";" << std::endl;
885 out <<
" rmax = " <<
fRmax <<
";" << std::endl;
886 out <<
" dz = " <<
fDz <<
";" << std::endl;
887 out <<
" TGeoShape *" <<
GetPointerName() <<
" = new TGeoTube(\"" <<
GetName() <<
"\",rmin,rmax,dz);" << std::endl;
900 Error(
"SetTubeDimensions",
"In shape %s wrong rmin=%g rmax=%g",
GetName(), rmin,rmax);
921 if (npoints > (npoints/2)*2) {
922 Error(
"GetPointsOnSegments",
"Npoints must be even number");
931 if (
HasRmin()) ntop = npoints/2 - nc*(nc-1);
932 else ntop = npoints - nc*(nc-1);
938 for (
Int_t i=0; i<nc; i++) {
939 if (i == (nc-1)) nphi = ntop;
942 for (
Int_t j=0; j<nphi; j++) {
974 for (j = 0; j <
n; j++) {
980 points[indx+6*
n] = dz;
986 for (j = 0; j <
n; j++) {
992 points[indx+6*
n]= dz;
1000 points[indx++] = -dz;
1001 points[indx++] = 0.;
1002 points[indx++] = 0.;
1003 points[indx++] = dz;
1006 for (j = 0; j <
n; j++) {
1012 points[indx+3*
n]= dz;
1037 for (j = 0; j <
n; j++) {
1043 points[indx+6*
n] = dz;
1049 for (j = 0; j <
n; j++) {
1055 points[indx+6*
n]= dz;
1061 points[indx++] = 0.;
1062 points[indx++] = 0.;
1063 points[indx++] = -dz;
1064 points[indx++] = 0.;
1065 points[indx++] = 0.;
1066 points[indx++] = dz;
1069 for (j = 0; j <
n; j++) {
1075 points[indx+3*
n]= dz;
1089 Int_t numPoints = n*4;
1090 if (!
HasRmin()) numPoints = 2*(n+1);
1152 if (buffer.
SetRawSizes(nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols)) {
1175 for (
Int_t i=0; i<vecsize; i++) inside[i] =
Contains(&points[3*i]);
1185 for (
Int_t i=0; i<vecsize; i++)
ComputeNormal(&points[3*i], &dirs[3*i], &norms[3*i]);
1193 for (
Int_t i=0; i<vecsize; i++) dists[i] =
DistFromInside(&points[3*i], &dirs[3*i], 3, step[i]);
1201 for (
Int_t i=0; i<vecsize; i++) dists[i] =
DistFromOutside(&points[3*i], &dirs[3*i], 3, step[i]);
1211 for (
Int_t i=0; i<vecsize; i++) safe[i] =
Safety(&points[3*i], inside[i]);
1221 fPhi1(0.), fPhi2(0.), fS1(0.), fC1(0.), fS2(0.), fC2(0.), fSm(0.), fCm(0.), fCdfi(0.)
1233 fPhi1(0.), fPhi2(0.), fS1(0.), fC1(0.), fS2(0.), fC2(0.), fSm(0.), fCm(0.), fCdfi(0.)
1343 if (ddp<0) ddp+= 360;
1344 if (ddp>360) ddp-=360;
1345 if (ddp<=dp) xmax =
fRmax;
1347 if (ddp<0) ddp+= 360;
1348 if (ddp>360) ddp-=360;
1349 if (ddp<=dp) ymax =
fRmax;
1351 if (ddp<0) ddp+= 360;
1352 if (ddp>360) ddp-=360;
1353 if (ddp<=dp) xmin = -
fRmax;
1355 if (ddp<0) ddp+= 360;
1356 if (ddp>360) ddp-=360;
1357 if (ddp<=dp) ymin = -
fRmax;
1372 Double_t rsq = point[0]*point[0]+point[1]*point[1];
1383 norm[0] = norm[1] = 0.;
1391 if (norm[0]*dir[0]+norm[1]*dir[1]<0) {
1405 Double_t rsq = point[0]*point[0]+point[1]*point[1];
1418 if (norm[0]*dir[0]+norm[1]*dir[1]<0) {
1440 const Int_t numPoints = 4*
n;
1453 if (stube<=0)
return 0.0;
1455 Double_t rsq = point[0]*point[0]+point[1]*point[1];
1457 Double_t cpsi=point[0]*cm+point[1]*sm;
1466 ddotn = s1*dir[0]-c1*dir[1];
1467 if (ddotn>=0)
return 0.0;
1468 ddotn = -s2*dir[0]+c2*dir[1];
1469 if (ddotn<=0)
return stube;
1470 sfmin = s2*point[0]-c2*point[1];
1471 if (sfmin<=0)
return stube;
1473 if (sfmin >= stube)
return stube;
1474 xi = point[0]+sfmin*dir[0];
1475 yi = point[1]+sfmin*dir[1];
1476 if (yi*cm-xi*sm<0)
return stube;
1479 ddotn = -s2*dir[0]+c2*dir[1];
1480 if (ddotn>=0)
return 0.0;
1481 ddotn = s1*dir[0]-c1*dir[1];
1482 if (ddotn<=0)
return stube;
1483 sfmin = -s1*point[0]+c1*point[1];
1484 if (sfmin<=0)
return stube;
1486 if (sfmin >= stube)
return stube;
1487 xi = point[0]+sfmin*dir[0];
1488 yi = point[1]+sfmin*dir[1];
1489 if (yi*cm-xi*sm>0)
return stube;
1499 if (iact<3 && safe) {
1507 return TGeoTubeSeg::DistFromInsideS(point,dir,
fRmin,
fRmax,
fDz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdfi);
1531 xi = point[0]+s*dir[0];
1532 yi = point[1]+s*dir[1];
1534 if ((rminsq<=r2) && (r2<=rmaxsq)) {
1536 if (cpsi>=cdfi)
return s;
1541 Double_t rsq = point[0]*point[0]+point[1]*point[1];
1543 Double_t nsq=dir[0]*dir[0]+dir[1]*dir[1];
1544 Double_t rdotn=point[0]*dir[0]+point[1]*dir[1];
1551 cpsi=point[0]*cm+point[1]*sm;
1553 in = inz & inrmin & inrmax & inphi;
1563 if (point[2]*dir[2]<0)
return 0.0;
1568 if ((rmaxsq-rsq) < (rsq-rminsq)) checkout =
kTRUE;
1570 if (checkout && (rmax-r<safphi)) {
1580 if (TMath::Abs(point[1]-s1*r) < TMath::Abs(point[1]-s2*r)) {
1581 un = dir[0]*s1-dir[1]*
c1;
1582 if (un < 0)
return 0.0;
1584 un = -dir[0]*s2+dir[1]*
c2;
1586 s = -point[0]*s2+point[1]*
c2;
1589 zi = point[2]+s*dir[2];
1590 if (TMath::Abs(zi)<=dz) {
1591 xi = point[0]+s*dir[0];
1592 yi = point[1]+s*dir[1];
1594 if ((rminsq<=r2) && (r2<=rmaxsq)) {
1595 if ((yi*cm-xi*sm)>0)
return s;
1601 un = -dir[0]*s2+dir[1]*
c2;
1602 if (un < 0)
return 0.0;
1604 un = dir[0]*s1-dir[1]*
c1;
1606 s = point[0]*s1-point[1]*
c1;
1609 zi = point[2]+s*dir[2];
1610 if (TMath::Abs(zi)<=dz) {
1611 xi = point[0]+s*dir[0];
1612 yi = point[1]+s*dir[1];
1614 if ((rminsq<=r2) && (r2<=rmaxsq)) {
1615 if ((yi*cm-xi*sm)<0)
return s;
1628 zi=point[2]+s*dir[2];
1629 if (TMath::Abs(zi)<=dz) {
1630 xi=point[0]+s*dir[0];
1631 yi=point[1]+s*dir[1];
1632 if ((xi*cm+yi*sm) >= rmin*cdfi)
return s;
1639 if (rdotn>=0)
return 0.0;
1644 zi=point[2]+s*dir[2];
1645 if (TMath::Abs(zi)<=dz) {
1647 xi=point[0]+s*dir[0];
1648 yi=point[1]+s*dir[1];
1650 if ((xi*cm+yi*sm) >= rmin*cdfi)
return s;
1654 s=point[0]*s1-point[1]*
c1;
1657 zi=point[2]+s*dir[2];
1658 if (TMath::Abs(zi)<=dz) {
1659 xi=point[0]+s*dir[0];
1660 yi=point[1]+s*dir[1];
1662 if ((rminsq<=r2) && (r2<=rmaxsq)) {
1663 if ((yi*cm-xi*sm)<=0) {
1670 un=dir[0]*s2-dir[1]*
c2;
1672 s=(point[1]*c2-point[0]*s2)/un;
1673 if (s>=0 && s<snxt) {
1674 zi=point[2]+s*dir[2];
1675 if (TMath::Abs(zi)<=dz) {
1676 xi=point[0]+s*dir[0];
1677 yi=point[1]+s*dir[1];
1679 if ((rminsq<=r2) && (r2<=rmaxsq)) {
1680 if ((yi*cm-xi*sm)>=0) {
1695 if (rsq>=rmax*rmax) {
1701 zi=point[2]+s*dir[2];
1702 if (TMath::Abs(zi)<=dz) {
1703 xi=point[0]+s*dir[0];
1704 yi=point[1]+s*dir[1];
1706 if (cpsi>=rmax*cdfi)
return s;
1717 zi=point[2]+s*dir[2];
1718 if (TMath::Abs(zi)<=dz) {
1719 xi=point[0]+s*dir[0];
1720 yi=point[1]+s*dir[1];
1722 if (cpsi>=rmin*cdfi) snxt=s;
1730 s=point[0]*s1-point[1]*
c1;
1733 zi=point[2]+s*dir[2];
1734 if (TMath::Abs(zi)<=dz) {
1735 xi=point[0]+s*dir[0];
1736 yi=point[1]+s*dir[1];
1738 if ((rminsq<=r2) && (r2<=rmaxsq)) {
1739 if ((yi*cm-xi*sm)<=0) {
1746 un=dir[0]*s2-dir[1]*
c2;
1748 s=point[1]*c2-point[0]*s2;
1751 zi=point[2]+s*dir[2];
1752 if (TMath::Abs(zi)<=dz) {
1753 xi=point[0]+s*dir[0];
1754 yi=point[1]+s*dir[1];
1756 if ((rminsq<=r2) && (r2<=rmaxsq)) {
1757 if ((yi*cm-xi*sm)>=0) {
1773 if (iact<3 && safe) {
1784 return TGeoTubeSeg::DistFromOutsideS(point, dir,
fRmin,
fRmax,
fDz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdfi);
1812 for (
id=0;
id<ndiv;
id++) {
1823 if (dphi<0) dphi+=360.;
1824 if (step<=0) {step=dphi/ndiv; start=
fPhi1; end=
fPhi2;}
1831 vmulti->AddVolume(vol);
1833 for (
id=0;
id<ndiv;
id++) {
1845 vmulti->AddVolume(vol);
1847 for (
id=0;
id<ndiv;
id++) {
1853 Error(
"Divide",
"In shape %s wrong axis type for division",
GetName());
1893 param[0] *= param[0];
1895 param[1] *= param[1];
1908 Error(
"GetMakeRuntimeShape",
"Invalid mother for shape %s",
GetName());
1917 rmin = ((
TGeoTube*)mother)->GetRmin();
1919 rmax = ((
TGeoTube*)mother)->GetRmax();
1935 printf(
" Bounding box:\n");
1947 Int_t nbSegs = 2*nbPnts;
1948 Int_t nbPols = nbPnts-2;
1951 nbPnts, 3*nbPnts, nbSegs, 3*nbSegs, nbPols, 6*nbPols);
1971 for (i = 0; i < 4; i++) {
1972 for (j = 1; j <
n; j++) {
1973 buff.
fSegs[(i*n+j-1)*3 ] = c;
1974 buff.
fSegs[(i*n+j-1)*3+1] = i*n+j-1;
1975 buff.
fSegs[(i*n+j-1)*3+2] = i*n+j;
1978 for (i = 4; i < 6; i++) {
1979 for (j = 0; j <
n; j++) {
1980 buff.
fSegs[(i*n+j)*3 ] = c+1;
1981 buff.
fSegs[(i*n+j)*3+1] = (i-4)*n+j;
1982 buff.
fSegs[(i*n+j)*3+2] = (i-2)*n+j;
1985 for (i = 6; i < 8; i++) {
1986 for (j = 0; j <
n; j++) {
1987 buff.
fSegs[(i*n+j)*3 ] = c;
1988 buff.
fSegs[(i*n+j)*3+1] = 2*(i-6)*n+j;
1989 buff.
fSegs[(i*n+j)*3+2] = (2*(i-6)+1)*n+j;
1996 for (j = 0; j < n-1; j++) {
1998 buff.
fPols[indx++] = 4;
1999 buff.
fPols[indx++] = (4+i)*n+j+1;
2000 buff.
fPols[indx++] = (2+i)*n+j;
2001 buff.
fPols[indx++] = (4+i)*n+j;
2002 buff.
fPols[indx++] = i*n+j;
2005 for (j = 0; j < n-1; j++) {
2007 buff.
fPols[indx++] = 4;
2008 buff.
fPols[indx++] = i*n+j;
2009 buff.
fPols[indx++] = (4+i)*n+j;
2010 buff.
fPols[indx++] = (2+i)*n+j;
2011 buff.
fPols[indx++] = (4+i)*n+j+1;
2014 for (j = 0; j < n-1; j++) {
2015 buff.
fPols[indx++] = c+i;
2016 buff.
fPols[indx++] = 4;
2017 buff.
fPols[indx++] = (i-2)*2*n+j;
2018 buff.
fPols[indx++] = (4+i)*n+j;
2019 buff.
fPols[indx++] = ((i-2)*2+1)*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++] = (4+i)*n+j+1;
2027 buff.
fPols[indx++] = ((i-2)*2+1)*n+j;
2028 buff.
fPols[indx++] = (4+i)*n+j;
2029 buff.
fPols[indx++] = (i-2)*2*n+j;
2031 buff.
fPols[indx++] = c+2;
2032 buff.
fPols[indx++] = 4;
2033 buff.
fPols[indx++] = 6*
n;
2034 buff.
fPols[indx++] = 4*
n;
2035 buff.
fPols[indx++] = 7*
n;
2036 buff.
fPols[indx++] = 5*
n;
2037 buff.
fPols[indx++] = c+2;
2038 buff.
fPols[indx++] = 4;
2039 buff.
fPols[indx++] = 6*n-1;
2040 buff.
fPols[indx++] = 8*n-1;
2041 buff.
fPols[indx++] = 5*n-1;
2042 buff.
fPols[indx++] = 7*n-1;
2053 Double_t rsq = point[0]*point[0]+point[1]*point[1];
2080 saf[1] =
fRmin-rproj;
2081 saf[2] = rproj-
fRmax;
2087 return (saf[0]<0) ? safe :
TMath::Sqrt(safe*safe+saf[0]*saf[0]);
2090 return (saf[0]<0) ? safphi :
TMath::Sqrt(saf[0]*saf[0]+safphi*safphi);
2101 Double_t rsq = point[0]*point[0]+point[1]*point[1];
2106 saf[0] = dz - point[2];
2109 saf[0] = dz + point[2];
2122 if ((phi2d-phi1d)>=360.)
return safe;
2135 Double_t cpsi=point[0]*cm+point[1]*sm;
2155 saf[1] = rmin-rproj;
2156 saf[2] = rproj-rmax;
2158 if ((phi2d-phi1d)>=360.)
return TMath::Max(safe,saf[0]);
2162 return (saf[0]<0) ? safe :
TMath::Sqrt(safe*safe+saf[0]*saf[0]);
2165 return (saf[0]<0) ? safphi :
TMath::Sqrt(saf[0]*saf[0]+safphi*safphi);
2174 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
2175 out <<
" rmin = " <<
fRmin <<
";" << std::endl;
2176 out <<
" rmax = " <<
fRmax <<
";" << std::endl;
2177 out <<
" dz = " <<
fDz <<
";" << std::endl;
2178 out <<
" phi1 = " <<
fPhi1 <<
";" << std::endl;
2179 out <<
" phi2 = " <<
fPhi2 <<
";" << std::endl;
2180 out <<
" TGeoShape *" <<
GetPointerName() <<
" = new TGeoTubeSeg(\"" <<
GetName() <<
"\",rmin,rmax,dz,phi1,phi2);" << std::endl;
2222 if (npoints > (npoints/2)*2) {
2223 Error(
"GetPointsOnSegments",
"Npoints must be even number");
2230 Int_t ntop = npoints/2 - nc*(nc-1);
2236 for (
Int_t i=0; i<nc; i++) {
2239 dphi = (
fPhi2-
fPhi1)*TMath::DegToRad()/(nphi-1);
2243 for (
Int_t j=0; j<nphi; j++) {
2244 phi = phi1 + j*dphi;
2266 if (phi2<phi1) phi2+=360.;
2269 dphi = (phi2-phi1)/(n-1);
2275 for (j = 0; j <
n; j++) {
2281 points[indx+6*
n] = dz;
2285 for (j = 0; j <
n; j++) {
2291 points[indx+6*
n]= dz;
2308 if (phi2<phi1) phi2+=360.;
2311 dphi = (phi2-phi1)/(n-1);
2317 for (j = 0; j <
n; j++) {
2323 points[indx+6*
n] = dz;
2327 for (j = 0; j <
n; j++) {
2333 points[indx+6*
n]= dz;
2357 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();
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]);
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
Complete tube description class - see TBuffer3DTypes for producer classes.
Double_t fHighPlaneNorm[3]
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 ...
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 specisied by dirs. Store output in dist...
Double_t fCm
sin(0.5*(phi1+phi2))
virtual Int_t GetNmeshVertices() const
Return number of vertices of the mesh representation.
virtual void SetPoints(Double_t *points) const
Create tube segment mesh points.
Int_t GetNsegments() const
Get number of segments approximating circles.
Long64_t LocMax(Long64_t n, const T *a)
void SetFinder(TGeoPatternFinder *finder)
virtual void ComputeBBox()
compute bounding box of the tube
void InitTrigonometry()
cos(0.5*(phi1-phi2))
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.
void AddNodeOffset(TGeoVolume *vol, Int_t copy_no, Double_t offset=0, Option_t *option="")
Add a division node to the list of nodes.
Tube segment description class - see TBuffer3DTypes for producer classes.
virtual void SetPoints(Double_t *points) const
Create mesh points for the cut tube.
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 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 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.
Int_t GetBasicColor() const
Get the basic color (0-7).
virtual void Sizeof3D() const
virtual void ComputeBBox()
compute bounding box of the tube segment
virtual Bool_t Contains(const Double_t *point) const
test if point is inside this tube
virtual void ComputeBBox()
compute minimum bounding box of the ctub
virtual const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
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)
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...
virtual void GetBoundingCylinder(Double_t *param) const
— Fill vector param[4] with the bounding cylinder parameters.
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 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 specisied by dirs. Store output in dist...
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 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.
void SetTubsDimensions(Double_t rmin, Double_t rmax, Double_t dz, Double_t phi1, Double_t phi2)
Set dimensions of the tube segment.
Int_t GetNdaughters() const
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 Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute closest distance from point px,py to each corner
static Double_t Tolerance()
const char * Data() const
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
compute closest distance from point px,py to each corner
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 const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const
Fills a static 3D buffer and returns a reference.
void AddVolume(TGeoVolume *vol)
Add a volume with valid shape to the list of volumes.
virtual void InspectShape() const
print shape parameters
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 SetSegsAndPols(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons.
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 void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void InspectShape() const
print shape parameters
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 SetDimensions(Double_t *param)
Set tube dimensions starting from a list.
void SetSectionsValid(UInt_t mask)
void TransformPoints(Double_t *points, UInt_t NbPoints) const
Tranform a set of points (LocalToMaster)
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 specisied by dirs. Store output in dist...
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 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 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 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 specisied by dirs. Store output in dist...
virtual const char * ClassName() const
Returns name of class to which the object belongs.
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 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 cut tube
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.
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...
Bool_t TestBit(UInt_t f) const
virtual void SetDimensions(Double_t *param)
Set dimensions of the cut tube starting from a list.
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.
virtual void InspectShape() const
print shape parameters
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...
virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const
Returns numbers of vertices, segments and polygons composing the shape mesh.
void SetDivIndex(Int_t index)
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 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 const char * GetName() const
Get the shape name.
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.
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm)
Compute normal to closest surface from POINT.
virtual void Sizeof3D() 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 and safe distance Boundary safe algorithm...
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.
virtual void InspectShape() const
Prints shape parameters.
virtual Int_t GetNmeshVertices() const
Return number of vertices of the mesh representation.
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...
virtual TBuffer3D * MakeBuffer3D() const
Creates a TBuffer3D describing this shape.
R__EXTERN TGeoManager * gGeoManager
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 ...
Double_t fLowPlaneNorm[3]
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...
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.
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
Int_t ShapeDistancetoPrimitive(Int_t numpoints, Int_t px, Int_t py) const
Returns distance to shape primitive mesh.
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 Safety(const Double_t *point, Bool_t in=kTRUE) const
computes the closest distance from given point InitTrigonometry();to this shape, according to option...
virtual void AfterStreamer()
Function called after streaming an object of this class.
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.
const char * GetPointerName() const
Provide a pointer name containing uid.
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 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 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 Bool_t Contains(const Double_t *point) const
check if point is contained in the cut tube check the lower cut plane
virtual TBuffer3D * MakeBuffer3D() const
Creates a TBuffer3D describing this shape.
ClassImp(TGeoTube) TGeoTube
Default constructor.
void SetShapeBit(UInt_t f, Bool_t set)
Equivalent of TObject::SetBit.
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const
Get range of shape for a given axis.
virtual Int_t GetNmeshVertices() const
Return number of vertices of the mesh representation.
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...
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...
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 const char * GetAxisName(Int_t iaxis) const
Returns name of axis IAXIS.
virtual ~TGeoCtub()
destructor
Bool_t TestShapeBit(UInt_t f) const
virtual void SetSegsAndPols(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons.
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.
TGeoMedium * GetMedium() const
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...
virtual void GetBoundingCylinder(Double_t *param) const
— Fill vector param[4] with the bounding cylinder parameters.
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 specisied by dirs. Store output in dist...
virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const =0
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 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.
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
Double_t Sqrt(Double_t x)
TObject * At(Int_t idx) const
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
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 Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const
Get range of shape for a given axis.
virtual ~TGeoTube()
destructor
double norm(double *x, double *p)
virtual ~TGeoTubeSeg()
destructor
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const
Returns numbers of vertices, segments and polygons composing the shape mesh.
void SetTubeDimensions(Double_t rmin, Double_t rmax, Double_t dz)
Set tube dimensions.
unsigned int r2[N_CITIES]
virtual Double_t Capacity() const
Computes capacity of the shape in [length^3].
virtual void SetPoints(Double_t *points) const
create tube mesh points
Bool_t SectionsValid(UInt_t mask) const
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 specisied by dirs. Store output in dist...
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.