154 Double_t r1min, r1max, r2min, r2max, rmin, rmax;
221 fOrigin[2] = (zmax + zmin) / 2;
225 fDZ = (zmax - zmin) / 2;
233 Double_t rxy2 = point[0] * point[0] + point[1] * point[1];
234 Double_t r2 = rxy2 + point[2] * point[2];
284 if (norm[0] * dir[0] + norm[1] * dir[1] + norm[2] * dir[2] < 0) {
304 Double_t r2 = point[0] * point[0] + point[1] * point[1] + point[2] * point[2];
323 if (r2 * ddp * ddp < tol * tol)
326 if (r2 * ddp * ddp < tol * tol)
354 Double_t r2 = point[0] * point[0] + point[1] * point[1] + point[2] * point[2];
388 Double_t r2 = point[0] * point[0] + point[1] * point[1] + point[2] * point[2];
426 const Int_t numPoints = 2 *
n * nz;
440 if (iact < 3 && safe) {
445 if (iact == 1 && step < *safe)
449 Double_t r1, r2, z1, z2, dz, si, ci;
450 Double_t rxy2 = point[0] * point[0] + point[1] * point[1];
451 r2 = rxy2 + point[2] * point[2];
455 Double_t rdotn = point[0] * dir[0] + point[1] * dir[1] + point[2] * dir[2];
471 if (inrmax && inrmin) {
509 Double_t b, delta, xnew, ynew, znew, phi0, ddp;
517 if (point[2] * dir[2] < 0) {
518 snxt = -point[2] / dir[2];
519 ptnew[0] = point[0] + snxt * dir[0];
520 ptnew[1] = point[1] + snxt * dir[1];
540 dz = 0.5 * (z2 - z1);
543 ptnew[2] = point[2] - 0.5 * (z1 + z2);
545 Double_t rin = 0.5 * (r1 + r2 + (r2 - r1) * ptnew[2] * zinv);
556 ptnew[0] * dir[0] + ptnew[1] * dir[1] + 0.5 * (r1 - r2) * dir[2] * zinv *
TMath::Sqrt(rxy2);
557 if (sigz * ddotn >= 0 || -
b + delta < 1.E-9)
562 znew = ptnew[2] + snxt * dir[2];
567 xnew = ptnew[0] + snxt * dir[0];
568 ynew = ptnew[1] + snxt * dir[1];
578 if (!skip && st1 > 1E10) {
580 znew = ptnew[2] + snxt * dir[2];
585 xnew = ptnew[0] + snxt * dir[0];
586 ynew = ptnew[1] + snxt * dir[1];
603 if (point[2] * dir[2] < 0) {
604 snxt = -point[2] / dir[2];
605 ptnew[0] = point[0] + snxt * dir[0];
606 ptnew[1] = point[1] + snxt * dir[1];
626 dz = 0.5 * (z2 - z1);
629 ptnew[2] = point[2] - 0.5 * (z1 + z2);
631 Double_t rin = 0.5 * (r1 + r2 + (r2 - r1) * ptnew[2] * zinv);
642 ptnew[0] * dir[0] + ptnew[1] * dir[1] + 0.5 * (r1 - r2) * dir[2] * zinv *
TMath::Sqrt(rxy2);
643 if (sigz * ddotn <= 0 || -
b + delta < 1.E-9)
648 znew = ptnew[2] + snxt * dir[2];
653 xnew = ptnew[0] + snxt * dir[0];
654 ynew = ptnew[1] + snxt * dir[1];
664 if (!skip && st2 > 1E10) {
666 znew = ptnew[2] + snxt * dir[2];
671 xnew = ptnew[0] + snxt * dir[0];
672 ynew = ptnew[1] + snxt * dir[1];
699 safety = point[0] *
s1 - point[1] *
c1;
701 un = dir[0] *
s1 - dir[1] *
c1;
704 ptnew[0] = point[0] + s * dir[0];
705 ptnew[1] = point[1] + s * dir[1];
706 ptnew[2] = point[2] + s * dir[2];
707 if ((ptnew[1] * cm - ptnew[0] * sm) <= 0) {
714 safety = -point[0] * s2 + point[1] *
c2;
716 un = -dir[0] * s2 + dir[1] *
c2;
719 ptnew[0] = point[0] + s * dir[0];
720 ptnew[1] = point[1] + s * dir[1];
721 ptnew[2] = point[2] + s * dir[2];
722 if ((ptnew[1] * cm - ptnew[0] * sm) >= 0) {
740 Double_t rxy2 = point[0] * point[0] + point[1] * point[1];
742 Double_t rad2 = rxy2 + point[2] * point[2];
760 if (iact < 3 && safe) {
787 if (iact == 1 && step < *safe)
796 Double_t b, delta, xnew, ynew, znew, phi0, ddp;
797 Double_t rdotn = point[0] * dir[0] + point[1] * dir[1] + point[2] * dir[2];
822 if (point[2] * dir[2] < 0)
823 sn1 = -point[2] / dir[2];
826 Double_t r1, r2, z1, z2, dz, ptnew[3];
840 dz = 0.5 * (z2 - z1);
843 ptnew[2] = point[2] - 0.5 * (z1 + z2);
845 Double_t rin = 0.5 * (r1 + r2 + (r2 - r1) * ptnew[2] * zinv);
850 ptnew[0] * dir[0] + ptnew[1] * dir[1] + 0.5 * (r1 - r2) * dir[2] * zinv *
TMath::Sqrt(rxy2);
851 if (sigz * ddotn <= 0)
857 znew = ptnew[2] + snxt * dir[2];
862 xnew = ptnew[0] + snxt * dir[0];
863 ynew = ptnew[1] + snxt * dir[1];
874 znew = ptnew[2] + snxt * dir[2];
879 xnew = ptnew[0] + snxt * dir[0];
880 ynew = ptnew[1] + snxt * dir[1];
896 if (point[2] * dir[2] < 0)
897 sn1 = -point[2] / dir[2];
900 Double_t r1, r2, z1, z2, dz, ptnew[3];
914 dz = 0.5 * (z2 - z1);
917 ptnew[2] = point[2] - 0.5 * (z1 + z2);
919 Double_t rin = 0.5 * (r1 + r2 + (r2 - r1) * ptnew[2] * zinv);
924 ptnew[0] * dir[0] + ptnew[1] * dir[1] + 0.5 * (r1 - r2) * dir[2] * zinv *
TMath::Sqrt(rxy2);
925 if (sigz * ddotn >= 0)
931 znew = ptnew[2] + snxt * dir[2];
936 xnew = ptnew[0] + snxt * dir[0];
937 ynew = ptnew[1] + snxt * dir[1];
948 znew = ptnew[2] + snxt * dir[2];
953 xnew = ptnew[0] + snxt * dir[0];
954 ynew = ptnew[1] + snxt * dir[1];
994 Double_t r2 = point[0] * point[0] + point[1] * point[1] + point[2] * point[2];
995 Double_t b = point[0] * dir[0] + point[1] * dir[1] + point[2] * dir[2];
1010 s = (firstcross) ? (-
b -
d) : (-
b +
d);
1016 for (i = 0; i < 3; i++)
1017 pt[i] = point[i] + s * dir[i];
1035 Double_t end = start + ndiv * step;
1042 for (
id = 0;
id < ndiv;
id++) {
1060 for (
id = 0;
id < ndiv;
id++) {
1070 for (
id = 0;
id < ndiv;
id++) {
1079 default:
Error(
"Divide",
"In shape %s wrong axis type for division",
GetName());
return nullptr;
1090 case 2:
return "PHI";
1091 case 3:
return "THETA";
1092 default:
return "UNDEFINED";
1137 param[0] =
fRmin * smin;
1138 param[0] *= param[0];
1141 param[1] =
fRmax * smax;
1142 param[1] *= param[1];
1149 while (param[3] < param[2])
1158 printf(
"*** Shape %s: TGeoSphere ***\n",
GetName());
1159 printf(
" Rmin = %11.5f\n",
fRmin);
1160 printf(
" Rmax = %11.5f\n",
fRmax);
1161 printf(
" Th1 = %11.5f\n",
fTheta1);
1162 printf(
" Th2 = %11.5f\n",
fTheta2);
1163 printf(
" Ph1 = %11.5f\n",
fPhi1);
1164 printf(
" Ph2 = %11.5f\n",
fPhi2);
1165 printf(
" Bounding box:\n");
1184 Int_t nlat =
fNz + 1 - (nup + ndown);
1190 Int_t nbPnts = nlat * nlong + nup + ndown + ncenter;
1194 Int_t nbSegs = nlat *
fNseg + (nlat - 1 + nup + ndown) * nlong;
1198 nbSegs += 2 * nlat + nup + ndown;
1199 nbSegs += nlong * (2 - nup - ndown);
1206 nbPols += (2 - nup - ndown) *
fNseg;
1231 Int_t nlat =
fNz + 1 - (nup + ndown);
1258 for (i = 0; i < nlat; i++) {
1259 for (j = 0; j <
fNseg; j++) {
1261 buff.
fSegs[indx++] = i * nlong + j;
1262 buff.
fSegs[indx++] = i * nlong + (j + 1) % nlong;
1268 for (i = 0; i < nlat - 1; i++) {
1269 for (j = 0; j < nlong; j++) {
1271 buff.
fSegs[indx++] = i * nlong + j;
1272 buff.
fSegs[indx++] = (i + 1) * nlong + j;
1275 Int_t indup = indlong + (nlat - 1) * nlong;
1279 Int_t indpup = nlat * nlong;
1280 for (j = 0; j < nlong; j++) {
1282 buff.
fSegs[indx++] = j;
1283 buff.
fSegs[indx++] = indpup;
1286 Int_t inddown = indup + nup * nlong;
1290 Int_t indpdown = nlat * nlong + nup;
1291 for (j = 0; j < nlong; j++) {
1293 buff.
fSegs[indx++] = (nlat - 1) * nlong + j;
1294 buff.
fSegs[indx++] = indpdown;
1297 Int_t indparin = inddown + ndown * nlong;
1298 Int_t indlongin = indparin;
1299 Int_t indupin = indparin;
1300 Int_t inddownin = indparin;
1301 Int_t indphi = indparin;
1303 Int_t indptin = nlat * nlong + nup + ndown;
1304 Int_t iptcenter = indptin;
1307 indlongin = indparin + nlat *
fNseg;
1308 indupin = indlongin + (nlat - 1) * nlong;
1309 inddownin = indupin + nup * nlong;
1312 for (i = 0; i < nlat; i++) {
1313 for (j = 0; j <
fNseg; j++) {
1314 buff.
fSegs[indx++] =
c + 1;
1315 buff.
fSegs[indx++] = indptin + i * nlong + j;
1316 buff.
fSegs[indx++] = indptin + i * nlong + (j + 1) % nlong;
1321 for (i = 0; i < nlat - 1; i++) {
1322 for (j = 0; j < nlong; j++) {
1323 buff.
fSegs[indx++] =
c + 1;
1324 buff.
fSegs[indx++] = indptin + i * nlong + j;
1325 buff.
fSegs[indx++] = indptin + (i + 1) * nlong + j;
1331 Int_t indupltop = indptin + nlat * nlong;
1332 for (j = 0; j < nlong; j++) {
1333 buff.
fSegs[indx++] =
c + 1;
1334 buff.
fSegs[indx++] = indptin + j;
1335 buff.
fSegs[indx++] = indupltop;
1341 Int_t indpdown = indptin + nlat * nlong + nup;
1342 for (j = 0; j < nlong; j++) {
1343 buff.
fSegs[indx++] =
c + 1;
1344 buff.
fSegs[indx++] = indptin + (nlat - 1) * nlong + j;
1345 buff.
fSegs[indx++] = indpdown;
1348 indphi = inddownin + ndown * nlong;
1350 Int_t indtheta = indphi;
1353 indtheta += 2 * nlat + nup + ndown;
1354 for (j = 0; j < nlat; j++) {
1355 buff.
fSegs[indx++] =
c + 2;
1356 buff.
fSegs[indx++] = j * nlong;
1358 buff.
fSegs[indx++] = indptin + j * nlong;
1360 buff.
fSegs[indx++] = iptcenter;
1362 for (j = 0; j < nlat; j++) {
1363 buff.
fSegs[indx++] =
c + 2;
1364 buff.
fSegs[indx++] = (j + 1) * nlong - 1;
1366 buff.
fSegs[indx++] = indptin + (j + 1) * nlong - 1;
1368 buff.
fSegs[indx++] = iptcenter;
1371 buff.
fSegs[indx++] =
c + 2;
1372 buff.
fSegs[indx++] = nlat * nlong;
1374 buff.
fSegs[indx++] = indptin + nlat * nlong;
1376 buff.
fSegs[indx++] = iptcenter;
1379 buff.
fSegs[indx++] =
c + 2;
1380 buff.
fSegs[indx++] = nlat * nlong + nup;
1382 buff.
fSegs[indx++] = indptin + nlat * nlong + nup;
1384 buff.
fSegs[indx++] = iptcenter;
1389 for (j = 0; j < nlong; j++) {
1390 buff.
fSegs[indx++] =
c + 2;
1391 buff.
fSegs[indx++] = j;
1393 buff.
fSegs[indx++] = indptin + j;
1395 buff.
fSegs[indx++] = iptcenter;
1399 for (j = 0; j < nlong; j++) {
1400 buff.
fSegs[indx++] =
c + 2;
1401 buff.
fSegs[indx++] = (nlat - 1) * nlong + j;
1403 buff.
fSegs[indx++] = indptin + (nlat - 1) * nlong + j;
1405 buff.
fSegs[indx++] = iptcenter;
1411 for (i = 0; i < nlat - 1; i++) {
1412 for (j = 0; j <
fNseg; j++) {
1414 buff.
fPols[indx++] = 4;
1416 buff.
fPols[indx++] = indlong + i * nlong + (j + 1) % nlong;
1417 buff.
fPols[indx++] = indpar + (i + 1) *
fNseg + j;
1418 buff.
fPols[indx++] = indlong + i * nlong + j;
1423 for (j = 0; j <
fNseg; j++) {
1425 buff.
fPols[indx++] = 3;
1426 buff.
fPols[indx++] = indup + j;
1427 buff.
fPols[indx++] = indup + (j + 1) % nlong;
1428 buff.
fPols[indx++] = indpar + j;
1433 for (j = 0; j <
fNseg; j++) {
1435 buff.
fPols[indx++] = 3;
1436 buff.
fPols[indx++] = inddown + j;
1437 buff.
fPols[indx++] = indpar + (nlat - 1) *
fNseg + j;
1438 buff.
fPols[indx++] = inddown + (j + 1) % nlong;
1444 for (i = 0; i < nlat - 1; i++) {
1445 for (j = 0; j <
fNseg; j++) {
1446 buff.
fPols[indx++] =
c + 1;
1447 buff.
fPols[indx++] = 4;
1448 buff.
fPols[indx++] = indparin + i *
fNseg + j;
1449 buff.
fPols[indx++] = indlongin + i * nlong + j;
1450 buff.
fPols[indx++] = indparin + (i + 1) *
fNseg + j;
1451 buff.
fPols[indx++] = indlongin + i * nlong + (j + 1) % nlong;
1456 for (j = 0; j <
fNseg; j++) {
1457 buff.
fPols[indx++] =
c + 1;
1458 buff.
fPols[indx++] = 3;
1459 buff.
fPols[indx++] = indupin + j;
1460 buff.
fPols[indx++] = indparin + j;
1461 buff.
fPols[indx++] = indupin + (j + 1) % nlong;
1466 for (j = 0; j <
fNseg; j++) {
1467 buff.
fPols[indx++] =
c + 1;
1468 buff.
fPols[indx++] = 3;
1469 buff.
fPols[indx++] = inddownin + j;
1470 buff.
fPols[indx++] = inddownin + (j + 1) % nlong;
1471 buff.
fPols[indx++] = indparin + (nlat - 1) *
fNseg + j;
1477 for (i = 0; i < nlat - 1; i++) {
1478 buff.
fPols[indx++] =
c + 2;
1480 buff.
fPols[indx++] = 4;
1481 buff.
fPols[indx++] = indlong + i * nlong;
1482 buff.
fPols[indx++] = indphi + i + 1;
1483 buff.
fPols[indx++] = indlongin + i * nlong;
1484 buff.
fPols[indx++] = indphi + i;
1486 buff.
fPols[indx++] = 3;
1487 buff.
fPols[indx++] = indlong + i * nlong;
1488 buff.
fPols[indx++] = indphi + i + 1;
1489 buff.
fPols[indx++] = indphi + i;
1492 for (i = 0; i < nlat - 1; i++) {
1493 buff.
fPols[indx++] =
c + 2;
1495 buff.
fPols[indx++] = 4;
1496 buff.
fPols[indx++] = indlong + (i + 1) * nlong - 1;
1497 buff.
fPols[indx++] = indphi + nlat + i;
1498 buff.
fPols[indx++] = indlongin + (i + 1) * nlong - 1;
1499 buff.
fPols[indx++] = indphi + nlat + i + 1;
1501 buff.
fPols[indx++] = 3;
1502 buff.
fPols[indx++] = indlong + (i + 1) * nlong - 1;
1503 buff.
fPols[indx++] = indphi + nlat + i;
1504 buff.
fPols[indx++] = indphi + nlat + i + 1;
1508 buff.
fPols[indx++] =
c + 2;
1510 buff.
fPols[indx++] = 4;
1511 buff.
fPols[indx++] = indup;
1512 buff.
fPols[indx++] = indphi;
1513 buff.
fPols[indx++] = indupin;
1514 buff.
fPols[indx++] = indphi + 2 * nlat;
1516 buff.
fPols[indx++] = 3;
1517 buff.
fPols[indx++] = indup;
1518 buff.
fPols[indx++] = indphi;
1519 buff.
fPols[indx++] = indphi + 2 * nlat;
1521 buff.
fPols[indx++] =
c + 2;
1523 buff.
fPols[indx++] = 4;
1524 buff.
fPols[indx++] = indup + nlong - 1;
1525 buff.
fPols[indx++] = indphi + 2 * nlat;
1526 buff.
fPols[indx++] = indupin + nlong - 1;
1527 buff.
fPols[indx++] = indphi + nlat;
1529 buff.
fPols[indx++] = 3;
1530 buff.
fPols[indx++] = indup + nlong - 1;
1531 buff.
fPols[indx++] = indphi + 2 * nlat;
1532 buff.
fPols[indx++] = indphi + nlat;
1536 buff.
fPols[indx++] =
c + 2;
1538 buff.
fPols[indx++] = 4;
1539 buff.
fPols[indx++] = inddown;
1540 buff.
fPols[indx++] = indphi + 2 * nlat + nup;
1541 buff.
fPols[indx++] = inddownin;
1542 buff.
fPols[indx++] = indphi + nlat - 1;
1544 buff.
fPols[indx++] = 3;
1545 buff.
fPols[indx++] = inddown;
1546 buff.
fPols[indx++] = indphi + 2 * nlat + nup;
1547 buff.
fPols[indx++] = indphi + nlat - 1;
1549 buff.
fPols[indx++] =
c + 2;
1551 buff.
fPols[indx++] = 4;
1552 buff.
fPols[indx++] = inddown + nlong - 1;
1553 buff.
fPols[indx++] = indphi + 2 * nlat - 1;
1554 buff.
fPols[indx++] = inddownin + nlong - 1;
1555 buff.
fPols[indx++] = indphi + 2 * nlat + nup;
1557 buff.
fPols[indx++] = 3;
1558 buff.
fPols[indx++] = inddown + nlong - 1;
1559 buff.
fPols[indx++] = indphi + 2 * nlat - 1;
1560 buff.
fPols[indx++] = indphi + 2 * nlat + nup;
1566 for (j = 0; j <
fNseg; j++) {
1567 buff.
fPols[indx++] =
c + 2;
1569 buff.
fPols[indx++] = 4;
1570 buff.
fPols[indx++] = indpar + j;
1571 buff.
fPols[indx++] = indtheta + j;
1572 buff.
fPols[indx++] = indparin + j;
1573 buff.
fPols[indx++] = indtheta + (j + 1) % nlong;
1575 buff.
fPols[indx++] = 3;
1576 buff.
fPols[indx++] = indpar + j;
1577 buff.
fPols[indx++] = indtheta + j;
1578 buff.
fPols[indx++] = indtheta + (j + 1) % nlong;
1583 for (j = 0; j <
fNseg; j++) {
1584 buff.
fPols[indx++] =
c + 2;
1586 buff.
fPols[indx++] = 4;
1587 buff.
fPols[indx++] = indpar + (nlat - 1) *
fNseg + j;
1588 buff.
fPols[indx++] = indtheta + (1 - nup) * nlong + (j + 1) % nlong;
1589 buff.
fPols[indx++] = indparin + (nlat - 1) *
fNseg + j;
1590 buff.
fPols[indx++] = indtheta + (1 - nup) * nlong + j;
1592 buff.
fPols[indx++] = 3;
1593 buff.
fPols[indx++] = indpar + (nlat - 1) *
fNseg + j;
1594 buff.
fPols[indx++] = indtheta + (1 - nup) * nlong + (j + 1) % nlong;
1595 buff.
fPols[indx++] = indtheta + (1 - nup) * nlong + j;
1607 Double_t r2 = point[0] * point[0] + point[1] * point[1] + point[2] * point[2];
1636 for (
Int_t i = 0; i < 4; i++)
1651 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
1652 out <<
" rmin = " <<
fRmin <<
";" << std::endl;
1653 out <<
" rmax = " <<
fRmax <<
";" << std::endl;
1654 out <<
" theta1 = " <<
fTheta1 <<
";" << std::endl;
1655 out <<
" theta2 = " <<
fTheta2 <<
";" << std::endl;
1656 out <<
" phi1 = " <<
fPhi1 <<
";" << std::endl;
1657 out <<
" phi2 = " <<
fPhi2 <<
";" << std::endl;
1659 <<
"\",rmin,rmax,theta1, theta2,phi1,phi2);" << std::endl;
1670 Error(
"SetDimensions",
"invalid parameters rmin/rmax");
1677 if (theta1 >= theta2 || theta1 < 0 || theta1 > 180 || theta2 > 180) {
1678 Error(
"SetDimensions",
"invalid parameters theta1/theta2");
1683 if ((theta2 - theta1) < 180.)
1747 Error(
"SetPoints",
"Input array is NULL");
1759 Int_t nlat =
fNz + 1 - (nup + ndown);
1774 Double_t z, zi, theta, phi, cphi, sphi;
1781 for (i = 0; i < nlat; i++) {
1782 theta = theta1 + (nup + i) * dtheta;
1786 for (j = 0; j < nlong; j++) {
1787 phi = phi1 + j * dphi;
1790 points[indx++] = zi * cphi;
1791 points[indx++] = zi * sphi;
1812 for (i = 0; i < nlat; i++) {
1813 theta = theta1 + (nup + i) * dtheta;
1817 for (j = 0; j < nlong; j++) {
1818 phi = phi1 + j * dphi;
1821 points[indx++] = zi * cphi;
1822 points[indx++] = zi * sphi;
1855 Error(
"SetPoints",
"Input array is NULL");
1867 Int_t nlat =
fNz + 1 - (nup + ndown);
1882 Double_t z, zi, theta, phi, cphi, sphi;
1889 for (i = 0; i < nlat; i++) {
1890 theta = theta1 + (nup + i) * dtheta;
1894 for (j = 0; j < nlong; j++) {
1895 phi = phi1 + j * dphi;
1898 points[indx++] = zi * cphi;
1899 points[indx++] = zi * sphi;
1920 for (i = 0; i < nlat; i++) {
1921 theta = theta1 + (nup + i) * dtheta;
1925 for (j = 0; j < nlong; j++) {
1926 phi = phi1 + j * dphi;
1929 points[indx++] = zi * cphi;
1930 points[indx++] = zi * sphi;
1973 Int_t nlat =
fNz + 1 - (nup + ndown);
1979 nvert = nlat * nlong + nup + ndown + ncenter;
1983 nsegs = nlat *
fNseg + (nlat - 1 + nup + ndown) * nlong;
1987 nsegs += 2 * nlat + nup + ndown;
1988 nsegs += nlong * (2 - nup - ndown);
1995 npols += (2 - nup - ndown) *
fNseg;
2012 Int_t nlat =
fNz + 1 - (nup + ndown);
2020 Int_t numPoints = 0;
2022 numPoints = 2 * (nlat * nlong + nup + ndown);
2024 numPoints = nlat * nlong + nup + ndown + ncenter;
2065 Int_t nlat =
fNz + 1 - (nup + ndown);
2071 Int_t nbPnts = nlat * nlong + nup + ndown + ncenter;
2075 Int_t nbSegs = nlat *
fNseg + (nlat - 1 + nup + ndown) * nlong;
2079 nbSegs += 2 * nlat + nup + ndown;
2080 nbSegs += nlong * (2 - nup - ndown);
2087 nbPols += (2 - nup - ndown) *
fNseg;
2089 if (buffer.
SetRawSizes(nbPnts, 3 * nbPnts, nbSegs, 3 * nbSegs, nbPols, 6 * nbPols)) {
2112 for (
Int_t i = 0; i < vecsize; i++)
2123 for (
Int_t i = 0; i < vecsize; i++)
2133 for (
Int_t i = 0; i < vecsize; i++)
2143 for (
Int_t i = 0; i < vecsize; i++)
2154 for (
Int_t i = 0; i < vecsize; i++)
int Int_t
Signed integer 4 bytes (int)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
const char Option_t
Option string (const char)
winID h TVirtualViewer3D TVirtualGLPainter p
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
Sphere description class - see TBuffer3DTypes for producer classes Supports hollow and cut spheres.
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.
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...
void SetBoxDimensions(Double_t dx, Double_t dy, Double_t dz, Double_t *origin=nullptr)
Set parameters of the box.
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.
static void DistToCone(const Double_t *point, const Double_t *dir, Double_t dz, Double_t r1, Double_t r2, Double_t &b, Double_t &delta)
Static method to compute distance to a conical surface with :
TGeoVolumeMulti * MakeVolumeMulti(const char *name, TGeoMedium *medium)
Make a TGeoVolumeMulti handling a list of volumes.
Int_t GetNsegments() const
Get number of segments approximating circles.
Node containing an offset.
base finder class for patterns. A pattern is specifying a division type
void SetDivIndex(Int_t index)
a spherical phi divison pattern
a spherical R divison pattern
a spherical theta divison pattern
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 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 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.
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.
const char * GetName() const override
Get the shape name.
static Double_t Tolerance()
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,...
Bool_t TestShapeBit(UInt_t f) const
TGeoSphere are not just balls having internal and external radii, but sectors of a sphere having defi...
Double_t DistToSphere(const Double_t *point, const Double_t *dir, Double_t rsph, Bool_t check=kTRUE, Bool_t firstcross=kTRUE) const
compute distance to sphere of radius rsph. Direction has to be a unit vector
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
Divide this box shape belonging to volume "voldiv" into ndiv equal volumes called divname,...
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...
void SetPoints(Double_t *points) const override
create sphere mesh points
Bool_t Contains(const Double_t *point) const override
test if point is inside this sphere check Rmin<=R<=Rmax
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.
void SetSphDimensions(Double_t rmin, Double_t rmax, Double_t theta1, Double_t theta2, Double_t phi1, Double_t phi2)
Set spherical segment dimensions.
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
Returns numbers of vertices, segments and polygons composing the shape mesh.
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 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...
TGeoSphere()
Default constructor.
void SetDimensions(Double_t *param) override
Set dimensions of the spherical segment starting from a list of parameters.
TBuffer3D * MakeBuffer3D() const override
Creates a TBuffer3D describing this shape.
void InspectShape() const override
print shape parameters
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
Compute normal to closest surface from POINT.
void SetSegsAndPols(TBuffer3D &buff) const override
Fill TBuffer3D structure for segments and polygons.
Bool_t IsPointInside(const Double_t *point, Bool_t checkR=kTRUE, Bool_t checkTh=kTRUE, Bool_t checkPh=kTRUE) const
Check if a point is inside radius/theta/phi ranges for the spherical sector.
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 ComputeBBox() override
compute bounding box of the sphere
Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) const override
Get range of shape for a given axis.
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 sphere Check if the bounding box is crossed wit...
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Fills a static 3D buffer and returns a reference.
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].
virtual void SetNumberOfDivisions(Int_t p)
Set the number of divisions of mesh circles keeping aspect ratio.
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...
void GetBoundingCylinder(Double_t *param) const override
Fill vector param[4] with the bounding cylinder parameters.
Int_t GetNmeshVertices() const override
Return number of vertices of the mesh representation.
~TGeoSphere() 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 sphere
Int_t IsOnBoundary(const Double_t *point) const
Check if a point in local sphere coordinates is close to a boundary within shape tolerance.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
Int_t DistancetoPrimitive(Int_t px, Int_t py) override
compute closest distance from point px,py to each corner
void Sizeof3D() const override
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
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual const char * ClassName() const
Returns name of class to which the object belongs.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
const char * Data() const
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
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.
constexpr Double_t RadToDeg()
Conversion from radian to degree: .
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.