232 Bool_t refresh,
const char *msg)
239 static Int_t oseconds = 0;
242 static Int_t nrefresh = 0;
243 const char symbol[4] = {
'=',
'\\',
'|',
'/'};
244 char progress[11] =
" ";
245 Int_t ichar = icount % 4;
257 if (ocurrent > osize)
269 if (owatch && !last) {
272 hours = (
Int_t)(time / 3600.);
273 time -= 3600 * hours;
274 minutes = (
Int_t)(time / 60.);
275 time -= 60 * minutes;
276 seconds = (
Int_t)time;
278 if (oseconds == seconds) {
282 oneoftwo = !oneoftwo;
286 if (refresh && oneoftwo) {
293 Double_t percent = 100.0 * ocurrent / osize;
298 for (i = 0; i < nchar; i++)
300 progress[nchar] = symbol[ichar];
301 for (i = nchar + 1; i < 10; i++)
307 fprintf(stderr,
"%s [%10s] %4lld ", oname.
Data(), progress, ocurrent);
308 else if (
size < 100000)
309 fprintf(stderr,
"%s [%10s] %5lld ", oname.
Data(), progress, ocurrent);
311 fprintf(stderr,
"%s [%10s] %7lld ", oname.
Data(), progress, ocurrent);
313 fprintf(stderr,
"[%6.2f %%] TIME %.2d:%.2d:%.2d %s\r", percent, hours, minutes, seconds, message.
Data());
315 fprintf(stderr,
"[%6.2f %%] %s\r", percent, message.
Data());
316 if (refresh && oneoftwo)
328 fprintf(stderr,
"\n");
340 Info(
"CheckBoundaryErrors",
"Top volume is %s", tvol->
GetName());
354 TTree *bug =
new TTree(
"bug",
"Geometrical problems");
355 bug->
Branch(
"pos", xyz,
"xyz[3]/D");
356 bug->
Branch(
"dir", dir,
"dir[3]/D");
357 bug->
Branch(
"push", &relp,
"push/D");
358 bug->
Branch(
"path", &path,
"path/C");
359 bug->
Branch(
"cdir", &cdir,
"cdir/C");
361 dl[0] =
box->GetDX();
362 dl[1] =
box->GetDY();
363 dl[2] =
box->GetDZ();
364 ori[0] = (
box->GetOrigin())[0];
365 ori[1] = (
box->GetOrigin())[1];
366 ori[2] = (
box->GetOrigin())[2];
368 dl[0] = dl[1] = dl[2] = radius;
371 TH1F *hnew =
new TH1F(
"hnew",
"Precision pushing", 30, -20., 10.);
372 TH1F *hold =
new TH1F(
"hold",
"Precision pulling", 30, -20., 10.);
373 TH2F *hplotS =
new TH2F(
"hplotS",
"Problematic points", 100, -dl[0], dl[0], 100, -dl[1], dl[1]);
374 gStyle->SetOptStat(111111);
379 Long_t n100 = ntracks / 100;
381 printf(
"Random box : %f, %f, %f, %f, %f, %f\n", ori[0], ori[1], ori[2], dl[0], dl[1], dl[2]);
382 printf(
"Start... %i points\n", ntracks);
387 while (igen < ntracks) {
400 if (n100 && !(igen % n100))
413 for (
Int_t i = 0; i < 30; ++i) {
415 for (
Int_t j = 0; j < 3; ++j)
416 nxyz[j] = xyz[j] + step * (1. + relp) * dir[j];
417 if (!
fGeoManager->IsSameLocation(nxyz[0], nxyz[1], nxyz[2])) {
423 Double_t dotp = norm[0] * dir[0] + norm[1] * dir[1] + norm[2] * dir[2];
424 printf(
"Forward error i=%d p=%5.4f %5.4f %5.4f s=%5.4f dot=%5.4f path=%s\n", i, xyz[0], xyz[1], xyz[2],
427 strncpy(cdir,
"Forward", 10);
435 for (
Int_t i = 0; i < 30; ++i) {
437 for (
Int_t j = 0; j < 3; ++j)
438 nxyz[j] = xyz[j] + step * (1. + relp) * dir[j];
439 if (
fGeoManager->IsSameLocation(nxyz[0], nxyz[1], nxyz[2])) {
445 Double_t dotp = norm[0] * dir[0] + norm[1] * dir[1] + norm[2] * dir[2];
446 printf(
"Backward error i=%d p=%5.4f %5.4f %5.4f s=%5.4f dot=%5.4f path=%s\n", i, xyz[0], xyz[1], xyz[2],
448 strncpy(cdir,
"Backward", 10);
458 printf(
"CPU time/point = %5.2emus: Real time/point = %5.2emus\n", 1000000. *
fTimer->CpuTime() / itry,
459 1000000. *
fTimer->RealTime() / itry);
468 printf(
"Effic = %3.1f%%\n", (100. * igen) / itry);
477 new TCanvas(
"c3",
"Plot", 600, 600);
478 hplotS->
Draw(
"cont0");
509 printf(
"%-9s error push=%g p=%5.4f %5.4f %5.4f s=%5.4f dot=%5.4f path=%s\n", cdir, push, xyz[0], xyz[1],
510 xyz[2], 1., 1., path);
518 printf(
"%-9s error push=%g p=%5.4f %5.4f %5.4f s=%5.4f dot=%5.4f path=%s\n", cdir, push, xyz[0], xyz[1], xyz[2],
525 for (
Int_t j = 0; j < 3; j++)
526 nxyz[j] = xyz[j] + step * (1. + 0.1 * push) * dir[j];
528 printf(
"step=%g in: %s\n", step,
fGeoManager->GetPath());
529 printf(
" -> next = %s push=%g change=%d\n", next->
GetName(), push, (
UInt_t)change);
545 for (
Int_t j = 0; j < 3; j++)
546 nxyz[j] = xyz[j] + step * dir[j];
593 TCanvas *
c =
new TCanvas(
"overlaps",
"Overlaps by sampling", 800, 800);
597 printf(
"====================================================================\n");
598 printf(
"STAGE 1: Overlap checking by sampling within 10 microns\n");
599 printf(
"====================================================================\n");
603 printf(
"====================================================================\n");
604 printf(
"STAGE 2: Global overlap/extrusion checking within 10 microns\n");
605 printf(
"====================================================================\n");
609 if (!checkcrossings) {
625 printf(
"====================================================================\n");
626 printf(
"STAGE 3: Propagating %i tracks starting from vertex\n and counting number of boundary crossings...\n",
628 printf(
"====================================================================\n");
632 memset(point, 0, 3 *
sizeof(
Double_t));
634 memcpy(point, vertex, 3 *
sizeof(
Double_t));
638 for (i = 0; i < ntracks; i++) {
650 printf(
"No boundary crossed\n");
658 printf(
"Time for crossing %i boundaries: %g [ms]\n", nbound, time1);
659 printf(
"Time per track for full geometry traversal: %g [ms], per crossing: %g [ms]\n", time2, time3);
663 printf(
"====================================================================\n");
664 printf(
"STAGE 4: How much navigation time per volume per next+safety call\n");
665 printf(
"====================================================================\n");
675 strncpy(volname, vol->
GetName(), 15);
679 while ((current = next())) {
687 strncpy(volname, vol->
GetName(), 15);
697 c1->SetTopMargin(0.15);
698 TFile *
f =
new TFile(
"statistics.root",
"RECREATE");
699 TH1F *
h =
new TH1F(
"h",
"number of boundary crossings per volume", 3, 0, 3);
705 for (i = 0; i < nuid; i++) {
712 time_tot_pertrack /= ntracks;
714 h->LabelsOption(
">",
"X");
717 TCanvas *
c2 =
new TCanvas(
"c3",
"time spent per volume in navigation", 10, 10, 900, 500);
719 c2->SetTopMargin(0.15);
720 TH2F *h2 =
new TH2F(
"h2",
"time per FNB call vs. ndaughters", 100, 0, 100, 100, 0, 15);
723 TH1F *
h1 =
new TH1F(
"h1",
"percent of time spent per volume", 3, 0, 3);
725 h1->SetFillColor(38);
727 for (i = 0; i < nuid; i++) {
731 value =
fVal1[i] *
fVal2[i] / ntracks / time_tot_pertrack;
736 h1->LabelsOption(
">",
"X");
740 c3->SetTopMargin(0.15);
767 printf(
"Error in trying to cross boundary of %s\n", current->
GetName());
800 case 0:
fVal1[uid] += value;
break;
801 case 1:
fVal2[uid] += value;
820 Double_t point[3], dir[3], lpt[3], ldir[3];
826 for (
Int_t i = 0; i < 1000000; i++) {
827 lpt[0] = ox - dx + 2 * dx *
gRandom->Rndm();
828 lpt[1] = oy - dy + 2 * dy *
gRandom->Rndm();
829 lpt[2] = oz - dz + 2 * dz *
gRandom->Rndm();
830 fGeoManager->GetCurrentMatrix()->LocalToMaster(lpt, point);
831 fGeoManager->SetCurrentPoint(point[0], point[1], point[2]);
837 fGeoManager->GetCurrentMatrix()->LocalToMasterVect(ldir, dir);
864 printf(
"Time for volume %s (shape=%s): %g [ms] ndaughters=%d ncross=%d\n", vol->
GetName(),
867 printf(
"Time for volume %s (assemb=%d): %g [ms] ndaughters=%d ncross=%d\n", vol->
GetName(), vol->
IsAssembly(),
869 return time_per_track;
903 Int_t nelem1, nelem2;
904 Int_t dim1 = 1000, dim2 = 1000;
905 if ((startx == 0) && (starty == 0) && (startz == 0))
907 start[0] = startx + eps;
908 start[1] = starty + eps;
909 start[2] = startz + eps;
910 Int_t n10 = nrays / 10;
913 Int_t ist1, ist2, ifound;
914 for (i = 0; i < nrays; i++) {
917 printf(
"%i percent\n",
Int_t(100 * i / nrays));
927 array1 =
ShootRay(&
start[0], dir[0], dir[1], dir[2], array1, nelem1, dim1);
931 memcpy(&end[0], &array1[3 * (nelem1 - 1)], 3 *
sizeof(
Double_t));
934 array2 =
ShootRay(&end[0], -dir[0], -dir[1], -dir[2], array2, nelem2, dim2, &
start[0]);
936 printf(
"#### NOTHING BACK ###########################\n");
937 for (j = 0; j < nelem1; j++) {
939 pm->
SetNextPoint(array1[3 * j], array1[3 * j + 1], array1[3 * j + 2]);
944 Int_t k = nelem2 >> 1;
945 for (j = 0; j < k; j++) {
946 memcpy(&dummy[0], &array2[3 * j], 3 *
sizeof(
Double_t));
947 memcpy(&array2[3 * j], &array2[3 * (nelem2 - 1 - j)], 3 *
sizeof(
Double_t));
948 memcpy(&array2[3 * (nelem2 - 1 - j)], &dummy[0], 3 *
sizeof(
Double_t));
951 if (nelem1 != nelem2)
952 printf(
"### DIFFERENT SIZES : nelem1=%i nelem2=%i ##########\n", nelem1, nelem2);
956 dx = array1[3 * ist1] - array2[3 * ist2];
957 dy = array1[3 * ist1 + 1] - array2[3 * ist2 + 1];
958 dz = array1[3 * ist1 + 2] - array2[3 * ist2 + 2];
959 dw = dx * dir[0] + dy * dir[1] + dz * dir[2];
968 printf(
"### NOT MATCHING %i f:(%f, %f, %f) b:(%f %f %f) DCLOSE=%f\n", ist2, array1[3 * ist1],
969 array1[3 * ist1 + 1], array1[3 * ist1 + 2], array2[3 * ist2], array2[3 * ist2 + 1],
970 array2[3 * ist2 + 2], dw);
972 pm->
SetNextPoint(array2[3 * ist2], array2[3 * ist2 + 1], array2[3 * ist2 + 2]);
981 while ((ist1 < nelem1 - 1) && (ist2 < nelem2)) {
982 fGeoManager->SetCurrentPoint(&array1[3 * ist1 + 3]);
987 dx = array1[3 * ist1 + 3] - array1[3 * ist1];
988 dy = array1[3 * ist1 + 4] - array1[3 * ist1 + 1];
989 dz = array1[3 * ist1 + 5] - array1[3 * ist1 + 2];
991 dwmin = dx * dir[0] + dy * dir[1] + dz * dir[2];
992 while (ist2 < nelem2) {
994 dx = array2[3 * ist2] - array1[3 * ist1];
995 dy = array2[3 * ist2 + 1] - array1[3 * ist1 + 1];
996 dz = array2[3 * ist2 + 2] - array1[3 * ist1 + 2];
997 dw = dx * dir[0] + dy * dir[1] + dz * dir[2];
1019 pm->
SetNextPoint(array2[3 * ist2], array2[3 * ist2 + 1], array2[3 * ist2 + 2]);
1020 printf(
"### EXTRA BOUNDARY %i : %s found at DCLOSE=%f\n", ist2,
fGeoManager->GetPath(), dw);
1027 fGeoManager->SetCurrentPoint(&array1[3 * ist1 + 3]);
1030 pm->
SetNextPoint(array2[3 * ist1 + 3], array2[3 * ist1 + 4], array2[3 * ist1 + 5]);
1031 printf(
"### BOUNDARY MISSED BACK #########################\n");
1065 for (
Int_t i = 0; i < numPoints; i++) {
1103 if (m1.fNPoints <= 0 || m2.fNPoints <= 0)
1106 const Double_t *points1 = m1.fPoints.data();
1107 const Double_t *points2 = m2.fPoints.data();
1108 const Int_t numPoints1 = m1.fNPoints;
1109 const Int_t numPoints2 = m2.fNPoints;
1117 auto add_point = [&](
const Double_t p[3]) {
1119 out.
fPoints.push_back({{p[0], p[1], p[2]}});
1122 auto start_result_if_needed = [&]() {
1135 Double_t local[3], local1[3], point[3];
1142 if (!
c.fIsOverlap) {
1146 for (
Int_t ip = 0; ip < numPoints2; ++ip) {
1147 memcpy(local, &points2[3 * ip], 3 *
sizeof(
Double_t));
1162 start_result_if_needed();
1171 for (
Int_t ip = 0; ip < numPoints1; ++ip) {
1172 memcpy(local, &points1[3 * ip], 3 *
sizeof(
Double_t));
1173 if (local[0] < 1
e-10 && local[1] < 1
e-10)
1182 if (safety > 1E-6) {
1192 start_result_if_needed();
1209 for (
Int_t ip = 0; ip < numPoints1; ++ip) {
1210 memcpy(local, &points1[3 * ip], 3 *
sizeof(
Double_t));
1211 if (local[0] < 1
e-10 && local[1] < 1
e-10)
1225 start_result_if_needed();
1234 for (
Int_t ip = 0; ip < numPoints2; ++ip) {
1235 memcpy(local, &points2[3 * ip], 3 *
sizeof(
Double_t));
1236 if (local[0] < 1
e-10 && local[1] < 1
e-10)
1250 start_result_if_needed();
1281 Int_t *check_list =
nullptr;
1287 Int_t id = 0, id0 = 0, id1 = 0;
1299 while (ipoint < npoints) {
1301 pt[0] = orig[0] - dx + 2. * dx *
gRandom->Rndm();
1302 pt[1] = orig[1] - dy + 2. * dy *
gRandom->Rndm();
1303 pt[2] = orig[2] - dz + 2. * dz *
gRandom->Rndm();
1306 if (itry > 10000 && !ipoint) {
1307 Error(
"CheckOverlapsBySampling",
"No point inside volume!!! - aborting");
1316 if (!check_list || ncheck < 2)
1318 for (
id = 0;
id < ncheck;
id++) {
1319 id0 = check_list[
id];
1344 memset(flags, 0, nd * nd *
sizeof(
TGeoOverlap *));
1353 while (cindex >= 0) {
1363 while (cindex >= 0) {
1372 flags[nd * id1 + id0] = nodeovlp;
1390 Info(
"CheckOverlapsBySampling",
"#Found %d overlaps adding-up to %g +/- %g [cm3] for daughters of %s", novlps,
1398 auto *ov =
new TGeoOverlap(
r.fName.Data(),
r.fVol1,
r.fVol2, &
r.fMat1, &
r.fMat2,
r.fIsOverlap,
r.fMaxOverlap);
1400 for (
const auto &p :
r.fPoints)
1401 ov->SetNextPoint(p[0], p[1], p[2]);
1434 while ((node = next1())) {
1457 for (
id = 0;
id < nd;
id++) {
1465 for (ko = 0; ko < novlp; ko++) {
1476 while ((node = next1())) {
1480 while ((node1 = next2())) {
1496 while ((node1 = next2())) {
1525 ::Error(
"TGeoChecker::GetMeshPoints",
1526 "Mesh cache miss for shape %s. BuildMeshPointsCache did not cover all candidates.", shape->
ClassName());
1537 if (policyChanged) {
1543 auto ensureShape = [&](
const TGeoShape *shape) {
1551 Int_t meshN = 0, meshS = 0, meshP = 0;
1552 const_cast<TGeoShape *
>(shape)->GetMeshNumbers(meshN, meshS, meshP);
1556 entry.
fPoints.resize(3 * meshN);
1565 if (nSegWanted > 0) {
1566 std::vector<Double_t> seg(3 * nSegWanted);
1567 Bool_t usedSeg =
const_cast<TGeoShape *
>(shape)->GetPointsOnSegments(nSegWanted, seg.data());
1569 const auto oldSize = entry.
fPoints.size();
1570 entry.
fPoints.resize(oldSize + seg.size());
1571 std::memcpy(entry.
fPoints.data() + oldSize, seg.data(), seg.size() *
sizeof(
Double_t));
1589 for (
const auto &
c : candidates) {
1591 ensureShape(
c.fVol1->GetShape());
1593 ensureShape(
c.fVol2->GetShape());
1601 if (lastShape == shape && cachedN > 0) {
1620 filledN = nMeshPoints;
1635 std::vector<TGeoOverlapCandidate> &out)
1659 while ((node = next1())) {
1673 while ((nodecheck = next1.
GetNode(level--))) {
1700 Warning(
"EnumerateOverlapCandidates",
"Volume %s with %i daughters but not voxelized", vol->
GetName(), nd);
1719 for (
id = 0;
id < nd;
id++) {
1727 for (io =
id + 1; io < nd; io++) {
1749 while ((node = next1())) {
1769 while ((node1 = next2())) {
1790 while ((nodecheck = next2.
GetNode(level--))) {
1798 while ((nodecheck = next1.
GetNode(level--))) {
1835 while ((nodecheck = next1.
GetNode(level--))) {
1863 while ((node1 = next2())) {
1884 while ((nodecheck = next2.
GetNode(level--))) {
1938 c.fIsOverlap = isovlp;
1940 out.emplace_back(std::move(
c));
1950 printf(
"=== Overlaps for %s ===\n",
fGeoManager->GetName());
1977 printf(
"=== Check current point : (%g, %g, %g) ===\n", point[0], point[1], point[2]);
1984 printf(
"Safety radius : %f\n", close);
2024 case 2:
ShapeSafety(shape, nsamples, option);
break;
2025 case 3:
ShapeNormal(shape, nsamples, option);
break;
2026 default:
Error(
"CheckShape",
"Test number %d not existent", testNo);
2045 auto origin_p = ((
TGeoBBox *)shape)->GetOrigin();
2054 const Int_t kNtracks = 1000;
2055 Int_t n10 = nsamples / 10;
2062 TH1D *hist =
new TH1D(
"hTest1",
"Residual distance from inside/outside", 200, -20, 0);
2071 while (itot < nsamples) {
2074 point[0] = ox +
gRandom->Uniform(-dx, dx);
2075 point[1] = oy +
gRandom->Uniform(-dy, dy);
2076 point[2] = oz +
gRandom->Uniform(-dz, dz);
2081 if ((itot % n10) == 0)
2082 printf(
"%i percent\n",
Int_t(100 * itot / nsamples));
2084 for (i = 0; i < kNtracks; i++) {
2097 printf(
"DistFromInside: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) %f/%f(max)\n", point[0],
2098 point[1], point[2], dir[0], dir[1], dir[2], d1, dmove);
2103 pmfrominside->
SetNextPoint(point[0], point[1], point[2]);
2104 for (j = 0; j < 3; j++)
2105 pnew[j] = point[j] + d1 * dir[j];
2107 pmfrominside->
Draw();
2113 for (j = 0; j < 3; j++)
2116 if (d1 + dnext < dmax)
2117 dmove = d1 + 0.5 * dnext;
2119 for (j = 0; j < 3; j++) {
2120 pnew[j] = point[j] + dmove * dir[j];
2125 delta = dmove - d1 - d2;
2130 printf(
"Error: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) d1=%f d2=%f dmove=%f\n", point[0],
2131 point[1], point[2], dir[0], dir[1], dir[2], d1, d2, dmove);
2133 printf(
" (*)DistFromOutside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) dnext = %f\n",
2138 printf(
" DistFromOutside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) dnext = %f\n",
2139 point[0] + d1 * dir[0], point[1] + d1 * dir[1], point[2] + d1 * dir[2], dir[0], dir[1], dir[2],
2142 printf(
" DistFromOutside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) = %f\n", pnew[0], pnew[1],
2143 pnew[2], dnew[0], dnew[1], dnew[2], d2);
2148 pmfrominside->
SetNextPoint(point[0], point[1], point[2]);
2149 for (j = 0; j < 3; j++)
2150 point[j] += d1 * dir[j];
2151 pmfrominside->
SetNextPoint(point[0], point[1], point[2]);
2152 pmfrominside->
Draw();
2158 pmfromoutside->
SetNextPoint(pnew[0], pnew[1], pnew[2]);
2159 for (j = 0; j < 3; j++)
2160 pnew[j] += d2 * dnew[j];
2162 pmfromoutside->
SetNextPoint(pnew[0], pnew[1], pnew[2]);
2163 pmfromoutside->
Draw();
2167 for (j = 0; j < 3; j++)
2173 printf(
"Error DistFromInside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) d1=%f d1p=%f\n", pnew[0],
2174 pnew[1], pnew[2], dnew[0], dnew[1], dnew[2], d1, dnext);
2179 pmfrominside->
SetNextPoint(point[0], point[1], point[2]);
2180 for (j = 0; j < 3; j++)
2181 point[j] += d1 * dir[j];
2182 pmfrominside->
SetNextPoint(point[0], point[1], point[2]);
2183 pmfrominside->
Draw();
2189 pmfromoutside->
SetNextPoint(pnew[0], pnew[1], pnew[2]);
2190 for (j = 0; j < 3; j++)
2191 pnew[j] += dnext * dnew[j];
2193 pmfromoutside->
SetNextPoint(pnew[0], pnew[1], pnew[2]);
2194 pmfromoutside->
Draw();
2204 new TCanvas(
"Test01",
"Residuals DistFromInside/Outside", 800, 600);
2220 auto origin_p = ((
TGeoBBox *)shape)->GetOrigin();
2226 const Int_t kNtracks = 1000;
2227 Int_t n10 = nsamples / 10;
2240 while (itot < nsamples) {
2242 point[0] = ox +
gRandom->Uniform(-2 * dx, 2 * dx);
2243 point[1] = oy +
gRandom->Uniform(-2 * dy, 2 * dy);
2244 point[2] = oz +
gRandom->Uniform(-2 * dz, 2 * dz);
2249 if ((itot % n10) == 0)
2250 printf(
"%i percent\n",
Int_t(100 * itot / nsamples));
2252 for (i = 0; i < kNtracks; i++) {
2263 printf(
"Error safety (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) safe=%f dist=%f\n", point[0],
2264 point[1], point[2], dir[0], dir[1], dir[2], safe, dist);
2272 pm1->
SetNextPoint(point[0] + safe * dir[0], point[1] + safe * dir[1], point[2] + safe * dir[2]);
2278 pm2->
SetNextPoint(point[0] + dist * dir[0], point[1] + dist * dir[1], point[2] + dist * dir[2]);
2300 auto origin_p = ((
TGeoBBox *)shape)->GetOrigin();
2307 const Int_t kNtracks = 1000;
2308 Int_t n10 = nsamples / 10;
2309 Int_t itot = 0, errcnt = 0, errsame = 0;
2315 while (itot < nsamples) {
2318 spoint[3 * itot] = ox +
gRandom->Uniform(-dx, dx);
2319 spoint[3 * itot + 1] = oy +
gRandom->Uniform(-dy, dy);
2320 spoint[3 * itot + 2] = oz +
gRandom->Uniform(-dz, dz);
2321 inside = shape->
Contains(&spoint[3 * itot]);
2330 Double_t point[3], newpoint[3], oldpoint[3];
2332 Double_t norm[3], newnorm[3], oldnorm[3];
2344 for (itot = 0; itot < nsamples; itot++) {
2346 if ((itot % n10) == 0)
2347 printf(
"%i percent\n",
Int_t(100 * itot / nsamples));
2349 oldnorm[0] = oldnorm[1] = oldnorm[2] = 0.;
2351 for (
Int_t j = 0; j < 3; j++) {
2352 oldpoint[j] = point[j] = spoint[3 * itot + j];
2353 olddir[j] = dir[j] = sdir[3 * itot + j];
2355 for (i = 0; i < kNtracks; i++) {
2362 printf(
"Error DistFromInside Too large(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) =%g\n",
2363 point[0], point[1], point[2], dir[0], dir[1], dir[2], dist);
2365 for (
Int_t j = 0; j < 3; j++) {
2366 newpoint[j] = point[j] + dist * dir[j];
2370 dot = olddir[0] * oldnorm[0] + olddir[1] * oldnorm[1] + olddir[2] * oldnorm[2];
2373 printf(
"Error point outside (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) =%g olddist=%g\n",
2374 point[0], point[1], point[2], dir[0], dir[1], dir[2], dist, olddist);
2375 printf(
" old point: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f)\n", oldpoint[0],
2376 oldpoint[1], oldpoint[2], olddir[0], olddir[1], olddir[2]);
2387 pm1->
SetNextPoint(oldpoint[0], oldpoint[1], oldpoint[2]);
2394 printf(
"Error DistFromInside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) =%g olddist=%g\n",
2395 point[0], point[1], point[2], dir[0], dir[1], dir[2], dist, olddist);
2396 printf(
" new norm: (%g, %g, %g)\n", newnorm[0], newnorm[1], newnorm[2]);
2397 printf(
" old point: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f)\n", oldpoint[0],
2398 oldpoint[1], oldpoint[2], olddir[0], olddir[1], olddir[2]);
2399 printf(
" old norm: (%g, %g, %g)\n", oldnorm[0], oldnorm[1], oldnorm[2]);
2410 pm1->
SetNextPoint(oldpoint[0], oldpoint[1], oldpoint[2]);
2417 for (
Int_t j = 0; j < 3; j++) {
2418 oldpoint[j] = point[j];
2419 point[j] += dist * dir[j];
2424 printf(
"Error safety (%19.15f, %19.15f, %19.15f) safe=%g\n", point[0], point[1], point[2], safe);
2439 memcpy(oldnorm, norm, 3 *
sizeof(
Double_t));
2440 memcpy(olddir, dir, 3 *
sizeof(
Double_t));
2447 ndotd = dir[0] * norm[0] + dir[1] * norm[1] + dir[2] * norm[2];
2451 if ((itot % 10) == 0)
2474 TH2F *hist =
new TH2F(
"lego", option, nphi, phimin, phimax, ntheta, themin, themax);
2483 Int_t ntot = ntheta * nphi;
2484 Int_t n10 = ntot / 10;
2485 Int_t igen = 0, iloop = 0;
2486 printf(
"=== Lego plot sph. => nrays=%i\n", ntot);
2487 for (i = 1; i <= nphi; i++) {
2488 for (j = 1; j <= ntheta; j++) {
2491 if ((igen % n10) == 0)
2492 printf(
"%i percent\n",
Int_t(100 * igen / ntot));
2504 startnode =
nullptr;
2515 while (step < 1E10) {
2525 printf(
"%i steps\n", iloop);
2527 x += step / matprop;
2529 if (endnode ==
nullptr && step > 1E10)
2532 startnode = endnode;
2543 hist->
Fill(phi, theta,
x);
2571 printf(
"Random box : %f, %f, %f\n", dx, dy, dz);
2573 printf(
"Start... %i points\n", npoints);
2577 Int_t n10 = npoints / 10;
2579 while (igen < npoints) {
2580 xyz[0] = ox - dx + 2 * dx *
gRandom->Rndm();
2581 xyz[1] = oy - dy + 2 * dy *
gRandom->Rndm();
2582 xyz[2] = oz - dz + 2 * dz *
gRandom->Rndm();
2586 if ((igen % n10) == 0)
2587 printf(
"%i percent\n",
Int_t(100 * igen / npoints));
2600 if ((ic < 0) || (ic >= 128))
2608 pm->
AddAt(marker, ic);
2613 printf(
"Number of visible points : %i\n", i);
2616 printf(
"efficiency : %g\n", ratio);
2620 marker->
Draw(
"SAME");
2623 printf(
"---Daughters of %s made invisible.\n",
fGeoManager->GetTopVolume()->GetName());
2624 printf(
"---Make them visible with : gGeoManager->GetTopVolume()->VisibleDaughters();\n");
2652 printf(
"Start... %i rays\n", nrays);
2656 Int_t ipoint, inull;
2658 Int_t n10 = nrays / 10;
2659 Double_t theta, phi, step, normlen;
2669 while (itot < nrays) {
2674 if ((itot % n10) == 0)
2675 printf(
"%i percent\n",
Int_t(100 * itot / nrays));
2694 startnode =
nullptr;
2710 while ((endnode =
fGeoManager->FindNextBoundaryAndStep())) {
2732 line->SetPoint(ipoint, point[0], point[1], point[2]);
2733 if (!vis2 && check_norm) {
2737 normline->
SetPoint(0, point[0], point[1], point[2]);
2738 normline->
SetPoint(1, point[0] + normal[0] * normlen, point[1] + normal[1] * normlen,
2739 point[2] + normal[2] * normlen);
2749 line->SetPoint(ipoint++, point[0], point[1], point[2]);
2755 normline->
SetPoint(0, point[0], point[1], point[2]);
2756 normline->
SetPoint(1, point[0] + normal[0] * normlen, point[1] + normal[1] * normlen,
2757 point[2] + normal[2] * normlen);
2771 printf(
"number of segments : %i\n", i);
2817 while (index >= 0) {
2818 index = spath.
Index(
"/", index + 1);
2820 name = spath(0, index);
2821 if (strstr(g3path,
name.Data())) {
2829 if (strlen(common.
Data())) {
2847 for (
Int_t i = 0; i < npoints; i++) {
2848 xyz[0] = point[0] - eps[0] + 2 * eps[0] *
gRandom->Rndm();
2849 xyz[1] = point[1] - eps[1] + 2 * eps[1] *
gRandom->Rndm();
2850 xyz[2] = point[2] - eps[2] + 2 * eps[2] *
gRandom->Rndm();
2854 dist1 =
TMath::Sqrt((xyz[0] - point[0]) * (xyz[0] - point[0]) + (xyz[1] - point[1]) * (xyz[1] - point[1]) +
2855 (xyz[2] - point[2]) * (xyz[2] - point[2]));
2873 memcpy(&point[0], pointg, 3 *
sizeof(
Double_t));
2874 for (
Int_t i = 0; i < npoints; i++) {
2877 point[1] - eps[1] + 2 * eps[1] *
gRandom->Rndm(),
2878 point[2] - eps[2] + 2 * eps[2] *
gRandom->Rndm());
2881 if (node1 != node) {
2882 dist1 =
TMath::Sqrt((point[0] - pointg[0]) * (point[0] - pointg[0]) +
2883 (point[1] - pointg[1]) * (point[1] - pointg[1]) +
2884 (point[2] - pointg[2]) * (point[2] - pointg[2]));
2888 memcpy(&closest[0], pointg, 3 *
sizeof(
Double_t));
2897 fGeoManager->FindNode(point[0], point[1], point[2]);
2914 printf(
"empty input array\n");
2936 while (step < 1E10) {
2938 forward = dirx * (endpoint[0] - point[0]) + diry * (endpoint[1] - point[1]) + dirz * (endpoint[2] - point[2]);
2939 if (forward < 1E-3) {
2947 memcpy(temparray, array, 3 * dim *
sizeof(
Double_t));
2952 memcpy(&array[3 * nelem], point, 3 *
sizeof(
Double_t));
2956 if (endnode ==
nullptr && step > 1E10) {
2977 printf(
"%i steps\n", istep);
2980 memcpy(temparray, array, 3 * dim *
sizeof(
Double_t));
2985 memcpy(&array[3 * nelem], point, 3 *
sizeof(
Double_t));
3004 Bool_t recheck = !strcmp(option,
"RECHECK");
3006 printf(
"RECHECK\n");
3016 printf(
"Random box : %f, %f, %f\n", dx, dy, dz);
3019 for (i = 0; i < npoints; i++) {
3020 xyz[3 * i] = ox - dx + 2 * dx *
gRandom->Rndm();
3021 xyz[3 * i + 1] = oy - dy + 2 * dy *
gRandom->Rndm();
3022 xyz[3 * i + 2] = oz - dz + 2 * dz *
gRandom->Rndm();
3025 printf(
"Generation time :\n");
3029 printf(
"Start... %i points\n", npoints);
3031 for (i = 0; i < npoints; i++) {
3038 if (node1 != node) {
3039 printf(
"Difference for x=%g y=%g z=%g\n", xyz[3 * i], xyz[3 * i + 1], xyz[3 * i + 2]);
3040 printf(
" from top : %s\n", node->
GetName());
3058 printf(
"Checking overlaps for path :\n");
3064 Int_t npoints = 1000000;
3087 printf(
"Generating %i points inside %s\n", npoints,
fGeoManager->GetPath());
3088 while (i < npoints) {
3089 point[0] = ox - dx + 2 * dx *
gRandom->Rndm();
3090 point[1] = oy - dy + 2 * dy *
gRandom->Rndm();
3091 point[2] = oz - dz + 2 * dz *
gRandom->Rndm();
3115 ntpl->
Draw(
"z:y:x");
3122 printf(
"using FindNode...\n");
3123 for (
Int_t j = 0; j < npoints; j++) {
3130 markthis->
SetNextPoint(xyz[3 * j], xyz[3 * j + 1], xyz[3 * j + 2]);
3144 pm->
AddAt(marker, ic);
3147 marker->
SetNextPoint(xyz[3 * j], xyz[3 * j + 1], xyz[3 * j + 2]);
3149 if (overlaps->
IndexOf(node) < 0)
3150 overlaps->
Add(node);
3158 markthis->
Draw(
"SAME");
3163 printf(
"list of overlapping nodes :\n");
3167 printf(
"%s MANY\n", node->
GetName());
3169 printf(
"%s ONLY\n", node->
GetName());
3172 printf(
"No overlaps\n");
3190 memset(nin, 0, nmat *
sizeof(
Int_t));
3204 Double_t vbox = 0.000008 * dx * dy * dz;
3212 x = ox - dx + 2 * dx *
gRandom->Rndm();
3213 y = oy - dy + 2 * dy *
gRandom->Rndm();
3214 z = oz - dz + 2 * dz *
gRandom->Rndm();
3225 if ((iin % 100000) == 0 || igen > 1E8) {
3228 for (indmat = 0; indmat < nmat; indmat++) {
3234 weight += dens *
Double_t(nin[indmat]);
3235 sigma += dens * dens * nin[indmat];
3238 eps =
sigma / weight;
3241 if (eps < precision || igen > 1E8) {
3243 printf(
"=== Weight of %s : %g +/- %g [kg]\n",
fGeoManager->GetTopVolume()->GetName(), weight,
sigma);
3247 if (isverbose && eps < 0.5 * eps0) {
3248 printf(
"%8dK: %14.7g kg %g %%\n", igen / 1000, weight, eps * 100);
3274 for (
Int_t i = 0; i < npoints; i++) {
3275 point = xyz + 3 * i;
3283 for (
Int_t id = 0;
id < ncheck;
id++) {
3284 node = vol->
GetNode(checklist[
id]);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
char Char_t
Character 1 byte (char).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char).
externTGeoManager * gGeoManager
externTGeoIdentity * gGeoIdentity
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
virtual Color_t GetLineColor() const
Return the line color.
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
virtual void SetMarkerColor(Color_t mcolor=1)
Set the marker color.
virtual void SetMarkerStyle(Style_t mstyle=1)
Set the marker style.
virtual void SetMarkerSize(Size_t msize=1)
Set the marker size.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
Generic 3D primitive description class.
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.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
TDirectory::TContext keeps track and restore the current directory.
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
static bool MayIntersect(const TGeoBBox *boxA, const TGeoMatrix *mA, const TGeoBBox *boxB, const TGeoMatrix *mB)
Int_t FillMeshPoints(TBuffer3D &buff, const TGeoShape *shape, const TGeoShape *&lastShape, Int_t &cachedN, Int_t nMeshPoints, Double_t *&points) const
Int_t PropagateInGeom(Double_t *, Double_t *)
Propagate from START along DIR from boundary to boundary until exiting geometry.
Int_t fNchecks
! Number of checks for current volume
Bool_t * fFlags
! Array of flags per volume.
TStopwatch * fTimer
! Timer
void CheckShape(TGeoShape *shape, Int_t testNo, Int_t nsamples, Option_t *option) override
Test for shape navigation methods.
std::unordered_map< const TGeoShape *, MeshPointsEntry > fMeshPointsCache
! Internal map shape->mesh points
TGeoChecker()
Default constructor.
void OpProgress(const char *opname, Long64_t current, Long64_t size, TStopwatch *watch=nullptr, Bool_t last=kFALSE, Bool_t refresh=kFALSE, const char *msg="") override
Print current operation progress.
TGeoNode * SamplePoints(Int_t npoints, Double_t &dist, Double_t epsil, const char *g3path) override
shoot npoints randomly in a box of 1E-5 around current point.
void CheckPoint(Double_t x=0, Double_t y=0, Double_t z=0, Option_t *option="", Double_t safety=0.) override
Draw point (x,y,z) over the picture of the daughters of the volume containing this point.
Double_t Weight(Double_t precision=0.01, Option_t *option="v") override
Estimate weight of top level volume with a precision SIGMA(W)/W better than PRECISION.
void ShapeNormal(TGeoShape *shape, Int_t nsamples, Option_t *option)
Check of validity of the normal for a given shape.
MeshPolicyStamp fMeshPolicyStamp
! policy stamp for points cache invalidation
void CheckBoundaryReference(Int_t icheck=-1) override
Check the boundary errors reference file created by CheckBoundaryErrors method.
void MaterializeOverlap(const TGeoOverlapResult &r) override
Materialize a TGeoOverlapResult into a TGeoOverlap.
Double_t * fVal2
! Array of timing per volume.
const MeshPointsEntry & GetMeshPoints(const TGeoShape *s) const
Bool_t TestVoxels(TGeoVolume *vol, Int_t npoints=1000000) override
Returns optimal voxelization type for volume vol.
void CheckOverlapsBySampling(const TGeoVolume *vol, Double_t ovlp=0.1, Int_t npoints=1000000) const override
Check illegal overlaps for volume VOL within a limit OVLP by sampling npoints inside the volume shape...
void BuildMeshPointsCache(const std::vector< TGeoOverlapCandidate > &candidates) override
TGeoManager * fGeoManager
void ShapeDistances(TGeoShape *shape, Int_t nsamples, Option_t *option)
Test TGeoShape::DistFromInside/Outside.
Int_t NChecksPerVolume(TGeoVolume *vol)
Compute number of overlaps combinations to check per volume.
void ShapeSafety(TGeoShape *shape, Int_t nsamples, Option_t *option)
Check of validity of safe distance for a given shape.
TH2F * LegoPlot(Int_t ntheta=60, Double_t themin=0., Double_t themax=180., Int_t nphi=90, Double_t phimin=0., Double_t phimax=360., Double_t rmin=0., Double_t rmax=9999999, Option_t *option="") override
Generate a lego plot fot the top volume, according to option.
void CheckGeometry(Int_t nrays, Double_t startx, Double_t starty, Double_t startz) const override
Shoot nrays with random directions from starting point (startx, starty, startz) in the reference fram...
void Score(TGeoVolume *, Int_t, Double_t)
Score a hit for VOL.
Double_t * ShootRay(Double_t *start, Double_t dirx, Double_t diry, Double_t dirz, Double_t *array, Int_t &nelem, Int_t &dim, Double_t *enpoint=nullptr) const
Shoot one ray from start point with direction (dirx,diry,dirz).
void CleanPoints(Double_t *points, Int_t &numPoints) const
Clean-up the mesh of pcon/pgon from useless points.
bool PolicyChanged(const MeshPolicyStamp &a, const MeshPolicyStamp &b) const
void PrintOverlaps() const override
Print the current list of overlaps held by the manager class.
TGeoNode * fSelectedNode
! Selected node for overlap checking
void CheckGeometryFull(Bool_t checkoverlaps=kTRUE, Bool_t checkcrossings=kTRUE, Int_t nrays=10000, const Double_t *vertex=nullptr) override
Geometry checking.
void CheckBoundaryErrors(Int_t ntracks=1000000, Double_t radius=-1.) override
Check pushes and pulls needed to cross the next boundary with respect to the position given by FindNe...
~TGeoChecker() override
Destructor.
Bool_t ComputeOverlap(const TGeoOverlapCandidate &c, TGeoOverlapResult &out) const override
Compute overlap/extrusion for given candidate using mesh points of the shapes.
TGeoChecker::MeshPolicyStamp CurrentMeshPolicyStamp() const
Create a policy stamp for overlap checking.
void TestOverlaps(const char *path) override
Geometry overlap checker based on sampling.
void Test(Int_t npoints, Option_t *option) override
Check time of finding "Where am I" for n points.
std::shared_mutex fMeshCacheMutex
Int_t EnumerateOverlapCandidates(const TGeoVolume *vol, Double_t ovlp, Option_t *option, std::vector< TGeoOverlapCandidate > &out) override
Stage1: Enumerate all overlap candidates for volume VOL within a limit OVLP.
Double_t TimingPerVolume(TGeoVolume *)
Compute timing per "FindNextBoundary" + "Safety" call.
void RandomRays(Int_t nrays, Double_t startx, Double_t starty, Double_t startz, const char *target_vol=nullptr, Bool_t check_norm=kFALSE) override
Randomly shoot nrays from point (startx,starty,startz) and plot intersections with surfaces for curre...
Double_t * fVal1
! Array of number of crossings per volume.
void RandomPoints(TGeoVolume *vol, Int_t npoints, Option_t *option) override
Draw random points in the bounding box of a volume.
Double_t CheckVoxels(TGeoVolume *vol, TGeoVoxelFinder *voxels, Double_t *xyz, Int_t npoints)
count voxel timing
void PushCandidate(std::vector< TGeoOverlapCandidate > &out, const TString &name, TGeoVolume *vol1, TGeoVolume *vol2, const TGeoMatrix *mat1, const TGeoMatrix *mat2, Bool_t isovlp, Double_t ovlp) const
Helper to fill candidates list.
Matrix class used for computing global transformations Should NOT be used for node definition.
void Multiply(const TGeoMatrix *right)
multiply to the right with an other transformation if right is identity matrix, just return
void Reset(TGeoVolume *top=nullptr)
Resets the iterator for volume TOP.
const TGeoMatrix * GetCurrentMatrix() const
Returns global matrix for current node.
void SetTopName(const char *name)
Set the top name for path.
void GetPath(TString &path) const
Returns the path for the current node.
TGeoNode * GetNode(Int_t level) const
Returns current node at a given level.
void Skip()
Stop iterating the current branch.
The manager class for any TGeo geometry.
static void SetVerboseLevel(Int_t vl)
Return current verbosity level (static function).
static Int_t GetVerboseLevel()
Set verbosity level (static function).
Base class describing materials.
Int_t GetIndex()
Retrieve material index in the list of materials.
virtual Double_t GetRadLen() const
virtual Double_t GetDensity() const
Geometrical transformation package.
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix
virtual void LocalToMaster(const Double_t *local, Double_t *master) const
convert a point by multiplying its column vector (x, y, z, 1) to matrix inverse
TGeoMaterial * GetMaterial() const
Class providing navigation API for TGeo geometries.
TGeoNodeCache * GetCache() const
TGeoStateInfo * GetInfo()
Get next state info pointer.
void ReleaseInfo()
Release last used state info pointer.
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Bool_t IsOverlapping() const
Bool_t IsOnScreen() const
check if this node is drawn. Assumes that this node is current
TGeoVolume * GetVolume() const
void SetOverlaps(Int_t *ovlp, Int_t novlp)
set the list of overlaps for this node (ovlp must be created with operator new)
virtual TGeoMatrix * GetMatrix() const =0
Int_t * GetOverlaps(Int_t &novlp) const
virtual void MasterToLocal(const Double_t *master, Double_t *local) const
Convert the point coordinates from mother reference to local reference system.
void InspectNode() const
Inspect this node.
Base class describing geometry overlaps.
TPolyMarker3D * GetPolyMarker() const
void SetNextPoint(Double_t x, Double_t y, Double_t z)
Set next overlapping point.
void SetOverlap(Double_t ovlp)
virtual void PrintInfo() const
Print some info.
Double_t GetOverlap() const
Base abstract class for all shapes.
virtual 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 =0
virtual void GetMeshNumbers(Int_t &, Int_t &, Int_t &) const
virtual Bool_t GetPointsOnSegments(Int_t npoints, Double_t *array) const =0
void Draw(Option_t *option="") override
Draw this shape.
virtual Double_t Safety(const Double_t *point, Bool_t in=kTRUE) const =0
virtual void ComputeNormal(const Double_t *point, const Double_t *dir, Double_t *norm) const =0
virtual 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 =0
const char * GetName() const override
Get the shape name.
virtual Double_t Capacity() const =0
virtual Bool_t Contains(const Double_t *point) const =0
static Double_t Tolerance()
virtual void SetPoints(Double_t *points) const =0
Class describing translations.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
void SetVisibility(Bool_t vis=kTRUE) override
set visibility of this volume
TGeoMedium * GetMedium() const
Bool_t Contains(const Double_t *point) const
virtual TGeoNode * AddNode(TGeoVolume *vol, Int_t copy_no, TGeoMatrix *mat=nullptr, Option_t *option="")
Add a TGeoNode to the list of nodes.
void Draw(Option_t *option="") override
draw top volume according to option
TGeoMaterial * GetMaterial() const
Int_t GetNdaughters() const
void VisibleDaughters(Bool_t vis=kTRUE)
set visibility for daughters
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
TGeoPatternFinder * GetFinder() const
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
void SetLineColor(Color_t lcolor) override
Set the line color.
TGeoShape * GetShape() const
virtual Int_t GetCurrentNodeIndex() const
virtual void DrawOnly(Option_t *option="")
draw only this volume
void SetLineStyle(Style_t lstyle) override
Set the line style.
virtual Bool_t IsAssembly() const
Returns true if the volume is an assembly or a scaled assembly.
virtual Bool_t IsVisible() const
void InspectShape() const
Finder class handling voxels.
virtual Int_t * GetCheckList(const Double_t *point, Int_t &nelem, TGeoStateInfo &td)
get the list of daughter indices for which point is inside their bbox
virtual void FindOverlaps(Int_t inode) const
create the list of nodes for which the bboxes overlap with inode's bbox
1-D histogram with a double per channel (see TH1 documentation)
1-D histogram with a float per channel (see TH1 documentation)
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
void Draw(Option_t *option="") override
Draw this histogram with options.
virtual void SetStats(Bool_t stats=kTRUE)
Set statistics option on/off.
2-D histogram with a float per channel (see TH1 documentation)
Int_t Fill(Double_t) override
Invalid Fill method.
TObject * At(Int_t idx) const override
Returns the object at position idx. Returns 0 if idx is out of range.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
A simple TTree restricted to a list of float variables only.
Int_t Fill() override
Fill a Ntuple with current values in fArgs.
Int_t GetEntriesFast() const
Int_t IndexOf(const TObject *obj) const override
void AddAt(TObject *obj, Int_t idx) override
Add object at position ids.
TObject * At(Int_t idx) const override
void Add(TObject *obj) override
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.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual void SetPoint(Int_t point, Double_t x, Double_t y, Double_t z)
virtual Int_t GetN() const
virtual Int_t SetNextPoint(Double_t x, Double_t y, Double_t z)
Set point following LastPoint to x, y, z.
void Draw(Option_t *option="") override
Draws 3-D polymarker with its current attributes.
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
void Continue()
Resume a stopped stopwatch.
void Stop()
Stop the stopwatch.
void Print(Option_t *option="") const override
Print the real and cpu time passed between the start and stop events.
void ToLower()
Change string to lower-case.
const char * Data() const
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
A TTree represents a columnar dataset.
virtual Int_t Fill()
Fill all branches.
virtual Int_t SetBranchAddress(const char *bname, void *add, TBranch **ptr, TClass *realClass, EDataType datatype, bool isptr, bool suppressMissingBranchError)
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
void Draw(Option_t *opt) override
Default Draw method for all objects.
virtual Long64_t GetEntries() const
TBranch * Branch(const char *name, T *obj, Int_t bufsize=32000, Int_t splitlevel=99)
Add a new branch, and infer the data type from the type of obj being passed.
Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0) override
Write this object to the current directory.
TVirtualGeoChecker()
Geometry checker default constructor.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Double_t Log(Double_t x)
Returns the natural logarithm of x.
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.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
constexpr Double_t TwoPi()
Simple internal structure keeping a cache of mesh points per shape.
Int_t fNPoints
number of 3D points
std::vector< Double_t > fPoints
points components (size = 3*fNPoints)
Policy stamp: when this changes, cached point values may be wrong -> clear.
TGeoVolume * fVol1
first volume
std::vector< std::array< Double_t, 3 > > fPoints
up to N points (e.g. 100)
TGeoHMatrix fMat2
matrix for first volume
TString fName
display name
TGeoVolume * fVol2
second volume
Bool_t fIsOverlap
matrix for second volume
Double_t fMaxOverlap
overlap distance found
Statefull info for the current geometry level.