148 memset(fRmin, 0, nz *
sizeof(
Double_t));
149 memset(fRmax, 0, nz *
sizeof(
Double_t));
150 memset(fZ, 0, nz *
sizeof(
Double_t));
155 Double_t phim = 0.5 * (phi1 + phi2);
191 memset(fRmin, 0, nz *
sizeof(
Double_t));
192 memset(fRmax, 0, nz *
sizeof(
Double_t));
193 memset(fZ, 0, nz *
sizeof(
Double_t));
198 Double_t phim = 0.5 * (phi1 + phi2);
236 SetDimensions(param);
265 Double_t rmin1, rmax1, rmin2, rmax2, phi1, phi2, dz;
269 for (ipl = 0; ipl <
fNz - 1; ipl++) {
275 rmin2 =
fRmin[ipl + 1];
276 rmax2 =
fRmax[ipl + 1];
288 for (
Int_t isec = 0; isec <
fNz - 1; isec++) {
290 fZ[isec + 1] =
fZ[isec];
294 Error(
"ComputeBBox",
"Duplicated section %d/%d for shape %s", isec, isec + 1,
GetName());
297 if (
fZ[isec] >
fZ[isec + 1]) {
299 Fatal(
"ComputeBBox",
"Wrong section order");
306 Fatal(
"ComputeBBox",
"Shape %s at index %d: Not allowed first two or last two sections at same Z",
GetName(),
354 fOrigin[2] = (zmax + zmin) / 2;
357 fDZ = (zmax - zmin) / 2;
366 memset(norm, 0, 3 *
sizeof(
Double_t));
369 Double_t dz, rmin1, rmax1, rmin2, rmax2;
372 if (ipl == (
fNz - 1) || ipl < 0) {
377 Int_t iplclose = ipl;
378 if ((
fZ[ipl + 1] - point[2]) < (point[2] -
fZ[ipl]))
382 if (iplclose == 0 || iplclose == (
fNz - 1)) {
387 r =
TMath::Sqrt(point[0] * point[0] + point[1] * point[1]);
394 r =
TMath::Sqrt(point[0] * point[0] + point[1] * point[1]);
403 memcpy(ptnew, point, 3 *
sizeof(
Double_t));
409 ptnew[2] -= 0.5 * (
fZ[ipl] +
fZ[ipl + 1]);
412 rmin2 =
fRmin[ipl + 1];
413 rmax2 =
fRmax[ipl + 1];
421 TGeoConeSeg::ComputeNormalS(ptnew, dir, norm, dz, rmin1, rmax1, rmin2, rmax2,
fC1,
fS1,
fC2,
fS2);
436 if ((point[2] <
fZ[0]) || (point[2] >
fZ[
fNz - 1]))
439 Double_t r2 = point[0] * point[0] + point[1] * point[1];
444 while ((izh - izl) > 1) {
445 if (point[2] >
fZ[izt])
449 izt = (izl + izh) >> 1;
464 if ((r2 < rmin * rmin) || (r2 > rmax * rmax))
498 if (iact < 3 && safe) {
502 if ((iact == 1) && (*safe > step))
512 if (ipl == (
fNz - 1))
519 special_case =
kTRUE;
522 point_new[0] = point[0] + sstep * dir[0];
523 point_new[1] = point[1] + sstep * dir[1];
524 point_new[2] = point[2] + sstep * dir[2];
527 return (
DistFromInside(point_new, dir, iact, step, safe) + sstep);
537 memcpy(point_new, point, 2 *
sizeof(
Double_t));
539 point_new[2] = point[2] - 0.5 * (
fZ[ipl] +
fZ[ipl + 1]);
553 snxt =
TGeoTubeSeg::DistFromInsideS(point_new, dir,
fRmin[ipl],
fRmax[ipl], dz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
565 for (
Int_t i = 0; i < 3; i++)
566 point_new[i] = point[i] + (snxt + 1E-6) * dir[i];
584 Int_t istep = (dir[2] > 0) ? 1 : -1;
586 if (iz < 0 || iz > (
fNz - 2))
592 memcpy(&local[0], point, 3 *
sizeof(
Double_t));
593 local[2] = point[2] - 0.5 * (zmin + zmax);
604 snxt =
TGeoTubeSeg::DistFromOutsideS(local, dir, rmin1, rmax1, dz,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
fCdphi);
609 snxt =
TGeoConeSeg::DistFromOutsideS(local, dir, dz, rmin1, rmax1, rmin2, rmax2,
fC1,
fS1,
fC2,
fS2,
fCm,
fSm,
617 Int_t istep = (dir[2] > 0) ? 1 : -1;
619 if (iz < 0 || iz > (
fNz - 2))
630 if ((iact < 3) && safe) {
632 if ((iact == 1) && (*safe > step))
638 if ((point[2] <
fZ[0]) && (dir[2] <= 0))
640 if ((point[2] >
fZ[
fNz - 1]) && (dir[2] >= 0))
647 Double_t r2 = point[0] * point[0] + point[1] * point[1];
650 if (r2 > (radmax * radmax)) {
651 Double_t rpr = -point[0] * dir[0] - point[1] * dir[1];
652 Double_t nxy = dir[0] * dir[0] + dir[1] * dir[1];
653 if (rpr <
TMath::Sqrt((r2 - radmax * radmax) * nxy))
662 }
else if (ifirst >= (
fNz - 1)) {
684 if ((snum < 0) || (snum >=
fNz))
690 Warning(
"DefineSection",
"Shape %s: invalid rmin=%g rmax=%g",
GetName(), rmin, rmax);
691 if (snum == (
fNz - 1)) {
693 if (
fZ[0] >
fZ[snum]) {
736 TGeoVolumeMulti *vmulti;
737 TGeoPatternFinder *finder;
745 Error(
"Divide",
"Shape %s: cannot divide a pcon on radius",
GetName());
748 finder =
new TGeoPatternCylPhi(voldiv, ndiv,
start,
start + ndiv * step);
753 for (is = 0; is <
fNz; is++)
755 vol =
new TGeoVolume(divname, shape, voldiv->
GetMedium());
758 for (
id = 0;
id < ndiv;
id++) {
765 for (ipl = 0; ipl <
fNz - 1; ipl++) {
769 if ((
start + ndiv * step) >
fZ[ipl + 1])
774 zmax =
fZ[isect + 1];
778 Error(
"Divide",
"Shape %s: cannot divide pcon on Z if divided region is not between 2 planes",
GetName());
781 finder =
new TGeoPatternZ(voldiv, ndiv,
start,
start + ndiv * step);
786 for (
id = 0;
id < ndiv;
id++) {
789 Double_t rmin1 = (
fRmin[isect] * (zmax - z1) -
fRmin[isect + 1] * (zmin - z1)) / (zmax - zmin);
790 Double_t rmax1 = (
fRmax[isect] * (zmax - z1) -
fRmax[isect + 1] * (zmin - z1)) / (zmax - zmin);
791 Double_t rmin2 = (
fRmin[isect] * (zmax - z2) -
fRmin[isect + 1] * (zmin - z2)) / (zmax - zmin);
792 Double_t rmax2 = (
fRmax[isect] * (zmax - z2) -
fRmax[isect + 1] * (zmin - z2)) / (zmax - zmin);
802 shape =
new TGeoConeSeg(step / 2, rmin1, rmax1, rmin2, rmax2,
fPhi1,
fPhi1 +
fDphi);
805 shape =
new TGeoTube(
fRmin[isect],
fRmax[isect], step / 2);
807 shape =
new TGeoCone(step / 2, rmin1, rmax1, rmin2, rmax2);
809 vol =
new TGeoVolume(divname, shape, voldiv->
GetMedium());
815 default:
Error(
"Divide",
"Shape %s: Wrong axis %d for division",
GetName(), iaxis);
return nullptr;
826 case 2:
return "PHI";
828 default:
return "UNDEFINED";
864 if (
fRmin[i] < param[0])
866 if (
fRmax[i] > param[1])
869 param[0] *= param[0];
870 param[1] *= param[1];
877 param[3] = param[2] +
fDphi;
885 if (ipl < 0 || ipl > (
fNz - 1)) {
886 Error(
"GetRmin",
"ipl=%i out of range (0,%i) in shape %s", ipl,
fNz - 1,
GetName());
897 if (ipl < 0 || ipl > (
fNz - 1)) {
898 Error(
"GetRmax",
"ipl=%i out of range (0,%i) in shape %s", ipl,
fNz - 1,
GetName());
909 if (ipl < 0 || ipl > (
fNz - 1)) {
910 Error(
"GetZ",
"ipl=%i out of range (0,%i) in shape %s", ipl,
fNz - 1,
GetName());
921 printf(
"*** Shape %s: TGeoPcon ***\n",
GetName());
922 printf(
" Nz = %i\n",
fNz);
923 printf(
" phi1 = %11.5f\n",
fPhi1);
924 printf(
" dphi = %11.5f\n",
fDphi);
925 for (
Int_t ipl = 0; ipl <
fNz; ipl++)
926 printf(
" plane %i: z=%11.5f Rmin=%11.5f Rmax=%11.5f\n", ipl,
fZ[ipl],
fRmin[ipl],
fRmax[ipl]);
927 printf(
" Bounding box:\n");
937 Int_t nbPnts, nbSegs, nbPols;
967 Int_t nbPnts = nz * 2 *
n;
975 Int_t indx = 0, indx2, k;
979 for (i = 0; i < nz * 2; i++) {
981 for (j = 1; j <
n; j++) {
983 buff.
fSegs[indx++] = indx2 + j - 1;
984 buff.
fSegs[indx++] = indx2 + j;
988 buff.
fSegs[indx++] = indx2 + j - 1;
989 buff.
fSegs[indx++] = indx2;
994 for (i = 0; i < 2; i++) {
995 indx2 = i * (nz - 1) * 2 *
n;
996 for (j = 0; j <
n; j++) {
998 buff.
fSegs[indx++] = indx2 + j;
999 buff.
fSegs[indx++] = indx2 +
n + j;
1004 for (i = 0; i < (nz - 1); i++) {
1007 for (j = 0; j <
n; j++) {
1008 buff.
fSegs[indx++] =
c + 2;
1009 buff.
fSegs[indx++] = indx2 + j;
1010 buff.
fSegs[indx++] = indx2 +
n * 2 + j;
1013 indx2 = i *
n * 2 +
n;
1014 for (j = 0; j <
n; j++) {
1015 buff.
fSegs[indx++] =
c + 3;
1016 buff.
fSegs[indx++] = indx2 + j;
1017 buff.
fSegs[indx++] = indx2 +
n * 2 + j;
1024 for (i = 1; i < (nz - 1); i++) {
1025 for (j = 0; j < 2; j++) {
1027 buff.
fSegs[indx++] = 2 * i *
n + j * (
n - 1);
1028 buff.
fSegs[indx++] = (2 * i + 1) *
n + j * (
n - 1);
1033 Int_t m =
n - 1 + (specialCase ? 1 : 0);
1038 for (j = 0; j <
n - 1; j++) {
1039 buff.
fPols[indx++] =
c + 3;
1040 buff.
fPols[indx++] = 4;
1041 buff.
fPols[indx++] = 2 * nz *
m + j;
1042 buff.
fPols[indx++] =
m + j;
1043 buff.
fPols[indx++] = 2 * nz *
m + j + 1;
1044 buff.
fPols[indx++] = j;
1046 for (j = 0; j <
n - 1; j++) {
1047 buff.
fPols[indx++] =
c + 3;
1048 buff.
fPols[indx++] = 4;
1049 buff.
fPols[indx++] = 2 * nz *
m +
n + j;
1050 buff.
fPols[indx++] = (nz * 2 - 2) *
m + j;
1051 buff.
fPols[indx++] = 2 * nz *
m +
n + j + 1;
1052 buff.
fPols[indx++] = (nz * 2 - 2) *
m +
m + j;
1055 buff.
fPols[indx++] =
c + 3;
1056 buff.
fPols[indx++] = 4;
1057 buff.
fPols[indx++] = 2 * nz *
m + j;
1058 buff.
fPols[indx++] =
m + j;
1059 buff.
fPols[indx++] = 2 * nz *
m;
1060 buff.
fPols[indx++] = j;
1062 buff.
fPols[indx++] =
c + 3;
1063 buff.
fPols[indx++] = 4;
1064 buff.
fPols[indx++] = 2 * nz *
m +
n + j;
1065 buff.
fPols[indx++] = (nz * 2 - 2) *
m +
m + j;
1066 buff.
fPols[indx++] = 2 * nz *
m +
n;
1067 buff.
fPols[indx++] = (nz * 2 - 2) *
m + j;
1071 for (k = 0; k < (nz - 1); k++) {
1072 for (j = 0; j <
n - 1; j++) {
1074 buff.
fPols[indx++] = 4;
1075 buff.
fPols[indx++] = 2 * k *
m + j;
1076 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 2) *
n + j + 1;
1077 buff.
fPols[indx++] = (2 * k + 2) *
m + j;
1078 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 2) *
n + j;
1080 for (j = 0; j <
n - 1; j++) {
1081 buff.
fPols[indx++] =
c + 1;
1082 buff.
fPols[indx++] = 4;
1083 buff.
fPols[indx++] = (2 * k + 1) *
m + j;
1084 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 3) *
n + j;
1085 buff.
fPols[indx++] = (2 * k + 3) *
m + j;
1086 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 3) *
n + j + 1;
1090 buff.
fPols[indx++] = 4;
1091 buff.
fPols[indx++] = 2 * k *
m + j;
1092 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 2) *
n;
1093 buff.
fPols[indx++] = (2 * k + 2) *
m + j;
1094 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 2) *
n + j;
1096 buff.
fPols[indx++] =
c + 1;
1097 buff.
fPols[indx++] = 4;
1098 buff.
fPols[indx++] = (2 * k + 1) *
m + j;
1099 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 3) *
n + j;
1100 buff.
fPols[indx++] = (2 * k + 3) *
m + j;
1101 buff.
fPols[indx++] = nz * 2 *
m + (2 * k + 3) *
n;
1108 indx2 = nz * 2 * (
n - 1);
1109 for (k = 0; k < (nz - 1); k++) {
1110 buff.
fPols[indx++] =
c + 2;
1111 buff.
fPols[indx++] = 4;
1112 buff.
fPols[indx++] = k == 0 ? indx2 : indx2 + 2 * nz *
n + 2 * (k - 1);
1113 buff.
fPols[indx++] = indx2 + 2 * (k + 1) *
n;
1114 buff.
fPols[indx++] = indx2 + 2 * nz *
n + 2 * k;
1115 buff.
fPols[indx++] = indx2 + (2 * k + 3) *
n;
1117 buff.
fPols[indx++] =
c + 2;
1118 buff.
fPols[indx++] = 4;
1119 buff.
fPols[indx++] = k == 0 ? indx2 +
n - 1 : indx2 + 2 * nz *
n + 2 * (k - 1) + 1;
1120 buff.
fPols[indx++] = indx2 + (2 * k + 3) *
n +
n - 1;
1121 buff.
fPols[indx++] = indx2 + 2 * nz *
n + 2 * k + 1;
1122 buff.
fPols[indx++] = indx2 + 2 * (k + 1) *
n +
n - 1;
1124 buff.
fPols[indx - 8] = indx2 +
n;
1125 buff.
fPols[indx - 2] = indx2 + 2 *
n - 1;
1136 const Int_t nbPnts = nz *
n + 2;
1138 if ((nz < 2) || (nbPnts <= 0) || (
n < 2))
1143 Int_t indx = 0, indx1 = 0, indx2 = 0, i, j;
1146 for (i = 0; i < nz; i++) {
1148 for (j = 1; j <
n; j++) {
1150 buff.
fSegs[indx++] = indx2 + j - 1;
1151 buff.
fSegs[indx++] = indx2 + j % (
n - 1);
1157 for (j = 0; j <
n; j++) {
1159 buff.
fSegs[indx++] = indx2 + j % (
n - 1);
1160 buff.
fSegs[indx++] = nbPnts - 2;
1163 indx2 = (nz - 1) *
n;
1165 for (j = 0; j <
n; j++) {
1167 buff.
fSegs[indx++] = indx2 + j % (
n - 1);
1168 buff.
fSegs[indx++] = nbPnts - 1;
1172 for (i = 0; i < (nz - 1); i++) {
1175 for (j = 0; j <
n; j++) {
1177 buff.
fSegs[indx++] = indx2 + j % (
n - 1);
1178 buff.
fSegs[indx++] = indx2 +
n + j % (
n - 1);
1186 indx2 = nz * (
n - 1);
1187 for (j = 0; j <
n - 1; j++) {
1189 buff.
fPols[indx++] = 3;
1190 buff.
fPols[indx++] = indx1 + j;
1191 buff.
fPols[indx++] = indx2 + j + 1;
1192 buff.
fPols[indx++] = indx2 + j;
1196 indx1 = (nz - 1) * (
n - 1);
1197 indx2 = nz * (
n - 1) +
n;
1198 for (j = 0; j <
n - 1; j++) {
1200 buff.
fPols[indx++] = 3;
1201 buff.
fPols[indx++] = indx1 + j;
1202 buff.
fPols[indx++] = indx2 + j;
1203 buff.
fPols[indx++] = indx2 + j + 1;
1207 for (
Int_t k = 0; k < (nz - 1); k++) {
1208 indx1 = k * (
n - 1);
1209 indx2 = nz * (
n - 1) +
n * 2 + k *
n;
1210 for (j = 0; j <
n - 1; j++) {
1212 buff.
fPols[indx++] = 4;
1213 buff.
fPols[indx++] = indx1 + j;
1214 buff.
fPols[indx++] = indx2 + j;
1215 buff.
fPols[indx++] = indx1 + j + (
n - 1);
1216 buff.
fPols[indx++] = indx2 + j + 1;
1226 if (ipl < 0 || ipl >
fNz - 2)
1227 return (safmin + 1.);
1233 memcpy(ptnew, point, 3 *
sizeof(
Double_t));
1234 ptnew[2] -= 0.5 * (
fZ[ipl] +
fZ[ipl + 1]);
1275 if (ipl == (
fNz - 1))
1285 safmin =
TMath::Min(point[2] -
fZ[ipl - 1],
fZ[ipl + 2] - point[2]);
1289 if (saftmp < safmin)
1294 if (
fRmin[ipl + 1] > 0)
1304 if (safmin > 1E10) {
1334 else if (ipl ==
fNz - 1)
1337 if (dz < 1E-8 && (ipl + 2 <
fNz)) {
1349 while ((iplane <
fNz - 1) && saftmp < 1E10) {
1351 if (saftmp < safmin)
1358 while ((iplane >= 0) && saftmp < 1E10) {
1360 if (saftmp < safmin)
1374 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
1375 out <<
" phi1 = " <<
fPhi1 <<
";" << std::endl;
1376 out <<
" dphi = " <<
fDphi <<
";" << std::endl;
1377 out <<
" nz = " <<
fNz <<
";" << std::endl;
1378 out <<
" auto " <<
GetPointerName() <<
" = new TGeoPcon(\"" <<
GetName() <<
"\", phi1, dphi, nz);" << std::endl;
1380 out <<
" z = " <<
fZ[i] <<
";" << std::endl;
1381 out <<
" rmin = " <<
fRmin[i] <<
";" << std::endl;
1382 out <<
" rmax = " <<
fRmax[i] <<
";" << std::endl;
1383 out <<
" " <<
GetPointerName() <<
"->DefineSection(" << i <<
", z,rmin,rmax);" << std::endl;
1399 Error(
"SetDimensions",
"Pcon %s: Number of Z sections must be > 2",
GetName());
1418 Double_t phim = 0.5 * (phi1 + phi2);
1428 DefineSection(i, param[3 + 3 * i], param[4 + 3 * i], param[5 + 3 * i]);
1445 for (i = 0; i <
fNz; i++) {
1447 for (j = 0; j <
n; j++) {
1453 for (j = 0; j <
n; j++) {
1486 for (i = 0; i <
fNz; i++) {
1488 for (j = 0; j <
n; j++) {
1494 for (j = 0; j <
n; j++) {
1517 Int_t nvert, nsegs, npols;
1529 if (!array || npoints <= 0)
1539 if (!(dPhiDeg > 0.0))
1550 std::vector<ZSeg> zsegs;
1551 zsegs.reserve(
fNz - 1);
1554 for (
Int_t i = 0; i <
fNz - 1; ++i) {
1561 zsegs.push_back({i, z0, z1, len});
1564 if (zsegs.empty() || sumLen <= 0.0)
1568 Int_t outPoints = npoints;
1571 outPoints = (npoints + 1) / 2;
1572 inPoints = npoints - outPoints;
1576 auto distributeOverZ = [&](
Int_t N) {
1577 std::vector<Int_t> perZ(zsegs.size(), 0);
1583 std::vector<Double_t> frac(zsegs.size(), 0.0);
1584 for (
size_t k = 0; k < zsegs.size(); ++k) {
1589 frac[k] = ideal - base;
1593 Int_t rem =
N - assigned;
1595 std::vector<size_t> idx(zsegs.size());
1596 for (
size_t k = 0; k < zsegs.size(); ++k)
1598 std::sort(idx.begin(), idx.end(), [&](
size_t a,
size_t b) { return frac[a] > frac[b]; });
1600 perZ[idx[
r % idx.size()]]++;
1610 auto perZ = distributeOverZ(
N);
1612 for (
size_t kz = 0; kz < zsegs.size(); ++kz) {
1613 const Int_t segPts = perZ[kz];
1617 const Int_t i = zsegs[kz].i;
1624 if (r0 <= 0.0 && r1 <= 0.0)
1634 const Int_t q = segPts / nGen;
1635 const Int_t rem = segPts % nGen;
1639 for (
Int_t ig = 0; ig < nGen; ++ig) {
1640 const Int_t m =
q + (ig < rem ? 1 : 0);
1650 for (
Int_t j = 0; j <
m; ++j) {
1651 if (icrt + 3 > 3 * npoints)
1655 const Double_t z = z0 + t * (z1 - z0);
1658 array[icrt++] =
r *
c;
1659 array[icrt++] =
r * s;
1671 if (!fillSurface(outPoints,
fRmax, icrt))
1676 if (!fillSurface(inPoints,
fRmin, icrt))
1712 nvert = nsegs = npols = 0;
1722 nsegs = 4 * (nz *
n - 1 + (specialCase ? 1 : 0));
1723 npols = 2 * (nz *
n - 1 + (specialCase ? 1 : 0));
1726 nsegs = nz * (
n - 1) +
n * 2 + (nz - 1) *
n;
1727 npols = 2 * (
n - 1) + (nz - 1) * (
n - 1);
1741 Int_t nbPnts, nbSegs, nbPols;
1744 if (buffer.SetRawSizes(nbPnts, 3 * nbPnts, nbSegs, 3 * nbSegs, nbPols, 6 * nbPols)) {
1753 if (!buffer.fLocalFrame) {
1775 Double_t phim = 0.5 * (phi1 + phi2);
1795 for (
Int_t i = 0; i < vecsize; i++)
1806 for (
Int_t i = 0; i < vecsize; i++)
1816 for (
Int_t i = 0; i < vecsize; i++)
1826 for (
Int_t i = 0; i < vecsize; i++)
1837 for (
Int_t i = 0; i < vecsize; i++)
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
const char Option_t
Option string (const char).
externTGeoManager * gGeoManager
Generic 3D primitive description class.
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
Fill 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
void InspectShape() const override
Double_t Capacity() const override
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)
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 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)
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)
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)
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)
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)
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)
void SetDivIndex(Int_t index)
Double_t fSm
! Sine of (phi1+phi2)/2
Double_t * GetRmax() const
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
Double_t SafetyToSegment(const Double_t *point, Int_t ipl, Bool_t in=kTRUE, Double_t safmin=TGeoShape::Big()) const
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void SetPoints(Double_t *points) const override
virtual Int_t GetNsegments() const
Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const override
Double_t DistFromOutside(const Double_t *point, const Double_t *dir, Int_t iact=1, Double_t step=TGeoShape::Big(), Double_t *safe=nullptr) const override
TBuffer3D * MakeBuffer3D() const override
Bool_t Contains(const Double_t *point) const override
const char * GetAxisName(Int_t iaxis) const override
Double_t Capacity() const override
void Streamer(TBuffer &) override
Stream an object of class TObject.
Int_t GetNmeshVertices() const override
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override
Double_t fC1
! Cosine of phi1
void InspectShape() const override
void SetDimensions(Double_t *param) override
Double_t fCdphi
! Cosine of dphi
Bool_t fFullPhi
! Full phi range flag
Double_t fS1
! Sine of phi1
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
Double_t DistToSegZ(const Double_t *point, const Double_t *dir, Int_t &iz) const
Double_t fCm
! Cosine of (phi1+phi2)/2
TGeoPcon(const TGeoPcon &)=delete
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
Computes distance from point (px,py) to the object.
virtual void DefineSection(Int_t snum, Double_t z, Double_t rmin, Double_t rmax)
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
Bool_t HasInsideSurface() const
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Double_t fS2
! Sine of phi1+dphi
void SetSegsAndPolsNoInside(TBuffer3D &buff) const
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
void ComputeBBox() override
Double_t fC2
! Cosine of phi1+dphi
void Sizeof3D() const override
void SetSegsAndPols(TBuffer3D &buff) const override
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Stub implementation to avoid forcing implementation at this stage.
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
void GetBoundingCylinder(Double_t *param) const override
Double_t * GetRmin() const
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
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.
TGeoShape()
Default constructor.
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()
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)
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)
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 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 Double_t DistFromInsideS(const Double_t *point, const Double_t *dir, Double_t rmin, Double_t rmax, Double_t dz)
static Double_t DistFromOutsideS(const Double_t *point, const Double_t *dir, Double_t rmin, Double_t rmax, Double_t dz)
static void ComputeNormalS(const Double_t *point, const Double_t *dir, Double_t *norm, Double_t rmin, Double_t rmax, Double_t dz)
static Double_t SafetyS(const Double_t *point, Bool_t in, Double_t rmin, Double_t rmax, Double_t dz, Int_t skipz=0)
void AddVolume(TGeoVolume *vol)
Add a volume with valid shape to the list of volumes.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
void AddNodeOffset(TGeoVolume *vol, Int_t copy_no, Double_t offset=0, Option_t *option="")
Add a division node to the list of nodes.
TGeoMedium * GetMedium() const
void SetFinder(TGeoPatternFinder *finder)
Int_t GetNdaughters() const
TObject * At(Int_t idx) const override
Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
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 E()
Base of natural log: .
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.