157 Double_t phim = 0.5 * (phi1 + phi2);
200 Double_t phim = 0.5 * (phi1 + phi2);
267 Double_t rmin1, rmax1, rmin2, rmax2, phi1, phi2, dz;
271 for (ipl = 0; ipl <
fNz - 1; ipl++) {
272 dz = 0.5 * (
fZ[ipl + 1] -
fZ[ipl]);
277 rmin2 =
fRmin[ipl + 1];
278 rmax2 =
fRmax[ipl + 1];
290 for (
Int_t isec = 0; isec <
fNz - 1; isec++) {
292 fZ[isec + 1] =
fZ[isec];
296 Error(
"ComputeBBox",
"Duplicated section %d/%d for shape %s", isec, isec + 1,
GetName());
299 if (
fZ[isec] >
fZ[isec + 1]) {
301 Fatal(
"ComputeBBox",
"Wrong section order");
308 Fatal(
"ComputeBBox",
"Shape %s at index %d: Not allowed first two or last two sections at same Z",
GetName(),
356 fOrigin[2] = (zmax + zmin) / 2;
359 fDZ = (zmax - zmin) / 2;
368 memset(norm, 0, 3 *
sizeof(
Double_t));
371 Double_t dz, rmin1, rmax1, rmin2, rmax2;
374 if (ipl == (
fNz - 1) || ipl < 0) {
379 Int_t iplclose = ipl;
380 if ((
fZ[ipl + 1] - point[2]) < (point[2] -
fZ[ipl]))
384 if (iplclose == 0 || iplclose == (
fNz - 1)) {
389 r =
TMath::Sqrt(point[0] * point[0] + point[1] * point[1]);
396 r =
TMath::Sqrt(point[0] * point[0] + point[1] * point[1]);
405 memcpy(ptnew, point, 3 *
sizeof(
Double_t));
406 dz = 0.5 * (
fZ[ipl + 1] -
fZ[ipl]);
411 ptnew[2] -= 0.5 * (
fZ[ipl] +
fZ[ipl + 1]);
414 rmin2 =
fRmin[ipl + 1];
415 rmax2 =
fRmax[ipl + 1];
423 TGeoConeSeg::ComputeNormalS(ptnew, dir, norm, dz, rmin1, rmax1, rmin2, rmax2,
fC1,
fS1,
fC2,
fS2);
438 if ((point[2] <
fZ[0]) || (point[2] >
fZ[
fNz - 1]))
441 Double_t r2 = point[0] * point[0] + point[1] * point[1];
446 while ((izh - izl) > 1) {
447 if (point[2] >
fZ[izt])
451 izt = (izl + izh) >> 1;
463 rmin = (
fRmin[izl] * (dz - dz1) +
fRmin[izh] * dz1) / dz;
464 rmax = (
fRmax[izl] * (dz - dz1) +
fRmax[izh] * dz1) / dz;
466 if ((r2 < rmin * rmin) || (r2 > rmax * rmax))
500 if (iact < 3 && safe) {
504 if ((iact == 1) && (*safe > step))
514 if (ipl == (
fNz - 1))
521 special_case =
kTRUE;
524 point_new[0] = point[0] + sstep * dir[0];
525 point_new[1] = point[1] + sstep * dir[1];
526 point_new[2] = point[2] + sstep * dir[2];
529 return (
DistFromInside(point_new, dir, iact, step, safe) + sstep);
539 memcpy(point_new, point, 2 *
sizeof(
Double_t));
541 point_new[2] = point[2] - 0.5 * (
fZ[ipl] +
fZ[ipl + 1]);
555 snxt =
TGeoTubeSeg::DistFromInsideS(point_new, dir,
fRmin[ipl],
fRmax[ipl], dz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
567 for (
Int_t i = 0; i < 3; i++)
568 point_new[i] = point[i] + (snxt + 1E-6) * dir[i];
586 Int_t istep = (dir[2] > 0) ? 1 : -1;
588 if (iz < 0 || iz > (
fNz - 2))
594 memcpy(&local[0], point, 3 *
sizeof(
Double_t));
595 local[2] = point[2] - 0.5 * (zmin + zmax);
606 snxt =
TGeoTubeSeg::DistFromOutsideS(local, dir, rmin1, rmax1, dz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdphi);
611 snxt =
TGeoConeSeg::DistFromOutsideS(local, dir, dz, rmin1, rmax1, rmin2, rmax2,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
619 Int_t istep = (dir[2] > 0) ? 1 : -1;
621 if (iz < 0 || iz > (
fNz - 2))
632 if ((iact < 3) && safe) {
634 if ((iact == 1) && (*safe > step))
640 if ((point[2] <
fZ[0]) && (dir[2] <= 0))
642 if ((point[2] >
fZ[
fNz - 1]) && (dir[2] >= 0))
649 Double_t r2 = point[0] * point[0] + point[1] * point[1];
652 if (r2 > (radmax * radmax)) {
653 Double_t rpr = -point[0] * dir[0] - point[1] * dir[1];
654 Double_t nxy = dir[0] * dir[0] + dir[1] * dir[1];
655 if (rpr <
TMath::Sqrt((r2 - radmax * radmax) * nxy))
664 }
else if (ifirst >= (
fNz - 1)) {
686 if ((snum < 0) || (snum >=
fNz))
692 Warning(
"DefineSection",
"Shape %s: invalid rmin=%g rmax=%g",
GetName(), rmin, rmax);
693 if (snum == (
fNz - 1)) {
695 if (
fZ[0] >
fZ[snum]) {
742 Double_t zmax = start + ndiv * step;
747 Error(
"Divide",
"Shape %s: cannot divide a pcon on radius",
GetName());
755 for (is = 0; is <
fNz; is++)
760 for (
id = 0;
id < ndiv;
id++) {
767 for (ipl = 0; ipl <
fNz - 1; ipl++) {
771 if ((start + ndiv * step) >
fZ[ipl + 1])
776 zmax =
fZ[isect + 1];
780 Error(
"Divide",
"Shape %s: cannot divide pcon on Z if divided region is not between 2 planes",
GetName());
783 finder =
new TGeoPatternZ(voldiv, ndiv, start, start + ndiv * step);
788 for (
id = 0;
id < ndiv;
id++) {
790 Double_t z2 = start + (
id + 1) * step;
791 Double_t rmin1 = (
fRmin[isect] * (zmax - z1) -
fRmin[isect + 1] * (zmin - z1)) / (zmax - zmin);
792 Double_t rmax1 = (
fRmax[isect] * (zmax - z1) -
fRmax[isect + 1] * (zmin - z1)) / (zmax - zmin);
793 Double_t rmin2 = (
fRmin[isect] * (zmax - z2) -
fRmin[isect + 1] * (zmin - z2)) / (zmax - zmin);
794 Double_t rmax2 = (
fRmax[isect] * (zmax - z2) -
fRmax[isect + 1] * (zmin - z2)) / (zmax - zmin);
809 shape =
new TGeoCone(step / 2, rmin1, rmax1, rmin2, rmax2);
817 default:
Error(
"Divide",
"Shape %s: Wrong axis %d for division",
GetName(), iaxis);
return nullptr;
828 case 2:
return "PHI";
830 default:
return "UNDEFINED";
866 if (
fRmin[i] < param[0])
868 if (
fRmax[i] > param[1])
871 param[0] *= param[0];
872 param[1] *= param[1];
879 param[3] = param[2] +
fDphi;
887 if (ipl < 0 || ipl > (
fNz - 1)) {
888 Error(
"GetRmin",
"ipl=%i out of range (0,%i) in shape %s", ipl,
fNz - 1,
GetName());
899 if (ipl < 0 || ipl > (
fNz - 1)) {
900 Error(
"GetRmax",
"ipl=%i out of range (0,%i) in shape %s", ipl,
fNz - 1,
GetName());
911 if (ipl < 0 || ipl > (
fNz - 1)) {
912 Error(
"GetZ",
"ipl=%i out of range (0,%i) in shape %s", ipl,
fNz - 1,
GetName());
923 printf(
"*** Shape %s: TGeoPcon ***\n",
GetName());
924 printf(
" Nz = %i\n",
fNz);
925 printf(
" phi1 = %11.5f\n",
fPhi1);
926 printf(
" dphi = %11.5f\n",
fDphi);
927 for (
Int_t ipl = 0; ipl <
fNz; ipl++)
928 printf(
" plane %i: z=%11.5f Rmin=%11.5f Rmax=%11.5f\n", ipl,
fZ[ipl],
fRmin[ipl],
fRmax[ipl]);
929 printf(
" Bounding box:\n");
939 Int_t nbPnts, nbSegs, nbPols;
969 Int_t nbPnts = nz * 2 *
n;
977 Int_t indx = 0, indx2, k;
981 for (i = 0; i < nz * 2; i++) {
983 for (j = 1; j <
n; j++) {
985 buff.
fSegs[indx++] = indx2 + j - 1;
986 buff.
fSegs[indx++] = indx2 + j;
990 buff.
fSegs[indx++] = indx2 + j - 1;
991 buff.
fSegs[indx++] = indx2;
996 for (i = 0; i < 2; i++) {
997 indx2 = i * (nz - 1) * 2 *
n;
998 for (j = 0; j <
n; j++) {
1000 buff.
fSegs[indx++] = indx2 + j;
1001 buff.
fSegs[indx++] = indx2 +
n + j;
1006 for (i = 0; i < (nz - 1); i++) {
1009 for (j = 0; j <
n; j++) {
1010 buff.
fSegs[indx++] =
c + 2;
1011 buff.
fSegs[indx++] = indx2 + j;
1012 buff.
fSegs[indx++] = indx2 +
n * 2 + j;
1015 indx2 = i *
n * 2 +
n;
1016 for (j = 0; j <
n; j++) {
1017 buff.
fSegs[indx++] =
c + 3;
1018 buff.
fSegs[indx++] = indx2 + j;
1019 buff.
fSegs[indx++] = indx2 +
n * 2 + j;
1026 for (i = 1; i < (nz - 1); i++) {
1027 for (j = 0; j < 2; j++) {
1029 buff.
fSegs[indx++] = 2 * i *
n + j * (
n - 1);
1030 buff.
fSegs[indx++] = (2 * i + 1) *
n + j * (
n - 1);
1035 Int_t m =
n - 1 + (specialCase ? 1 : 0);
1040 for (j = 0; j <
n - 1; j++) {
1041 buff.
fPols[indx++] =
c + 3;
1042 buff.
fPols[indx++] = 4;
1043 buff.
fPols[indx++] = 2 * nz *
m + j;
1044 buff.
fPols[indx++] =
m + j;
1045 buff.
fPols[indx++] = 2 * nz *
m + j + 1;
1046 buff.
fPols[indx++] = j;
1048 for (j = 0; j <
n - 1; j++) {
1049 buff.
fPols[indx++] =
c + 3;
1050 buff.
fPols[indx++] = 4;
1051 buff.
fPols[indx++] = 2 * nz *
m +
n + j;
1052 buff.
fPols[indx++] = (nz * 2 - 2) *
m + j;
1053 buff.
fPols[indx++] = 2 * nz *
m +
n + j + 1;
1054 buff.
fPols[indx++] = (nz * 2 - 2) *
m +
m + j;
1057 buff.
fPols[indx++] =
c + 3;
1058 buff.
fPols[indx++] = 4;
1059 buff.
fPols[indx++] = 2 * nz *
m + j;
1060 buff.
fPols[indx++] =
m + j;
1061 buff.
fPols[indx++] = 2 * nz *
m;
1062 buff.
fPols[indx++] = j;
1064 buff.
fPols[indx++] =
c + 3;
1065 buff.
fPols[indx++] = 4;
1066 buff.
fPols[indx++] = 2 * nz *
m +
n + j;
1067 buff.
fPols[indx++] = (nz * 2 - 2) *
m +
m + j;
1068 buff.
fPols[indx++] = 2 * nz *
m +
n;
1069 buff.
fPols[indx++] = (nz * 2 - 2) *
m + j;
1073 for (k = 0; k < (nz - 1); k++) {
1074 for (j = 0; j <
n - 1; j++) {
1076 buff.
fPols[indx++] = 4;
1077 buff.
fPols[indx++] = 2 * k *
m + j;
1078 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 2) *
n + j + 1;
1079 buff.
fPols[indx++] = (2 * k + 2) *
m + j;
1080 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 2) *
n + j;
1082 for (j = 0; j <
n - 1; j++) {
1083 buff.
fPols[indx++] =
c + 1;
1084 buff.
fPols[indx++] = 4;
1085 buff.
fPols[indx++] = (2 * k + 1) *
m + j;
1086 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 3) *
n + j;
1087 buff.
fPols[indx++] = (2 * k + 3) *
m + j;
1088 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 3) *
n + j + 1;
1092 buff.
fPols[indx++] = 4;
1093 buff.
fPols[indx++] = 2 * k *
m + j;
1094 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 2) *
n;
1095 buff.
fPols[indx++] = (2 * k + 2) *
m + j;
1096 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 2) *
n + j;
1098 buff.
fPols[indx++] =
c + 1;
1099 buff.
fPols[indx++] = 4;
1100 buff.
fPols[indx++] = (2 * k + 1) *
m + j;
1101 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 3) *
n + j;
1102 buff.
fPols[indx++] = (2 * k + 3) *
m + j;
1103 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 3) *
n;
1110 indx2 = nz * 2 * (
n - 1);
1111 for (k = 0; k < (nz - 1); k++) {
1112 buff.
fPols[indx++] =
c + 2;
1113 buff.
fPols[indx++] = 4;
1114 buff.
fPols[indx++] = k == 0 ? indx2 : indx2 + 2 * nz *
n + 2 * (k - 1);
1115 buff.
fPols[indx++] = indx2 + 2 * (k + 1) *
n;
1116 buff.
fPols[indx++] = indx2 + 2 * nz *
n + 2 * k;
1117 buff.
fPols[indx++] = indx2 + (2 * k + 3) *
n;
1119 buff.
fPols[indx++] =
c + 2;
1120 buff.
fPols[indx++] = 4;
1121 buff.
fPols[indx++] = k == 0 ? indx2 +
n - 1 : indx2 + 2 * nz *
n + 2 * (k - 1) + 1;
1122 buff.
fPols[indx++] = indx2 + (2 * k + 3) *
n +
n - 1;
1123 buff.
fPols[indx++] = indx2 + 2 * nz *
n + 2 * k + 1;
1124 buff.
fPols[indx++] = indx2 + 2 * (k + 1) *
n +
n - 1;
1126 buff.
fPols[indx - 8] = indx2 +
n;
1127 buff.
fPols[indx - 2] = indx2 + 2 *
n - 1;
1138 const Int_t nbPnts = nz *
n + 2;
1140 if ((nz < 2) || (nbPnts <= 0) || (
n < 2))
1145 Int_t indx = 0, indx1 = 0, indx2 = 0, i, j;
1148 for (i = 0; i < nz; i++) {
1150 for (j = 1; j <
n; j++) {
1152 buff.
fSegs[indx++] = indx2 + j - 1;
1153 buff.
fSegs[indx++] = indx2 + j % (
n - 1);
1159 for (j = 0; j <
n; j++) {
1161 buff.
fSegs[indx++] = indx2 + j % (
n - 1);
1162 buff.
fSegs[indx++] = nbPnts - 2;
1165 indx2 = (nz - 1) *
n;
1167 for (j = 0; j <
n; j++) {
1169 buff.
fSegs[indx++] = indx2 + j % (
n - 1);
1170 buff.
fSegs[indx++] = nbPnts - 1;
1174 for (i = 0; i < (nz - 1); i++) {
1177 for (j = 0; j <
n; j++) {
1179 buff.
fSegs[indx++] = indx2 + j % (
n - 1);
1180 buff.
fSegs[indx++] = indx2 +
n + j % (
n - 1);
1188 indx2 = nz * (
n - 1);
1189 for (j = 0; j <
n - 1; j++) {
1191 buff.
fPols[indx++] = 3;
1192 buff.
fPols[indx++] = indx1 + j;
1193 buff.
fPols[indx++] = indx2 + j + 1;
1194 buff.
fPols[indx++] = indx2 + j;
1198 indx1 = (nz - 1) * (
n - 1);
1199 indx2 = nz * (
n - 1) +
n;
1200 for (j = 0; j <
n - 1; j++) {
1202 buff.
fPols[indx++] = 3;
1203 buff.
fPols[indx++] = indx1 + j;
1204 buff.
fPols[indx++] = indx2 + j;
1205 buff.
fPols[indx++] = indx2 + j + 1;
1209 for (
Int_t k = 0; k < (nz - 1); k++) {
1210 indx1 = k * (
n - 1);
1211 indx2 = nz * (
n - 1) +
n * 2 + k *
n;
1212 for (j = 0; j <
n - 1; j++) {
1214 buff.
fPols[indx++] = 4;
1215 buff.
fPols[indx++] = indx1 + j;
1216 buff.
fPols[indx++] = indx2 + j;
1217 buff.
fPols[indx++] = indx1 + j + (
n - 1);
1218 buff.
fPols[indx++] = indx2 + j + 1;
1228 if (ipl < 0 || ipl >
fNz - 2)
1229 return (safmin + 1.);
1235 memcpy(ptnew, point, 3 *
sizeof(
Double_t));
1236 ptnew[2] -= 0.5 * (
fZ[ipl] +
fZ[ipl + 1]);
1277 if (ipl == (
fNz - 1))
1284 dz = 0.5 * (
fZ[ipl + 1] -
fZ[ipl]);
1287 safmin =
TMath::Min(point[2] -
fZ[ipl - 1],
fZ[ipl + 2] - point[2]);
1291 if (saftmp < safmin)
1296 if (
fRmin[ipl + 1] > 0)
1306 if (safmin > 1E10) {
1336 else if (ipl ==
fNz - 1)
1338 dz = 0.5 * (
fZ[ipl + 1] -
fZ[ipl]);
1339 if (dz < 1E-8 && (ipl + 2 <
fNz)) {
1341 dz = 0.5 * (
fZ[ipl + 1] -
fZ[ipl]);
1351 while ((iplane <
fNz - 1) && saftmp < 1E10) {
1353 if (saftmp < safmin)
1360 while ((iplane >= 0) && saftmp < 1E10) {
1362 if (saftmp < safmin)
1376 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
1377 out <<
" phi1 = " <<
fPhi1 <<
";" << std::endl;
1378 out <<
" dphi = " <<
fDphi <<
";" << std::endl;
1379 out <<
" nz = " <<
fNz <<
";" << std::endl;
1380 out <<
" auto " <<
GetPointerName() <<
" = new TGeoPcon(\"" <<
GetName() <<
"\", phi1, dphi, nz);" << std::endl;
1382 out <<
" z = " <<
fZ[i] <<
";" << std::endl;
1383 out <<
" rmin = " <<
fRmin[i] <<
";" << std::endl;
1384 out <<
" rmax = " <<
fRmax[i] <<
";" << std::endl;
1385 out <<
" " <<
GetPointerName() <<
"->DefineSection(" << i <<
", z,rmin,rmax);" << std::endl;
1401 Error(
"SetDimensions",
"Pcon %s: Number of Z sections must be > 2",
GetName());
1420 Double_t phim = 0.5 * (phi1 + phi2);
1430 DefineSection(i, param[3 + 3 * i], param[4 + 3 * i], param[5 + 3 * i]);
1447 for (i = 0; i <
fNz; i++) {
1449 for (j = 0; j <
n; j++) {
1455 for (j = 0; j <
n; j++) {
1488 for (i = 0; i <
fNz; i++) {
1490 for (j = 0; j <
n; j++) {
1496 for (j = 0; j <
n; j++) {
1519 Int_t nvert, nsegs, npols;
1552 nvert = nsegs = npols = 0;
1562 nsegs = 4 * (nz *
n - 1 + (specialCase ? 1 : 0));
1563 npols = 2 * (nz *
n - 1 + (specialCase ? 1 : 0));
1566 nsegs = nz * (
n - 1) +
n * 2 + (nz - 1) *
n;
1567 npols = 2 * (
n - 1) + (nz - 1) * (
n - 1);
1581 Int_t nbPnts, nbSegs, nbPols;
1584 if (buffer.
SetRawSizes(nbPnts, 3 * nbPnts, nbSegs, 3 * nbSegs, nbPols, 6 * nbPols)) {
1615 Double_t phim = 0.5 * (phi1 + phi2);
1635 for (
Int_t i = 0; i < vecsize; i++)
1646 for (
Int_t i = 0; i < vecsize; i++)
1656 for (
Int_t i = 0; i < vecsize; i++)
1666 for (
Int_t i = 0; i < vecsize; i++)
1677 for (
Int_t i = 0; i < vecsize; i++)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
R__EXTERN TGeoManager * gGeoManager
Generic 3D primitive description class.
Bool_t SectionsValid(UInt_t mask) const
void SetSectionsValid(UInt_t mask)
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.
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
void FillBuffer3D(TBuffer3D &buffer, Int_t reqSections, Bool_t localFrame) const override
Fills the supplied buffer, with sections in desired frame See TBuffer3D.h for explanation of sections...
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
Compute distance from outside point to surface of the box.
void InspectShape() const override
Prints shape parameters.
A cone segment is a cone having a range in phi.
static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t c1, Double_t s1, Double_t c2, Double_t s2)
Compute normal to closest surface from POINT.
Double_t Capacity() const override
Computes capacity of the shape in [length^3].
static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t c1, Double_t s1, Double_t c2, Double_t s2, Double_t cm, Double_t sm, Double_t cdfi)
compute distance from outside point to surface of arbitrary tube
static Double_t SafetyS(const Double_t *point, Bool_t in, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Double_t phi1, Double_t phi2, Int_t skipz=0)
Static method to compute the closest distance from given point to this shape.
static Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, 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
The cones are defined by 5 parameters:
static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Compute normal to closest surface from POINT.
static Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Compute distance from inside point to surface of the cone (static) Boundary safe algorithm.
static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2)
Compute distance from outside point to surface of the tube Boundary safe algorithm.
static Double_t SafetyS(const Double_t *point, Bool_t in, Double_t dz, Double_t rmin1, Double_t rmax1, Double_t rmin2, Double_t rmax2, Int_t skipz=0)
computes the closest distance from given point to this shape, according to option.
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
TObjArray * GetListOfShapes() const
Int_t GetNsegments() const
Get number of segments approximating circles.
Node containing an offset.
Base finder class for patterns.
void SetDivIndex(Int_t index)
A polycone is represented by a sequence of tubes/cones, glued together at defined Z planes.
Double_t fSm
Cosine of (phi1+phi2)/2.
Double_t * GetRmax() const
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) override
Compute normal to closest surface from POINT.
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
Double_t SafetyToSegment(const Double_t *point, Int_t ipl, Bool_t in=kTRUE, Double_t safmin=TGeoShape::Big()) const
Compute safety from POINT to segment between planes ipl, ipl+1 within safmin.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void SetPoints(Double_t *points) const override
create polycone mesh points
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
compute distance from outside point to surface of the tube
TBuffer3D * MakeBuffer3D() const override
Creates a TBuffer3D describing this shape.
Bool_t Contains(const Double_t *point) const override
test if point is inside this shape check total z range
const char * GetAxisName(Int_t iaxis) const override
Returns name of axis IAXIS.
Double_t Capacity() const override
Computes capacity of the shape in [length^3].
void Streamer(TBuffer &) override
Stream an object of class TGeoPcon.
Int_t GetNmeshVertices() const override
Return number of vertices of the mesh representation.
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
Check the inside status for each of the points in the array.
virtual void DefineSection(Int_t snum, Double_t z, Double_t rmin, Double_t rmax)
Defines z position of a section plane, rmin and rmax at this z.
Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override
Get range of shape for a given axis.
Double_t fC1
Full phi range flag.
void InspectShape() const override
print shape parameters
void SetDimensions(Double_t *param) override
Set polycone dimensions starting from an array.
Double_t fCdphi
Sine of (phi1+phi2)/2.
Double_t fS1
Cosine of phi1.
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
Divide this polycone shape belonging to volume "voldiv" into ndiv volumes called divname,...
Double_t DistToSegZ(const Double_t *point, const Double_t *dir, Int_t &iz) const
compute distance to a pcon Z slice. Segment iz must be valid
Double_t fCm
Sine of phi1+dphi.
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
compute closest distance from point px,py to each corner
~TGeoPcon() override
destructor
Double_t DistFromInside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
compute distance from inside point to surface of the polycone
Bool_t HasInsideSurface() const
Returns true when pgon has internal surface It will be only disabled when all Rmin values are 0.
virtual Int_t GetNsegments() const
Returns number of segments on each mesh circle segment.
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Returns numbers of vertices, segments and polygons composing the shape mesh.
Double_t fS2
Cosine of phi1+dphi.
void SetSegsAndPolsNoInside(TBuffer3D &buff) const
Fill TBuffer3D structure for segments and polygons, when no inner surface exists.
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
Compute safe distance from each of the points in the input array.
void ComputeBBox() override
compute bounding box of the pcon Check if the sections are in increasing Z order
Double_t fC2
Sine of phi1.
void Sizeof3D() const override
fill size of this 3-D object
void SetSegsAndPols(TBuffer3D &buff) const override
Fill TBuffer3D structure for segments and polygons.
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Fills a static 3D buffer and returns a reference.
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Compute distance from array of input points having directions specified by dirs. Store output in dist...
void GetBoundingCylinder(Double_t *param) const override
Fill vector param[4] with the bounding cylinder parameters.
Double_t * GetRmin() const
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
computes the closest distance from given point to this shape, according to option.
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
Compute the normal for an array o points so that norm.dot.dir is positive Input: Arrays of point coor...
Base abstract class for all shapes.
Int_t GetBasicColor() const
Get the basic color (0-7).
void TransformPoints(Double_t *points, UInt_t NbPoints) const
Tranform a set of points (LocalToMaster)
void SetShapeBit(UInt_t f, Bool_t set)
Equivalent of TObject::SetBit.
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,...
static Bool_t IsSameWithinTolerance(Double_t a, Double_t b)
Check if two numbers differ with less than a tolerance.
const char * GetPointerName() const
Provide a pointer name containing uid.
Int_t ShapeDistancetoPrimitive(Int_t numpoints, Int_t px, Int_t py) const
Returns distance to shape primitive mesh.
const char * GetName() const override
Get the shape name.
static Double_t Tolerance()
A tube segment is a tube having a range in phi.
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.
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...
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.
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.
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...
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.
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.
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.
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
Int_t IndexOf(const TObject *obj) const override
TObject * At(Int_t idx) const override
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
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
Long64_t LocMin(Long64_t n, const T *a)
Returns index of array with the minimum element.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
T1 Sign(T1 a, T2 b)
Returns a value with the magnitude of a and the sign of b.
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
Long64_t LocMax(Long64_t n, const T *a)
Returns index of array with the maximum element.
constexpr Double_t DegToRad()
Conversion from degree to radian: .
Double_t Sqrt(Double_t x)
Returns the square root of x.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Long64_t BinarySearch(Long64_t n, const T *array, T value)
Binary search in an array of n values to locate value.
constexpr Double_t RadToDeg()
Conversion from radian to degree: .
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.