155 Double_t r1min, r1max, r2min, r2max, rmin, rmax;
222 fOrigin[2] = (zmax + zmin) / 2;
226 fDZ = (zmax - zmin) / 2;
234 Double_t rxy2 = point[0] * point[0] + point[1] * point[1];
235 Double_t r2 = rxy2 + point[2] * point[2];
285 if (norm[0] * dir[0] + norm[1] * dir[1] + norm[2] * dir[2] < 0) {
305 Double_t r2 = point[0] * point[0] + point[1] * point[1] + point[2] * point[2];
324 if (r2 * ddp * ddp < tol * tol)
327 if (r2 * ddp * ddp < tol * tol)
355 Double_t r2 = point[0] * point[0] + point[1] * point[1] + point[2] * point[2];
389 Double_t r2 = point[0] * point[0] + point[1] * point[1] + point[2] * point[2];
427 const Int_t numPoints = 2 *
n * nz;
442 Double_t r1, r2, z1, z2, dz, si, ci;
443 Double_t rxy2 = point[0] * point[0] + point[1] * point[1];
445 r2 = rxy2 + point[2] * point[2];
462 if (iact < 3 && safe) {
489 if (iact == 1 && step < *safe)
495 Double_t rdotn = point[0] * dir[0] + point[1] * dir[1] + point[2] * dir[2];
511 if (inrmax && inrmin) {
549 Double_t b, delta, xnew, ynew, znew, phi0, ddp;
557 if (point[2] * dir[2] < 0) {
558 snxt = -point[2] / dir[2];
559 ptnew[0] = point[0] + snxt * dir[0];
560 ptnew[1] = point[1] + snxt * dir[1];
580 dz = 0.5 * (z2 - z1);
583 ptnew[2] = point[2] - 0.5 * (z1 + z2);
585 Double_t rin = 0.5 * (r1 + r2 + (r2 - r1) * ptnew[2] * zinv);
596 ptnew[0] * dir[0] + ptnew[1] * dir[1] + 0.5 * (r1 - r2) * dir[2] * zinv *
TMath::Sqrt(rxy2);
597 if (sigz * ddotn >= 0 || -
b + delta < 1.E-9)
602 znew = ptnew[2] + snxt * dir[2];
607 xnew = ptnew[0] + snxt * dir[0];
608 ynew = ptnew[1] + snxt * dir[1];
618 if (!skip && st1 > 1E10) {
620 znew = ptnew[2] + snxt * dir[2];
625 xnew = ptnew[0] + snxt * dir[0];
626 ynew = ptnew[1] + snxt * dir[1];
643 if (point[2] * dir[2] < 0) {
644 snxt = -point[2] / dir[2];
645 ptnew[0] = point[0] + snxt * dir[0];
646 ptnew[1] = point[1] + snxt * dir[1];
666 dz = 0.5 * (z2 - z1);
669 ptnew[2] = point[2] - 0.5 * (z1 + z2);
671 Double_t rin = 0.5 * (r1 + r2 + (r2 - r1) * ptnew[2] * zinv);
682 ptnew[0] * dir[0] + ptnew[1] * dir[1] + 0.5 * (r1 - r2) * dir[2] * zinv *
TMath::Sqrt(rxy2);
683 if (sigz * ddotn <= 0 || -
b + delta < 1.E-9)
688 znew = ptnew[2] + snxt * dir[2];
693 xnew = ptnew[0] + snxt * dir[0];
694 ynew = ptnew[1] + snxt * dir[1];
704 if (!skip && st2 > 1E10) {
706 znew = ptnew[2] + snxt * dir[2];
711 xnew = ptnew[0] + snxt * dir[0];
712 ynew = ptnew[1] + snxt * dir[1];
739 safety = point[0] *
s1 - point[1] *
c1;
741 un = dir[0] *
s1 - dir[1] *
c1;
744 ptnew[0] = point[0] + s * dir[0];
745 ptnew[1] = point[1] + s * dir[1];
746 ptnew[2] = point[2] + s * dir[2];
747 if ((ptnew[1] * cm - ptnew[0] * sm) <= 0) {
754 safety = -point[0] * s2 + point[1] *
c2;
756 un = -dir[0] * s2 + dir[1] *
c2;
759 ptnew[0] = point[0] + s * dir[0];
760 ptnew[1] = point[1] + s * dir[1];
761 ptnew[2] = point[2] + s * dir[2];
762 if ((ptnew[1] * cm - ptnew[0] * sm) >= 0) {
780 Double_t rxy2 = point[0] * point[0] + point[1] * point[1];
782 Double_t rad2 = rxy2 + point[2] * point[2];
800 if (iact < 3 && safe) {
827 if (iact == 1 && step < *safe)
836 Double_t b, delta, xnew, ynew, znew, phi0, ddp;
837 Double_t rdotn = point[0] * dir[0] + point[1] * dir[1] + point[2] * dir[2];
862 if (point[2] * dir[2] < 0)
863 sn1 = -point[2] / dir[2];
866 Double_t r1, r2, z1, z2, dz, ptnew[3];
880 dz = 0.5 * (z2 - z1);
883 ptnew[2] = point[2] - 0.5 * (z1 + z2);
885 Double_t rin = 0.5 * (r1 + r2 + (r2 - r1) * ptnew[2] * zinv);
890 ptnew[0] * dir[0] + ptnew[1] * dir[1] + 0.5 * (r1 - r2) * dir[2] * zinv *
TMath::Sqrt(rxy2);
891 if (sigz * ddotn <= 0)
897 znew = ptnew[2] + snxt * dir[2];
902 xnew = ptnew[0] + snxt * dir[0];
903 ynew = ptnew[1] + snxt * dir[1];
914 znew = ptnew[2] + snxt * dir[2];
919 xnew = ptnew[0] + snxt * dir[0];
920 ynew = ptnew[1] + snxt * dir[1];
936 if (point[2] * dir[2] < 0)
937 sn1 = -point[2] / dir[2];
940 Double_t r1, r2, z1, z2, dz, ptnew[3];
954 dz = 0.5 * (z2 - z1);
957 ptnew[2] = point[2] - 0.5 * (z1 + z2);
959 Double_t rin = 0.5 * (r1 + r2 + (r2 - r1) * ptnew[2] * zinv);
964 ptnew[0] * dir[0] + ptnew[1] * dir[1] + 0.5 * (r1 - r2) * dir[2] * zinv *
TMath::Sqrt(rxy2);
965 if (sigz * ddotn >= 0)
971 znew = ptnew[2] + snxt * dir[2];
976 xnew = ptnew[0] + snxt * dir[0];
977 ynew = ptnew[1] + snxt * dir[1];
988 znew = ptnew[2] + snxt * dir[2];
993 xnew = ptnew[0] + snxt * dir[0];
994 ynew = ptnew[1] + snxt * dir[1];
1034 Double_t r2 = point[0] * point[0] + point[1] * point[1] + point[2] * point[2];
1035 Double_t b = point[0] * dir[0] + point[1] * dir[1] + point[2] * dir[2];
1050 s = (firstcross) ? (-
b -
d) : (-
b +
d);
1056 for (i = 0; i < 3; i++)
1057 pt[i] = point[i] + s * dir[i];
1075 Double_t end = start + ndiv * step;
1082 for (
id = 0;
id < ndiv;
id++) {
1100 for (
id = 0;
id < ndiv;
id++) {
1110 for (
id = 0;
id < ndiv;
id++) {
1119 default:
Error(
"Divide",
"In shape %s wrong axis type for division",
GetName());
return nullptr;
1130 case 2:
return "PHI";
1131 case 3:
return "THETA";
1132 default:
return "UNDEFINED";
1177 param[0] =
fRmin * smin;
1178 param[0] *= param[0];
1181 param[1] =
fRmax * smax;
1182 param[1] *= param[1];
1189 while (param[3] < param[2])
1198 printf(
"*** Shape %s: TGeoSphere ***\n",
GetName());
1199 printf(
" Rmin = %11.5f\n",
fRmin);
1200 printf(
" Rmax = %11.5f\n",
fRmax);
1201 printf(
" Th1 = %11.5f\n",
fTheta1);
1202 printf(
" Th2 = %11.5f\n",
fTheta2);
1203 printf(
" Ph1 = %11.5f\n",
fPhi1);
1204 printf(
" Ph2 = %11.5f\n",
fPhi2);
1205 printf(
" Bounding box:\n");
1224 Int_t nlat =
fNz + 1 - (nup + ndown);
1230 Int_t nbPnts = nlat * nlong + nup + ndown + ncenter;
1234 Int_t nbSegs = nlat *
fNseg + (nlat - 1 + nup + ndown) * nlong;
1238 nbSegs += 2 * nlat + nup + ndown;
1239 nbSegs += nlong * (2 - nup - ndown);
1246 nbPols += (2 - nup - ndown) *
fNseg;
1271 Int_t nlat =
fNz + 1 - (nup + ndown);
1298 for (i = 0; i < nlat; i++) {
1299 for (j = 0; j <
fNseg; j++) {
1301 buff.
fSegs[indx++] = i * nlong + j;
1302 buff.
fSegs[indx++] = i * nlong + (j + 1) % nlong;
1308 for (i = 0; i < nlat - 1; i++) {
1309 for (j = 0; j < nlong; j++) {
1311 buff.
fSegs[indx++] = i * nlong + j;
1312 buff.
fSegs[indx++] = (i + 1) * nlong + j;
1315 Int_t indup = indlong + (nlat - 1) * nlong;
1319 Int_t indpup = nlat * nlong;
1320 for (j = 0; j < nlong; j++) {
1322 buff.
fSegs[indx++] = j;
1323 buff.
fSegs[indx++] = indpup;
1326 Int_t inddown = indup + nup * nlong;
1330 Int_t indpdown = nlat * nlong + nup;
1331 for (j = 0; j < nlong; j++) {
1333 buff.
fSegs[indx++] = (nlat - 1) * nlong + j;
1334 buff.
fSegs[indx++] = indpdown;
1337 Int_t indparin = inddown + ndown * nlong;
1338 Int_t indlongin = indparin;
1339 Int_t indupin = indparin;
1340 Int_t inddownin = indparin;
1341 Int_t indphi = indparin;
1343 Int_t indptin = nlat * nlong + nup + ndown;
1344 Int_t iptcenter = indptin;
1347 indlongin = indparin + nlat *
fNseg;
1348 indupin = indlongin + (nlat - 1) * nlong;
1349 inddownin = indupin + nup * nlong;
1352 for (i = 0; i < nlat; i++) {
1353 for (j = 0; j <
fNseg; j++) {
1354 buff.
fSegs[indx++] =
c + 1;
1355 buff.
fSegs[indx++] = indptin + i * nlong + j;
1356 buff.
fSegs[indx++] = indptin + i * nlong + (j + 1) % nlong;
1361 for (i = 0; i < nlat - 1; i++) {
1362 for (j = 0; j < nlong; j++) {
1363 buff.
fSegs[indx++] =
c + 1;
1364 buff.
fSegs[indx++] = indptin + i * nlong + j;
1365 buff.
fSegs[indx++] = indptin + (i + 1) * nlong + j;
1371 Int_t indupltop = indptin + nlat * nlong;
1372 for (j = 0; j < nlong; j++) {
1373 buff.
fSegs[indx++] =
c + 1;
1374 buff.
fSegs[indx++] = indptin + j;
1375 buff.
fSegs[indx++] = indupltop;
1381 Int_t indpdown = indptin + nlat * nlong + nup;
1382 for (j = 0; j < nlong; j++) {
1383 buff.
fSegs[indx++] =
c + 1;
1384 buff.
fSegs[indx++] = indptin + (nlat - 1) * nlong + j;
1385 buff.
fSegs[indx++] = indpdown;
1388 indphi = inddownin + ndown * nlong;
1390 Int_t indtheta = indphi;
1393 indtheta += 2 * nlat + nup + ndown;
1394 for (j = 0; j < nlat; j++) {
1395 buff.
fSegs[indx++] =
c + 2;
1396 buff.
fSegs[indx++] = j * nlong;
1398 buff.
fSegs[indx++] = indptin + j * nlong;
1400 buff.
fSegs[indx++] = iptcenter;
1402 for (j = 0; j < nlat; j++) {
1403 buff.
fSegs[indx++] =
c + 2;
1404 buff.
fSegs[indx++] = (j + 1) * nlong - 1;
1406 buff.
fSegs[indx++] = indptin + (j + 1) * nlong - 1;
1408 buff.
fSegs[indx++] = iptcenter;
1411 buff.
fSegs[indx++] =
c + 2;
1412 buff.
fSegs[indx++] = nlat * nlong;
1414 buff.
fSegs[indx++] = indptin + nlat * nlong;
1416 buff.
fSegs[indx++] = iptcenter;
1419 buff.
fSegs[indx++] =
c + 2;
1420 buff.
fSegs[indx++] = nlat * nlong + nup;
1422 buff.
fSegs[indx++] = indptin + nlat * nlong + nup;
1424 buff.
fSegs[indx++] = iptcenter;
1429 for (j = 0; j < nlong; j++) {
1430 buff.
fSegs[indx++] =
c + 2;
1431 buff.
fSegs[indx++] = j;
1433 buff.
fSegs[indx++] = indptin + j;
1435 buff.
fSegs[indx++] = iptcenter;
1439 for (j = 0; j < nlong; j++) {
1440 buff.
fSegs[indx++] =
c + 2;
1441 buff.
fSegs[indx++] = (nlat - 1) * nlong + j;
1443 buff.
fSegs[indx++] = indptin + (nlat - 1) * nlong + j;
1445 buff.
fSegs[indx++] = iptcenter;
1451 for (i = 0; i < nlat - 1; i++) {
1452 for (j = 0; j <
fNseg; j++) {
1454 buff.
fPols[indx++] = 4;
1456 buff.
fPols[indx++] = indlong + i * nlong + (j + 1) % nlong;
1457 buff.
fPols[indx++] = indpar + (i + 1) *
fNseg + j;
1458 buff.
fPols[indx++] = indlong + i * nlong + j;
1463 for (j = 0; j <
fNseg; j++) {
1465 buff.
fPols[indx++] = 3;
1466 buff.
fPols[indx++] = indup + j;
1467 buff.
fPols[indx++] = indup + (j + 1) % nlong;
1468 buff.
fPols[indx++] = indpar + j;
1473 for (j = 0; j <
fNseg; j++) {
1475 buff.
fPols[indx++] = 3;
1476 buff.
fPols[indx++] = inddown + j;
1477 buff.
fPols[indx++] = indpar + (nlat - 1) *
fNseg + j;
1478 buff.
fPols[indx++] = inddown + (j + 1) % nlong;
1484 for (i = 0; i < nlat - 1; i++) {
1485 for (j = 0; j <
fNseg; j++) {
1486 buff.
fPols[indx++] =
c + 1;
1487 buff.
fPols[indx++] = 4;
1488 buff.
fPols[indx++] = indparin + i *
fNseg + j;
1489 buff.
fPols[indx++] = indlongin + i * nlong + j;
1490 buff.
fPols[indx++] = indparin + (i + 1) *
fNseg + j;
1491 buff.
fPols[indx++] = indlongin + i * nlong + (j + 1) % nlong;
1496 for (j = 0; j <
fNseg; j++) {
1497 buff.
fPols[indx++] =
c + 1;
1498 buff.
fPols[indx++] = 3;
1499 buff.
fPols[indx++] = indupin + j;
1500 buff.
fPols[indx++] = indparin + j;
1501 buff.
fPols[indx++] = indupin + (j + 1) % nlong;
1506 for (j = 0; j <
fNseg; j++) {
1507 buff.
fPols[indx++] =
c + 1;
1508 buff.
fPols[indx++] = 3;
1509 buff.
fPols[indx++] = inddownin + j;
1510 buff.
fPols[indx++] = inddownin + (j + 1) % nlong;
1511 buff.
fPols[indx++] = indparin + (nlat - 1) *
fNseg + j;
1517 for (i = 0; i < nlat - 1; i++) {
1518 buff.
fPols[indx++] =
c + 2;
1520 buff.
fPols[indx++] = 4;
1521 buff.
fPols[indx++] = indlong + i * nlong;
1522 buff.
fPols[indx++] = indphi + i + 1;
1523 buff.
fPols[indx++] = indlongin + i * nlong;
1524 buff.
fPols[indx++] = indphi + i;
1526 buff.
fPols[indx++] = 3;
1527 buff.
fPols[indx++] = indlong + i * nlong;
1528 buff.
fPols[indx++] = indphi + i + 1;
1529 buff.
fPols[indx++] = indphi + i;
1532 for (i = 0; i < nlat - 1; i++) {
1533 buff.
fPols[indx++] =
c + 2;
1535 buff.
fPols[indx++] = 4;
1536 buff.
fPols[indx++] = indlong + (i + 1) * nlong - 1;
1537 buff.
fPols[indx++] = indphi + nlat + i;
1538 buff.
fPols[indx++] = indlongin + (i + 1) * nlong - 1;
1539 buff.
fPols[indx++] = indphi + nlat + i + 1;
1541 buff.
fPols[indx++] = 3;
1542 buff.
fPols[indx++] = indlong + (i + 1) * nlong - 1;
1543 buff.
fPols[indx++] = indphi + nlat + i;
1544 buff.
fPols[indx++] = indphi + nlat + i + 1;
1548 buff.
fPols[indx++] =
c + 2;
1550 buff.
fPols[indx++] = 4;
1551 buff.
fPols[indx++] = indup;
1552 buff.
fPols[indx++] = indphi;
1553 buff.
fPols[indx++] = indupin;
1554 buff.
fPols[indx++] = indphi + 2 * nlat;
1556 buff.
fPols[indx++] = 3;
1557 buff.
fPols[indx++] = indup;
1558 buff.
fPols[indx++] = indphi;
1559 buff.
fPols[indx++] = indphi + 2 * nlat;
1561 buff.
fPols[indx++] =
c + 2;
1563 buff.
fPols[indx++] = 4;
1564 buff.
fPols[indx++] = indup + nlong - 1;
1565 buff.
fPols[indx++] = indphi + 2 * nlat;
1566 buff.
fPols[indx++] = indupin + nlong - 1;
1567 buff.
fPols[indx++] = indphi + nlat;
1569 buff.
fPols[indx++] = 3;
1570 buff.
fPols[indx++] = indup + nlong - 1;
1571 buff.
fPols[indx++] = indphi + 2 * nlat;
1572 buff.
fPols[indx++] = indphi + nlat;
1576 buff.
fPols[indx++] =
c + 2;
1578 buff.
fPols[indx++] = 4;
1579 buff.
fPols[indx++] = inddown;
1580 buff.
fPols[indx++] = indphi + 2 * nlat + nup;
1581 buff.
fPols[indx++] = inddownin;
1582 buff.
fPols[indx++] = indphi + nlat - 1;
1584 buff.
fPols[indx++] = 3;
1585 buff.
fPols[indx++] = inddown;
1586 buff.
fPols[indx++] = indphi + 2 * nlat + nup;
1587 buff.
fPols[indx++] = indphi + nlat - 1;
1589 buff.
fPols[indx++] =
c + 2;
1591 buff.
fPols[indx++] = 4;
1592 buff.
fPols[indx++] = inddown + nlong - 1;
1593 buff.
fPols[indx++] = indphi + 2 * nlat - 1;
1594 buff.
fPols[indx++] = inddownin + nlong - 1;
1595 buff.
fPols[indx++] = indphi + 2 * nlat + nup;
1597 buff.
fPols[indx++] = 3;
1598 buff.
fPols[indx++] = inddown + nlong - 1;
1599 buff.
fPols[indx++] = indphi + 2 * nlat - 1;
1600 buff.
fPols[indx++] = indphi + 2 * nlat + nup;
1606 for (j = 0; j <
fNseg; j++) {
1607 buff.
fPols[indx++] =
c + 2;
1609 buff.
fPols[indx++] = 4;
1610 buff.
fPols[indx++] = indpar + j;
1611 buff.
fPols[indx++] = indtheta + j;
1612 buff.
fPols[indx++] = indparin + j;
1613 buff.
fPols[indx++] = indtheta + (j + 1) % nlong;
1615 buff.
fPols[indx++] = 3;
1616 buff.
fPols[indx++] = indpar + j;
1617 buff.
fPols[indx++] = indtheta + j;
1618 buff.
fPols[indx++] = indtheta + (j + 1) % nlong;
1623 for (j = 0; j <
fNseg; j++) {
1624 buff.
fPols[indx++] =
c + 2;
1626 buff.
fPols[indx++] = 4;
1627 buff.
fPols[indx++] = indpar + (nlat - 1) *
fNseg + j;
1628 buff.
fPols[indx++] = indtheta + (1 - nup) * nlong + (j + 1) % nlong;
1629 buff.
fPols[indx++] = indparin + (nlat - 1) *
fNseg + j;
1630 buff.
fPols[indx++] = indtheta + (1 - nup) * nlong + j;
1632 buff.
fPols[indx++] = 3;
1633 buff.
fPols[indx++] = indpar + (nlat - 1) *
fNseg + j;
1634 buff.
fPols[indx++] = indtheta + (1 - nup) * nlong + (j + 1) % nlong;
1635 buff.
fPols[indx++] = indtheta + (1 - nup) * nlong + j;
1647 Double_t r2 = point[0] * point[0] + point[1] * point[1] + point[2] * point[2];
1676 for (
Int_t i = 0; i < 4; i++)
1691 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
1692 out <<
" rmin = " <<
fRmin <<
";" << std::endl;
1693 out <<
" rmax = " <<
fRmax <<
";" << std::endl;
1694 out <<
" theta1 = " <<
fTheta1 <<
";" << std::endl;
1695 out <<
" theta2 = " <<
fTheta2 <<
";" << std::endl;
1696 out <<
" phi1 = " <<
fPhi1 <<
";" << std::endl;
1697 out <<
" phi2 = " <<
fPhi2 <<
";" << std::endl;
1699 <<
"\",rmin,rmax,theta1, theta2,phi1,phi2);" << std::endl;
1710 Error(
"SetDimensions",
"invalid parameters rmin/rmax");
1717 if (theta1 >= theta2 || theta1 < 0 || theta1 > 180 || theta2 > 180) {
1718 Error(
"SetDimensions",
"invalid parameters theta1/theta2");
1723 if ((theta2 - theta1) < 180.)
1787 Error(
"SetPoints",
"Input array is NULL");
1799 Int_t nlat =
fNz + 1 - (nup + ndown);
1814 Double_t z, zi, theta, phi, cphi, sphi;
1821 for (i = 0; i < nlat; i++) {
1822 theta = theta1 + (nup + i) * dtheta;
1826 for (j = 0; j < nlong; j++) {
1827 phi = phi1 + j * dphi;
1830 points[indx++] = zi * cphi;
1831 points[indx++] = zi * sphi;
1852 for (i = 0; i < nlat; i++) {
1853 theta = theta1 + (nup + i) * dtheta;
1857 for (j = 0; j < nlong; j++) {
1858 phi = phi1 + j * dphi;
1861 points[indx++] = zi * cphi;
1862 points[indx++] = zi * sphi;
1895 Error(
"SetPoints",
"Input array is NULL");
1907 Int_t nlat =
fNz + 1 - (nup + ndown);
1922 Double_t z, zi, theta, phi, cphi, sphi;
1929 for (i = 0; i < nlat; i++) {
1930 theta = theta1 + (nup + i) * dtheta;
1934 for (j = 0; j < nlong; j++) {
1935 phi = phi1 + j * dphi;
1938 points[indx++] = zi * cphi;
1939 points[indx++] = zi * sphi;
1960 for (i = 0; i < nlat; i++) {
1961 theta = theta1 + (nup + i) * dtheta;
1965 for (j = 0; j < nlong; j++) {
1966 phi = phi1 + j * dphi;
1969 points[indx++] = zi * cphi;
1970 points[indx++] = zi * sphi;
2013 Int_t nlat =
fNz + 1 - (nup + ndown);
2019 nvert = nlat * nlong + nup + ndown + ncenter;
2023 nsegs = nlat *
fNseg + (nlat - 1 + nup + ndown) * nlong;
2027 nsegs += 2 * nlat + nup + ndown;
2028 nsegs += nlong * (2 - nup - ndown);
2035 npols += (2 - nup - ndown) *
fNseg;
2052 Int_t nlat =
fNz + 1 - (nup + ndown);
2060 Int_t numPoints = 0;
2062 numPoints = 2 * (nlat * nlong + nup + ndown);
2064 numPoints = nlat * nlong + nup + ndown + ncenter;
2105 Int_t nlat =
fNz + 1 - (nup + ndown);
2111 Int_t nbPnts = nlat * nlong + nup + ndown + ncenter;
2115 Int_t nbSegs = nlat *
fNseg + (nlat - 1 + nup + ndown) * nlong;
2119 nbSegs += 2 * nlat + nup + ndown;
2120 nbSegs += nlong * (2 - nup - ndown);
2127 nbPols += (2 - nup - ndown) *
fNseg;
2129 if (buffer.
SetRawSizes(nbPnts, 3 * nbPnts, nbSegs, 3 * nbSegs, nbPols, 6 * nbPols)) {
2152 for (
Int_t i = 0; i < vecsize; i++)
2163 for (
Int_t i = 0; i < vecsize; i++)
2173 for (
Int_t i = 0; i < vecsize; i++)
2183 for (
Int_t i = 0; i < vecsize; i++)
2194 for (
Int_t i = 0; i < vecsize; i++)
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.
void SetDivIndex(Int_t index)
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
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) override
Compute normal to closest surface from POINT.
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 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.