86 SetSphDimensions(rmin, rmax, theta1, theta2, phi1, phi2);
88 SetNumberOfDivisions(20);
99 SetSphDimensions(rmin, rmax, theta1, theta2, phi1, phi2);
101 SetNumberOfDivisions(20);
116 SetDimensions(param, nparam);
118 SetNumberOfDivisions(20);
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;
441 Double_t r1, r2, z1, z2, dz, si, ci;
442 Double_t rxy2 = point[0] * point[0] + point[1] * point[1];
444 r2 = rxy2 + point[2] * point[2];
461 if (iact < 3 && safe) {
488 if (iact == 1 && step < *safe)
494 Double_t rdotn = point[0] * dir[0] + point[1] * dir[1] + point[2] * dir[2];
510 if (inrmax && inrmin) {
548 Double_t b, delta, xnew, ynew, znew, phi0, ddp;
556 if (point[2] * dir[2] < 0) {
557 snxt = -point[2] / dir[2];
558 ptnew[0] = point[0] + snxt * dir[0];
559 ptnew[1] = point[1] + snxt * dir[1];
579 dz = 0.5 * (z2 - z1);
582 ptnew[2] = point[2] - 0.5 * (z1 + z2);
584 Double_t rin = 0.5 * (r1 + r2 + (r2 - r1) * ptnew[2] * zinv);
595 ptnew[0] * dir[0] + ptnew[1] * dir[1] + 0.5 * (r1 - r2) * dir[2] * zinv *
TMath::Sqrt(rxy2);
596 if (sigz * ddotn >= 0 || -
b + delta < 1.E-9)
601 znew = ptnew[2] + snxt * dir[2];
606 xnew = ptnew[0] + snxt * dir[0];
607 ynew = ptnew[1] + snxt * dir[1];
617 if (!skip && st1 > 1E10) {
619 znew = ptnew[2] + snxt * dir[2];
624 xnew = ptnew[0] + snxt * dir[0];
625 ynew = ptnew[1] + snxt * dir[1];
642 if (point[2] * dir[2] < 0) {
643 snxt = -point[2] / dir[2];
644 ptnew[0] = point[0] + snxt * dir[0];
645 ptnew[1] = point[1] + snxt * dir[1];
665 dz = 0.5 * (z2 - z1);
668 ptnew[2] = point[2] - 0.5 * (z1 + z2);
670 Double_t rin = 0.5 * (r1 + r2 + (r2 - r1) * ptnew[2] * zinv);
681 ptnew[0] * dir[0] + ptnew[1] * dir[1] + 0.5 * (r1 - r2) * dir[2] * zinv *
TMath::Sqrt(rxy2);
682 if (sigz * ddotn <= 0 || -
b + delta < 1.E-9)
687 znew = ptnew[2] + snxt * dir[2];
692 xnew = ptnew[0] + snxt * dir[0];
693 ynew = ptnew[1] + snxt * dir[1];
703 if (!skip && st2 > 1E10) {
705 znew = ptnew[2] + snxt * dir[2];
710 xnew = ptnew[0] + snxt * dir[0];
711 ynew = ptnew[1] + snxt * dir[1];
738 safety = point[0] *
s1 - point[1] *
c1;
740 un = dir[0] *
s1 - dir[1] *
c1;
743 ptnew[0] = point[0] + s * dir[0];
744 ptnew[1] = point[1] + s * dir[1];
745 ptnew[2] = point[2] + s * dir[2];
746 if ((ptnew[1] * cm - ptnew[0] * sm) <= 0) {
753 safety = -point[0] * s2 + point[1] *
c2;
755 un = -dir[0] * s2 + dir[1] *
c2;
758 ptnew[0] = point[0] + s * dir[0];
759 ptnew[1] = point[1] + s * dir[1];
760 ptnew[2] = point[2] + s * dir[2];
761 if ((ptnew[1] * cm - ptnew[0] * sm) >= 0) {
779 Double_t rxy2 = point[0] * point[0] + point[1] * point[1];
781 Double_t rad2 = rxy2 + point[2] * point[2];
799 if (iact < 3 && safe) {
826 if (iact == 1 && step < *safe)
835 Double_t b, delta, xnew, ynew, znew, phi0, ddp;
836 Double_t rdotn = point[0] * dir[0] + point[1] * dir[1] + point[2] * dir[2];
861 if (point[2] * dir[2] < 0)
862 sn1 = -point[2] / dir[2];
865 Double_t r1, r2, z1, z2, dz, ptnew[3];
879 dz = 0.5 * (z2 - z1);
882 ptnew[2] = point[2] - 0.5 * (z1 + z2);
884 Double_t rin = 0.5 * (r1 + r2 + (r2 - r1) * ptnew[2] * zinv);
889 ptnew[0] * dir[0] + ptnew[1] * dir[1] + 0.5 * (r1 - r2) * dir[2] * zinv *
TMath::Sqrt(rxy2);
890 if (sigz * ddotn <= 0)
896 znew = ptnew[2] + snxt * dir[2];
901 xnew = ptnew[0] + snxt * dir[0];
902 ynew = ptnew[1] + snxt * dir[1];
913 znew = ptnew[2] + snxt * dir[2];
918 xnew = ptnew[0] + snxt * dir[0];
919 ynew = ptnew[1] + snxt * dir[1];
935 if (point[2] * dir[2] < 0)
936 sn1 = -point[2] / dir[2];
939 Double_t r1, r2, z1, z2, dz, ptnew[3];
953 dz = 0.5 * (z2 - z1);
956 ptnew[2] = point[2] - 0.5 * (z1 + z2);
958 Double_t rin = 0.5 * (r1 + r2 + (r2 - r1) * ptnew[2] * zinv);
963 ptnew[0] * dir[0] + ptnew[1] * dir[1] + 0.5 * (r1 - r2) * dir[2] * zinv *
TMath::Sqrt(rxy2);
964 if (sigz * ddotn >= 0)
970 znew = ptnew[2] + snxt * dir[2];
975 xnew = ptnew[0] + snxt * dir[0];
976 ynew = ptnew[1] + snxt * dir[1];
987 znew = ptnew[2] + snxt * dir[2];
992 xnew = ptnew[0] + snxt * dir[0];
993 ynew = ptnew[1] + snxt * dir[1];
1033 Double_t r2 = point[0] * point[0] + point[1] * point[1] + point[2] * point[2];
1034 Double_t b = point[0] * dir[0] + point[1] * dir[1] + point[2] * dir[2];
1049 s = (firstcross) ? (-
b -
d) : (-
b +
d);
1055 for (i = 0; i < 3; i++)
1056 pt[i] = point[i] + s * dir[i];
1070 TGeoVolumeMulti *vmulti;
1071 TGeoPatternFinder *finder;
1077 finder =
new TGeoPatternSphR(voldiv, ndiv,
start, end);
1081 for (
id = 0;
id < ndiv;
id++) {
1083 vol =
new TGeoVolume(divname, shape, voldiv->
GetMedium());
1091 finder =
new TGeoPatternSphPhi(voldiv, ndiv,
start, end);
1095 vol =
new TGeoVolume(divname, shape, voldiv->
GetMedium());
1099 for (
id = 0;
id < ndiv;
id++) {
1105 finder =
new TGeoPatternSphTheta(voldiv, ndiv,
start, end);
1109 for (
id = 0;
id < ndiv;
id++) {
1111 vol =
new TGeoVolume(divname, shape, voldiv->
GetMedium());
1118 default:
Error(
"Divide",
"In shape %s wrong axis type for division",
GetName());
return nullptr;
1129 case 2:
return "PHI";
1130 case 3:
return "THETA";
1131 default:
return "UNDEFINED";
1176 param[0] =
fRmin * smin;
1177 param[0] *= param[0];
1180 param[1] =
fRmax * smax;
1181 param[1] *= param[1];
1188 while (param[3] < param[2])
1197 printf(
"*** Shape %s: TGeoSphere ***\n",
GetName());
1198 printf(
" Rmin = %11.5f\n",
fRmin);
1199 printf(
" Rmax = %11.5f\n",
fRmax);
1200 printf(
" Th1 = %11.5f\n",
fTheta1);
1201 printf(
" Th2 = %11.5f\n",
fTheta2);
1202 printf(
" Ph1 = %11.5f\n",
fPhi1);
1203 printf(
" Ph2 = %11.5f\n",
fPhi2);
1204 printf(
" Bounding box:\n");
1223 Int_t nlat =
fNz + 1 - (nup + ndown);
1229 Int_t nbPnts = nlat * nlong + nup + ndown + ncenter;
1233 Int_t nbSegs = nlat *
fNseg + (nlat - 1 + nup + ndown) * nlong;
1237 nbSegs += 2 * nlat + nup + ndown;
1238 nbSegs += nlong * (2 - nup - ndown);
1245 nbPols += (2 - nup - ndown) *
fNseg;
1270 Int_t nlat =
fNz + 1 - (nup + ndown);
1297 for (i = 0; i < nlat; i++) {
1298 for (j = 0; j <
fNseg; j++) {
1300 buff.
fSegs[indx++] = i * nlong + j;
1301 buff.
fSegs[indx++] = i * nlong + (j + 1) % nlong;
1307 for (i = 0; i < nlat - 1; i++) {
1308 for (j = 0; j < nlong; j++) {
1310 buff.
fSegs[indx++] = i * nlong + j;
1311 buff.
fSegs[indx++] = (i + 1) * nlong + j;
1314 Int_t indup = indlong + (nlat - 1) * nlong;
1318 Int_t indpup = nlat * nlong;
1319 for (j = 0; j < nlong; j++) {
1321 buff.
fSegs[indx++] = j;
1322 buff.
fSegs[indx++] = indpup;
1325 Int_t inddown = indup + nup * nlong;
1329 Int_t indpdown = nlat * nlong + nup;
1330 for (j = 0; j < nlong; j++) {
1332 buff.
fSegs[indx++] = (nlat - 1) * nlong + j;
1333 buff.
fSegs[indx++] = indpdown;
1336 Int_t indparin = inddown + ndown * nlong;
1337 Int_t indlongin = indparin;
1338 Int_t indupin = indparin;
1339 Int_t inddownin = indparin;
1340 Int_t indphi = indparin;
1342 Int_t indptin = nlat * nlong + nup + ndown;
1343 Int_t iptcenter = indptin;
1346 indlongin = indparin + nlat *
fNseg;
1347 indupin = indlongin + (nlat - 1) * nlong;
1348 inddownin = indupin + nup * nlong;
1351 for (i = 0; i < nlat; i++) {
1352 for (j = 0; j <
fNseg; j++) {
1353 buff.
fSegs[indx++] =
c + 1;
1354 buff.
fSegs[indx++] = indptin + i * nlong + j;
1355 buff.
fSegs[indx++] = indptin + i * nlong + (j + 1) % nlong;
1360 for (i = 0; i < nlat - 1; i++) {
1361 for (j = 0; j < nlong; j++) {
1362 buff.
fSegs[indx++] =
c + 1;
1363 buff.
fSegs[indx++] = indptin + i * nlong + j;
1364 buff.
fSegs[indx++] = indptin + (i + 1) * nlong + j;
1370 Int_t indupltop = indptin + nlat * nlong;
1371 for (j = 0; j < nlong; j++) {
1372 buff.
fSegs[indx++] =
c + 1;
1373 buff.
fSegs[indx++] = indptin + j;
1374 buff.
fSegs[indx++] = indupltop;
1380 Int_t indpdown = indptin + nlat * nlong + nup;
1381 for (j = 0; j < nlong; j++) {
1382 buff.
fSegs[indx++] =
c + 1;
1383 buff.
fSegs[indx++] = indptin + (nlat - 1) * nlong + j;
1384 buff.
fSegs[indx++] = indpdown;
1387 indphi = inddownin + ndown * nlong;
1389 Int_t indtheta = indphi;
1392 indtheta += 2 * nlat + nup + ndown;
1393 for (j = 0; j < nlat; j++) {
1394 buff.
fSegs[indx++] =
c + 2;
1395 buff.
fSegs[indx++] = j * nlong;
1397 buff.
fSegs[indx++] = indptin + j * nlong;
1399 buff.
fSegs[indx++] = iptcenter;
1401 for (j = 0; j < nlat; j++) {
1402 buff.
fSegs[indx++] =
c + 2;
1403 buff.
fSegs[indx++] = (j + 1) * nlong - 1;
1405 buff.
fSegs[indx++] = indptin + (j + 1) * nlong - 1;
1407 buff.
fSegs[indx++] = iptcenter;
1410 buff.
fSegs[indx++] =
c + 2;
1411 buff.
fSegs[indx++] = nlat * nlong;
1413 buff.
fSegs[indx++] = indptin + nlat * nlong;
1415 buff.
fSegs[indx++] = iptcenter;
1418 buff.
fSegs[indx++] =
c + 2;
1419 buff.
fSegs[indx++] = nlat * nlong + nup;
1421 buff.
fSegs[indx++] = indptin + nlat * nlong + nup;
1423 buff.
fSegs[indx++] = iptcenter;
1428 for (j = 0; j < nlong; j++) {
1429 buff.
fSegs[indx++] =
c + 2;
1430 buff.
fSegs[indx++] = j;
1432 buff.
fSegs[indx++] = indptin + j;
1434 buff.
fSegs[indx++] = iptcenter;
1438 for (j = 0; j < nlong; j++) {
1439 buff.
fSegs[indx++] =
c + 2;
1440 buff.
fSegs[indx++] = (nlat - 1) * nlong + j;
1442 buff.
fSegs[indx++] = indptin + (nlat - 1) * nlong + j;
1444 buff.
fSegs[indx++] = iptcenter;
1450 for (i = 0; i < nlat - 1; i++) {
1451 for (j = 0; j <
fNseg; j++) {
1453 buff.
fPols[indx++] = 4;
1455 buff.
fPols[indx++] = indlong + i * nlong + (j + 1) % nlong;
1456 buff.
fPols[indx++] = indpar + (i + 1) *
fNseg + j;
1457 buff.
fPols[indx++] = indlong + i * nlong + j;
1462 for (j = 0; j <
fNseg; j++) {
1464 buff.
fPols[indx++] = 3;
1465 buff.
fPols[indx++] = indup + j;
1466 buff.
fPols[indx++] = indup + (j + 1) % nlong;
1467 buff.
fPols[indx++] = indpar + j;
1472 for (j = 0; j <
fNseg; j++) {
1474 buff.
fPols[indx++] = 3;
1475 buff.
fPols[indx++] = inddown + j;
1476 buff.
fPols[indx++] = indpar + (nlat - 1) *
fNseg + j;
1477 buff.
fPols[indx++] = inddown + (j + 1) % nlong;
1483 for (i = 0; i < nlat - 1; i++) {
1484 for (j = 0; j <
fNseg; j++) {
1485 buff.
fPols[indx++] =
c + 1;
1486 buff.
fPols[indx++] = 4;
1487 buff.
fPols[indx++] = indparin + i *
fNseg + j;
1488 buff.
fPols[indx++] = indlongin + i * nlong + j;
1489 buff.
fPols[indx++] = indparin + (i + 1) *
fNseg + j;
1490 buff.
fPols[indx++] = indlongin + i * nlong + (j + 1) % nlong;
1495 for (j = 0; j <
fNseg; j++) {
1496 buff.
fPols[indx++] =
c + 1;
1497 buff.
fPols[indx++] = 3;
1498 buff.
fPols[indx++] = indupin + j;
1499 buff.
fPols[indx++] = indparin + j;
1500 buff.
fPols[indx++] = indupin + (j + 1) % nlong;
1505 for (j = 0; j <
fNseg; j++) {
1506 buff.
fPols[indx++] =
c + 1;
1507 buff.
fPols[indx++] = 3;
1508 buff.
fPols[indx++] = inddownin + j;
1509 buff.
fPols[indx++] = inddownin + (j + 1) % nlong;
1510 buff.
fPols[indx++] = indparin + (nlat - 1) *
fNseg + j;
1516 for (i = 0; i < nlat - 1; i++) {
1517 buff.
fPols[indx++] =
c + 2;
1519 buff.
fPols[indx++] = 4;
1520 buff.
fPols[indx++] = indlong + i * nlong;
1521 buff.
fPols[indx++] = indphi + i + 1;
1522 buff.
fPols[indx++] = indlongin + i * nlong;
1523 buff.
fPols[indx++] = indphi + i;
1525 buff.
fPols[indx++] = 3;
1526 buff.
fPols[indx++] = indlong + i * nlong;
1527 buff.
fPols[indx++] = indphi + i + 1;
1528 buff.
fPols[indx++] = indphi + i;
1531 for (i = 0; i < nlat - 1; i++) {
1532 buff.
fPols[indx++] =
c + 2;
1534 buff.
fPols[indx++] = 4;
1535 buff.
fPols[indx++] = indlong + (i + 1) * nlong - 1;
1536 buff.
fPols[indx++] = indphi + nlat + i;
1537 buff.
fPols[indx++] = indlongin + (i + 1) * nlong - 1;
1538 buff.
fPols[indx++] = indphi + nlat + i + 1;
1540 buff.
fPols[indx++] = 3;
1541 buff.
fPols[indx++] = indlong + (i + 1) * nlong - 1;
1542 buff.
fPols[indx++] = indphi + nlat + i;
1543 buff.
fPols[indx++] = indphi + nlat + i + 1;
1547 buff.
fPols[indx++] =
c + 2;
1549 buff.
fPols[indx++] = 4;
1550 buff.
fPols[indx++] = indup;
1551 buff.
fPols[indx++] = indphi;
1552 buff.
fPols[indx++] = indupin;
1553 buff.
fPols[indx++] = indphi + 2 * nlat;
1555 buff.
fPols[indx++] = 3;
1556 buff.
fPols[indx++] = indup;
1557 buff.
fPols[indx++] = indphi;
1558 buff.
fPols[indx++] = indphi + 2 * nlat;
1560 buff.
fPols[indx++] =
c + 2;
1562 buff.
fPols[indx++] = 4;
1563 buff.
fPols[indx++] = indup + nlong - 1;
1564 buff.
fPols[indx++] = indphi + 2 * nlat;
1565 buff.
fPols[indx++] = indupin + nlong - 1;
1566 buff.
fPols[indx++] = indphi + nlat;
1568 buff.
fPols[indx++] = 3;
1569 buff.
fPols[indx++] = indup + nlong - 1;
1570 buff.
fPols[indx++] = indphi + 2 * nlat;
1571 buff.
fPols[indx++] = indphi + nlat;
1575 buff.
fPols[indx++] =
c + 2;
1577 buff.
fPols[indx++] = 4;
1578 buff.
fPols[indx++] = inddown;
1579 buff.
fPols[indx++] = indphi + 2 * nlat + nup;
1580 buff.
fPols[indx++] = inddownin;
1581 buff.
fPols[indx++] = indphi + nlat - 1;
1583 buff.
fPols[indx++] = 3;
1584 buff.
fPols[indx++] = inddown;
1585 buff.
fPols[indx++] = indphi + 2 * nlat + nup;
1586 buff.
fPols[indx++] = indphi + nlat - 1;
1588 buff.
fPols[indx++] =
c + 2;
1590 buff.
fPols[indx++] = 4;
1591 buff.
fPols[indx++] = inddown + nlong - 1;
1592 buff.
fPols[indx++] = indphi + 2 * nlat - 1;
1593 buff.
fPols[indx++] = inddownin + nlong - 1;
1594 buff.
fPols[indx++] = indphi + 2 * nlat + nup;
1596 buff.
fPols[indx++] = 3;
1597 buff.
fPols[indx++] = inddown + nlong - 1;
1598 buff.
fPols[indx++] = indphi + 2 * nlat - 1;
1599 buff.
fPols[indx++] = indphi + 2 * nlat + nup;
1605 for (j = 0; j <
fNseg; j++) {
1606 buff.
fPols[indx++] =
c + 2;
1608 buff.
fPols[indx++] = 4;
1609 buff.
fPols[indx++] = indpar + j;
1610 buff.
fPols[indx++] = indtheta + j;
1611 buff.
fPols[indx++] = indparin + j;
1612 buff.
fPols[indx++] = indtheta + (j + 1) % nlong;
1614 buff.
fPols[indx++] = 3;
1615 buff.
fPols[indx++] = indpar + j;
1616 buff.
fPols[indx++] = indtheta + j;
1617 buff.
fPols[indx++] = indtheta + (j + 1) % nlong;
1622 for (j = 0; j <
fNseg; j++) {
1623 buff.
fPols[indx++] =
c + 2;
1625 buff.
fPols[indx++] = 4;
1626 buff.
fPols[indx++] = indpar + (nlat - 1) *
fNseg + j;
1627 buff.
fPols[indx++] = indtheta + (1 - nup) * nlong + (j + 1) % nlong;
1628 buff.
fPols[indx++] = indparin + (nlat - 1) *
fNseg + j;
1629 buff.
fPols[indx++] = indtheta + (1 - nup) * nlong + j;
1631 buff.
fPols[indx++] = 3;
1632 buff.
fPols[indx++] = indpar + (nlat - 1) *
fNseg + j;
1633 buff.
fPols[indx++] = indtheta + (1 - nup) * nlong + (j + 1) % nlong;
1634 buff.
fPols[indx++] = indtheta + (1 - nup) * nlong + j;
1646 Double_t r2 = point[0] * point[0] + point[1] * point[1] + point[2] * point[2];
1675 for (
Int_t i = 0; i < 4; i++)
1690 out <<
" // Shape: " <<
GetName() <<
" type: " <<
ClassName() << std::endl;
1691 out <<
" rmin = " <<
fRmin <<
";" << std::endl;
1692 out <<
" rmax = " <<
fRmax <<
";" << std::endl;
1693 out <<
" theta1 = " <<
fTheta1 <<
";" << std::endl;
1694 out <<
" theta2 = " <<
fTheta2 <<
";" << std::endl;
1695 out <<
" phi1 = " <<
fPhi1 <<
";" << std::endl;
1696 out <<
" phi2 = " <<
fPhi2 <<
";" << std::endl;
1698 <<
"\",rmin,rmax,theta1, theta2,phi1,phi2);" << std::endl;
1709 Error(
"SetDimensions",
"invalid parameters rmin/rmax");
1716 if (theta1 >= theta2 || theta1 < 0 || theta1 > 180 || theta2 > 180) {
1717 Error(
"SetDimensions",
"invalid parameters theta1/theta2");
1722 if ((theta2 - theta1) < 180.)
1786 Error(
"SetPoints",
"Input array is NULL");
1798 Int_t nlat =
fNz + 1 - (nup + ndown);
1813 Double_t z, zi, theta, phi, cphi, sphi;
1820 for (i = 0; i < nlat; i++) {
1821 theta = theta1 + (nup + i) * dtheta;
1825 for (j = 0; j < nlong; j++) {
1826 phi = phi1 + j * dphi;
1829 points[indx++] = zi * cphi;
1830 points[indx++] = zi * sphi;
1851 for (i = 0; i < nlat; i++) {
1852 theta = theta1 + (nup + i) * dtheta;
1856 for (j = 0; j < nlong; j++) {
1857 phi = phi1 + j * dphi;
1860 points[indx++] = zi * cphi;
1861 points[indx++] = zi * sphi;
1894 Error(
"SetPoints",
"Input array is NULL");
1906 Int_t nlat =
fNz + 1 - (nup + ndown);
1921 Double_t z, zi, theta, phi, cphi, sphi;
1928 for (i = 0; i < nlat; i++) {
1929 theta = theta1 + (nup + i) * dtheta;
1933 for (j = 0; j < nlong; j++) {
1934 phi = phi1 + j * dphi;
1937 points[indx++] = zi * cphi;
1938 points[indx++] = zi * sphi;
1959 for (i = 0; i < nlat; i++) {
1960 theta = theta1 + (nup + i) * dtheta;
1964 for (j = 0; j < nlong; j++) {
1965 phi = phi1 + j * dphi;
1968 points[indx++] = zi * cphi;
1969 points[indx++] = zi * sphi;
2012 Int_t nlat =
fNz + 1 - (nup + ndown);
2018 nvert = nlat * nlong + nup + ndown + ncenter;
2022 nsegs = nlat *
fNseg + (nlat - 1 + nup + ndown) * nlong;
2026 nsegs += 2 * nlat + nup + ndown;
2027 nsegs += nlong * (2 - nup - ndown);
2034 npols += (2 - nup - ndown) *
fNseg;
2051 Int_t nlat =
fNz + 1 - (nup + ndown);
2059 Int_t numPoints = 0;
2061 numPoints = 2 * (nlat * nlong + nup + ndown);
2063 numPoints = nlat * nlong + nup + ndown + ncenter;
2077 static TBuffer3DSphere buffer;
2104 Int_t nlat =
fNz + 1 - (nup + ndown);
2110 Int_t nbPnts = nlat * nlong + nup + ndown + ncenter;
2114 Int_t nbSegs = nlat *
fNseg + (nlat - 1 + nup + ndown) * nlong;
2118 nbSegs += 2 * nlat + nup + ndown;
2119 nbSegs += nlong * (2 - nup - ndown);
2126 nbPols += (2 - nup - ndown) *
fNseg;
2128 if (buffer.
SetRawSizes(nbPnts, 3 * nbPnts, nbSegs, 3 * nbSegs, nbPols, 6 * nbPols)) {
2151 for (
Int_t i = 0; i < vecsize; i++)
2162 for (
Int_t i = 0; i < vecsize; i++)
2172 for (
Int_t i = 0; i < vecsize; i++)
2182 for (
Int_t i = 0; i < vecsize; i++)
2193 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.
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
Fill 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)
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
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)
void SetDivIndex(Int_t index)
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.
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.
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
Double_t DistToSphere(const Double_t *point, const Double_t *dir, Double_t rsph, Bool_t check=kTRUE, Bool_t firstcross=kTRUE) const
TGeoVolume * Divide(TGeoVolume *voldiv, const char *divname, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step) override
void DistFromInside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
void SetPoints(Double_t *points) const override
Bool_t Contains(const Double_t *point) const override
void Contains_v(const Double_t *points, Bool_t *inside, Int_t vecsize) const override
void SetSphDimensions(Double_t rmin, Double_t rmax, Double_t theta1, Double_t theta2, Double_t phi1, Double_t phi2)
void GetMeshNumbers(Int_t &nvert, Int_t &nsegs, Int_t &npols) const override
void Safety_v(const Double_t *points, const Bool_t *inside, Double_t *safe, Int_t vecsize) const override
void DistFromOutside_v(const Double_t *points, const Double_t *dirs, Double_t *dists, Int_t vecsize, Double_t *step) const override
void SetDimensions(Double_t *param) override
TBuffer3D * MakeBuffer3D() const override
void InspectShape() const override
void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const override
void SetSegsAndPols(TBuffer3D &buff) const override
TGeoSphere(const TGeoSphere &)=delete
Bool_t IsPointInside(const Double_t *point, Bool_t checkR=kTRUE, Bool_t checkTh=kTRUE, Bool_t checkPh=kTRUE) const
Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const override
void ComputeBBox() override
Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t &xhi) 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
virtual void SetNumberOfDivisions(Int_t p)
const TBuffer3D & GetBuffer3D(Int_t reqSections, Bool_t localFrame) const override
Stub implementation to avoid forcing implementation at this stage.
const char * GetAxisName(Int_t iaxis) const override
Double_t Capacity() const override
void ComputeNormal_v(const Double_t *points, const Double_t *dirs, Double_t *norms, Int_t vecsize) override
void GetBoundingCylinder(Double_t *param) const override
Int_t GetNmeshVertices() const override
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
Int_t IsOnBoundary(const Double_t *point) const
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
Computes distance from point (px,py) to the object.
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
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.