190 fGeoManager(nullptr),
197 fSelectedNode(nullptr),
214 fSelectedNode(nullptr),
243 const char symbol[4] = {
'=',
'\\',
'|',
'/'};
244 char progress[11] =
" ";
271 time =
owatch->RealTime();
273 time -= 3600 *
hours;
276 seconds = (
Int_t)time;
298 for (i = 0; i <
nchar; i++)
301 for (i =
nchar + 1; i < 10; i++)
308 else if (
size < 100000)
340 Info(
"CheckBoundaryErrors",
"Top volume is %s",
tvol->GetName());
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];
371 TH1F *
hnew =
new TH1F(
"hnew",
"Precision pushing", 30, -20., 10.);
372 TH1F *
hold =
new TH1F(
"hold",
"Precision pulling", 30, -20., 10.);
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) {
413 for (
Int_t i = 0; i < 30; ++i) {
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],
435 for (
Int_t i = 0; i < 30; ++i) {
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],
477 new TCanvas(
"c3",
"Plot", 600, 600);
498 bug->SetBranchAddress(
"pos", xyz);
499 bug->SetBranchAddress(
"dir", dir);
500 bug->SetBranchAddress(
"push", &push);
501 bug->SetBranchAddress(
"path", &path);
502 bug->SetBranchAddress(
"cdir", &
cdir);
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],
526 nxyz[
j] = xyz[
j] + step * (1. + 0.1 * push) * dir[
j];
540 pm->SetMarkerStyle(2);
541 pm->SetMarkerSize(0.2);
546 nxyz[
j] = xyz[
j] + step * dir[
j];
549 pm1->SetMarkerStyle(2);
550 pm1->SetMarkerSize(0.2);
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");
625 printf(
"====================================================================\n");
626 printf(
"STAGE 3: Propagating %i tracks starting from vertex\n and counting number of boundary crossings...\n",
628 printf(
"====================================================================\n");
638 for (i = 0; i < ntracks; i++) {
650 printf(
"No boundary crossed\n");
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");
679 while ((current = next())) {
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++) {
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);
722 h2->SetMarkerStyle(2);
723 TH1F *
h1 =
new TH1F(
"h1",
"percent of time spent per volume", 3, 0, 3);
727 for (i = 0; i <
nuid; i++) {
740 c3->SetTopMargin(0.15);
767 printf(
"Error in trying to cross boundary of %s\n", current->
GetName());
826 for (
Int_t i = 0; i < 1000000; i++) {
864 printf(
"Time for volume %s (shape=%s): %g [ms] ndaughters=%d ncross=%d\n", vol->
GetName(),
889 pm->SetMarkerColor(2);
890 pm->SetMarkerStyle(8);
891 pm->SetMarkerSize(0.4);
894 pm->SetMarkerColor(4);
895 pm->SetMarkerStyle(8);
896 pm->SetMarkerSize(0.4);
899 pm->SetMarkerColor(6);
900 pm->SetMarkerStyle(8);
901 pm->SetMarkerSize(0.4);
914 for (i = 0; i <
nrays; i++) {
936 printf(
"#### NOTHING BACK ###########################\n");
945 for (
j = 0;
j < k;
j++) {
959 dw =
dx * dir[0] +
dy * dir[1] +
dz * dir[2];
997 dw =
dx * dir[0] +
dy * dir[1] +
dz * dir[2];
1031 printf(
"### BOUNDARY MISSED BACK #########################\n");
1065 for (
Int_t i = 0; i < numPoints; i++) {
1092 if (
vol1->IsAssembly() ||
vol2->IsAssembly())
1103 if (m1.fNPoints <= 0 || m2.fNPoints <= 0)
1118 if (out.fPoints.size() < 100)
1119 out.fPoints.push_back({{
p[0],
p[1],
p[2]}});
1131 out.fMaxOverlap = 0.0;
1142 if (!
c.fIsOverlap) {
1164 if (
safety > out.fMaxOverlap)
1194 if (
safety > out.fMaxOverlap)
1227 if (
safety > out.fMaxOverlap)
1252 if (
safety > out.fMaxOverlap)
1307 Error(
"CheckOverlapsBySampling",
"No point inside volume!!! - aborting");
1318 for (
id = 0;
id <
ncheck;
id++) {
1357 cindex =
node1->GetVolume()->GetCurrentNodeIndex();
1362 cindex =
node2->GetVolume()->GetCurrentNodeIndex();
1367 cindex =
node2->GetVolume()->GetCurrentNodeIndex();
1376 if (
nodeovlp->GetPolyMarker()->GetN() < 100)
1382 nav->GetCache()->ReleaseInfo();
1390 Info(
"CheckOverlapsBySampling",
"#Found %d overlaps adding-up to %g +/- %g [cm3] for daughters of %s",
novlps,
1391 capacity, err * capacity, vol->
GetName());
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++) {
1459 if (
node01->IsOverlapping())
1461 vox->FindOverlaps(
id);
1470 if (
node02->IsOverlapping())
1474 if (
node01->GetVolume()->IsAssembly()) {
1476 while ((node =
next1())) {
1478 if (
node02->GetVolume()->IsAssembly()) {
1481 if (!
node1->GetVolume()->IsAssembly()) {
1494 if (
node02->GetVolume()->IsAssembly()) {
1497 if (!
node1->GetVolume()->IsAssembly()) {
1508 node01->SetOverlaps(
nullptr, 0);
1525 ::Error(
"TGeoChecker::GetMeshPoints",
1526 "Mesh cache miss for shape %s. BuildMeshPointsCache did not cover all candidates.", shape->
ClassName());
1635 std::vector<TGeoOverlapCandidate> &out)
1661 while ((node =
next1())) {
1674 level =
next1.GetLevel();
1686 next1.GetPath(path);
1706 Warning(
"EnumerateOverlapCandidates",
"Volume %s with %i daughters but not voxelized", vol->
GetName(), nd);
1725 for (
id = 0;
id < nd;
id++) {
1727 if (
node01->IsOverlapping())
1731 path =
node01->GetName();
1733 for (
io =
id + 1;
io < nd;
io++) {
1736 if (
node02->IsOverlapping())
1750 if (
node01->GetVolume()->IsAssembly()) {
1755 while ((node =
next1())) {
1770 next1.GetPath(path);
1772 if (
node02->GetVolume()->IsAssembly()) {
1785 if (!
node1->GetVolume()->IsAssembly()) {
1795 level =
next2.GetLevel();
1803 level =
next1.GetLevel();
1840 level =
next1.GetLevel();
1866 if (
node02->GetVolume()->IsAssembly()) {
1880 if (!
node1->GetVolume()->IsAssembly()) {
1889 level =
next2.GetLevel();
1948 out.emplace_back(std::move(
c));
1985 printf(
"=== Check current point : (%g, %g, %g) ===\n", point[0], point[1], point[2]);
1992 printf(
"Safety radius : %f\n", close);
1995 sph->SetLineColor(2);
1996 sph->SetLineStyle(3);
2001 pm->SetMarkerColor(2);
2002 pm->SetMarkerStyle(8);
2003 pm->SetMarkerSize(0.5);
2034 default:
Error(
"CheckShape",
"Test number %d not existent",
testNo);
2064 TH1D *hist =
new TH1D(
"hTest1",
"Residual distance from inside/outside", 200, -20, 0);
2099 printf(
"DistFromInside: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) %f/%f(max)\n", point[0],
2100 point[1], point[2], dir[0], dir[1], dir[2],
d1,
dmove);
2105 pmfrominside->SetNextPoint(point[0], point[1], point[2]);
2106 for (
j = 0;
j < 3;
j++)
2115 for (
j = 0;
j < 3;
j++)
2121 for (
j = 0;
j < 3;
j++) {
2132 printf(
"Error: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) d1=%f d2=%f dmove=%f\n", point[0],
2133 point[1], point[2], dir[0], dir[1], dir[2],
d1,
d2,
dmove);
2135 printf(
" (*)DistFromOutside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) dnext = %f\n",
2140 printf(
" DistFromOutside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) dnext = %f\n",
2141 point[0] +
d1 * dir[0], point[1] +
d1 * dir[1], point[2] +
d1 * dir[2], dir[0], dir[1], dir[2],
2144 printf(
" DistFromOutside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) = %f\n",
pnew[0],
pnew[1],
2150 pmfrominside->SetNextPoint(point[0], point[1], point[2]);
2151 for (
j = 0;
j < 3;
j++)
2152 point[
j] +=
d1 * dir[
j];
2153 pmfrominside->SetNextPoint(point[0], point[1], point[2]);
2161 for (
j = 0;
j < 3;
j++)
2169 for (
j = 0;
j < 3;
j++)
2175 printf(
"Error DistFromInside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) d1=%f d1p=%f\n",
pnew[0],
2181 pmfrominside->SetNextPoint(point[0], point[1], point[2]);
2182 for (
j = 0;
j < 3;
j++)
2183 point[
j] +=
d1 * dir[
j];
2184 pmfrominside->SetNextPoint(point[0], point[1], point[2]);
2192 for (
j = 0;
j < 3;
j++)
2206 new TCanvas(
"Test01",
"Residuals DistFromInside/Outside", 800, 600);
2259 printf(
"Error safety (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) safe=%f dist=%f\n", point[0],
2260 point[1], point[2], dir[0], dir[1], dir[2],
safe, dist);
2264 pm1->SetMarkerStyle(24);
2265 pm1->SetMarkerSize(0.4);
2267 pm1->SetNextPoint(point[0], point[1], point[2]);
2268 pm1->SetNextPoint(point[0] +
safe * dir[0], point[1] +
safe * dir[1], point[2] +
safe * dir[2]);
2271 pm2->SetMarkerStyle(7);
2272 pm2->SetMarkerSize(0.3);
2274 pm2->SetNextPoint(point[0] + dist * dir[0], point[1] + dist * dir[1], point[2] + dist * dir[2]);
2328 pm2->SetMarkerSize(0.2);
2357 printf(
"Error point outside (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) =%g olddist=%g\n",
2358 point[0], point[1], point[2], dir[0], dir[1], dir[2], dist,
olddist);
2359 printf(
" old point: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f)\n",
oldpoint[0],
2366 pm1->SetMarkerStyle(24);
2367 pm1->SetMarkerSize(0.4);
2370 pm1->SetNextPoint(point[0], point[1], point[2]);
2378 printf(
"Error DistFromInside(%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f) =%g olddist=%g\n",
2379 point[0], point[1], point[2], dir[0], dir[1], dir[2], dist,
olddist);
2381 printf(
" old point: (%19.15f, %19.15f, %19.15f, %19.15f, %19.15f, %19.15f)\n",
oldpoint[0],
2389 pm1->SetMarkerStyle(24);
2390 pm1->SetMarkerSize(0.4);
2393 pm1->SetNextPoint(point[0], point[1], point[2]);
2403 point[
j] += dist * dir[
j];
2408 printf(
"Error safety (%19.15f, %19.15f, %19.15f) safe=%g\n", point[0], point[1], point[2],
safe);
2414 pm1->SetMarkerStyle(24);
2415 pm1->SetMarkerSize(0.4);
2418 pm1->SetNextPoint(point[0], point[1], point[2]);
2435 if ((
itot % 10) == 0)
2436 pm2->SetNextPoint(point[0], point[1], point[2]);
2470 printf(
"=== Lego plot sph. => nrays=%i\n",
ntot);
2471 for (i = 1; i <=
nphi; i++) {
2481 start[0] = start[1] = start[2] = 1E-3;
2499 while (step < 1
E10) {
2527 hist->
Fill(phi, theta,
x);
2584 if ((
ic < 0) || (
ic >= 128))
2592 pm->AddAt(marker,
ic);
2597 printf(
"Number of visible points : %i\n", i);
2600 printf(
"efficiency : %g\n", ratio);
2604 marker->
Draw(
"SAME");
2608 printf(
"---Make them visible with : gGeoManager->GetTopVolume()->VisibleDaughters();\n");
2690 line->SetPoint(
ipoint++, start[0], start[1], start[2]);
2712 }
else if (
endnode->IsOnScreen())
2716 line->SetPoint(
ipoint, point[0], point[1], point[2]);
2721 normline->SetPoint(0, point[0], point[1], point[2]);
2733 line->SetPoint(
ipoint++, point[0], point[1], point[2]);
2739 normline->SetPoint(0, point[0], point[1], point[2]);
2750 for (
Int_t m = 0;
m <
pm->GetEntriesFast();
m++) {
2755 printf(
"number of segments : %i\n", i);
2801 while (
index >= 0) {
2832 xyz[0] = point[0] - eps[0] + 2 * eps[0] *
gRandom->
Rndm();
2833 xyz[1] = point[1] - eps[1] + 2 * eps[1] *
gRandom->
Rndm();
2834 xyz[2] = point[2] - eps[2] + 2 * eps[2] *
gRandom->
Rndm();
2838 dist1 =
TMath::Sqrt((xyz[0] - point[0]) * (xyz[0] - point[0]) + (xyz[1] - point[1]) * (xyz[1] - point[1]) +
2839 (xyz[2] - point[2]) * (xyz[2] - point[2]));
2862 point[2] - eps[2] + 2 * eps[2] *
gRandom->
Rndm());
2865 if (
node1 != node) {
2898 printf(
"empty input array\n");
2920 while (step < 1
E10) {
2923 if (forward < 1E-3) {
3003 for (i = 0; i <
npoints; i++) {
3009 printf(
"Generation time :\n");
3015 for (i = 0; i <
npoints; i++) {
3022 if (
node1 != node) {
3023 printf(
"Difference for x=%g y=%g z=%g\n", xyz[3 * i], xyz[3 * i + 1], xyz[3 * i + 2]);
3042 printf(
"Checking overlaps for path :\n");
3099 ntpl->Draw(
"z:y:x");
3106 printf(
"using FindNode...\n");
3113 if (
cpath.Contains(path)) {
3114 markthis->SetNextPoint(xyz[3 *
j], xyz[3 *
j + 1], xyz[3 *
j + 2]);
3128 pm->AddAt(marker,
ic);
3133 if (overlaps->
IndexOf(node) < 0)
3134 overlaps->
Add(node);
3147 printf(
"list of overlapping nodes :\n");
3209 if ((
iin % 100000) == 0 ||
igen > 1
E8) {
3222 eps =
sigma / weight;
3232 printf(
"%8dK: %14.7g kg %g %%\n",
igen / 1000, weight, eps * 100);
3259 point = xyz + 3 * i;
3275 nav->GetCache()->ReleaseInfo();
3276 time =
timer.CpuTime();
std::ios_base::fmtflags fFlags
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Boolean (0=false, 1=true) (bool)
int Int_t
Signed integer 4 bytes (int)
char Char_t
Character 1 byte (char)
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
double Double_t
Double 8 bytes.
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 void char Point_t Rectangle_t WindowAttributes_t index
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 value
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 Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t nchar
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
Option_t Option_t TPoint TPoint percent
R__EXTERN TGeoManager * gGeoManager
R__EXTERN TGeoIdentity * gGeoIdentity
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TStyle * gStyle
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
virtual Color_t GetLineColor() const
Return the line color.
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 Double_t GetBinCenter(Int_t bin) const
Return center of bin.
Generic 3D primitive description class.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
static bool MayIntersect(const TGeoBBox *boxA, const TGeoMatrix *mA, const TGeoBBox *boxB, const TGeoMatrix *mB)
Fast "may-intersect" test for two placed TGeoBBox objects.
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
Selected node for overlap checking.
Bool_t * fFlags
Array of timing per volume.
TStopwatch * fTimer
Array of flags per volume.
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
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
Internal map shape->mesh points.
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 number of crossings 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
policy stamp for points cache invalidation
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
Timer.
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
Number of checks for current volume.
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...
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 GetPath(TString &path) const
Returns the path for the current node.
The manager class for any TGeo geometry.
TGeoNode * GetMother(Int_t up=1) const
Double_t * FindNormalFast()
Computes fast normal to next crossed boundary, assuming that the current point is close enough to the...
TObjArray * GetListOfUVolumes() const
TObjArray * GetListOfOverlaps()
void CdUp()
Go one level up in geometry.
virtual Bool_t cd(const char *path="")
Browse the tree of nodes starting from fTopNode according to pathname.
void LocalToMaster(const Double_t *local, Double_t *master) const
void RestoreMasterVolume()
Restore the master volume of the geometry.
TGeoNode * FindNextDaughterBoundary(Double_t *point, Double_t *dir, Int_t &idaughter, Bool_t compmatrix=kFALSE)
Computes as fStep the distance to next daughter of the current volume.
TGeoNavigator * GetCurrentNavigator() const
Returns current navigator for the calling thread.
TGeoVolume * GetMasterVolume() const
TGeoNode * GetCurrentNode() const
void SetCurrentDirection(Double_t *dir)
void SetVisLevel(Int_t level=3)
set default level down to which visualization is performed
TGeoNode * FindNextBoundary(Double_t stepmax=TGeoShape::Big(), const char *path="", Bool_t frombdr=kFALSE)
Find distance to next boundary and store it in fStep.
TGeoNode * Step(Bool_t is_geom=kTRUE, Bool_t cross=kTRUE)
Make a rectilinear step of length fStep from current point (fPoint) on current direction (fDirection)...
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
TGeoNode * FindNextBoundaryAndStep(Double_t stepmax=TGeoShape::Big(), Bool_t compsafe=kFALSE)
Compute distance to next boundary within STEPMAX.
void SetCurrentPoint(Double_t *point)
Double_t * FindNormal(Bool_t forward=kTRUE)
Computes normal vector to the next surface that will be or was already crossed when propagating on a ...
TGeoNode * FindNode(Bool_t safe_start=kTRUE)
Returns deepest node containing current point.
const Double_t * GetCurrentPoint() const
TGeoVolume * MakeSphere(const char *name, TGeoMedium *medium, Double_t rmin, Double_t rmax, Double_t themin=0, Double_t themax=180, Double_t phimin=0, Double_t phimax=360)
Make in one step a volume pointing to a sphere shape with given medium.
TGeoNode * InitTrack(const Double_t *point, const Double_t *dir)
Initialize current point and current direction vector (normalized) in MARS.
TGeoHMatrix * GetCurrentMatrix() const
TGeoNode * GetTopNode() const
Bool_t IsSameLocation(Double_t x, Double_t y, Double_t z, Bool_t change=kFALSE)
Checks if point (x,y,z) is still in the current node.
const char * GetPath() const
Get path to the current node in the form /node0/node1/...
Int_t AddOverlap(const TNamed *ovlp)
Add an illegal overlap/extrusion to the list.
static void SetVerboseLevel(Int_t vl)
Return current verbosity level (static function).
void SetStep(Double_t step)
TGeoVolume * GetCurrentVolume() const
static Int_t GetVerboseLevel()
Set verbosity level (static function).
void CdTop()
Make top level node the current node.
Double_t Safety(Bool_t inside=kFALSE)
Compute safe distance from the current point.
void MasterToLocal(const Double_t *master, Double_t *local) const
void ResetState()
Reset current state flags.
void CdDown(Int_t index)
Make a daughter of current node current.
TList * GetListOfMaterials() const
Int_t GetNsegments() const
Get number of segments approximating circles.
TGeoVolume * GetTopVolume() const
void SetTopVisible(Bool_t vis=kTRUE)
make top volume visible on screen
void CheckOverlaps(Double_t ovlp=0.1, Option_t *option="")
Check all geometry for illegal overlaps within a limit OVLP.
Bool_t IsEntering() const
Base class describing materials.
Geometrical transformation package.
virtual void LocalToMasterVect(const Double_t *local, Double_t *master) const
convert a vector by multiplying its column vector (x, y, z, 1) to matrix inverse
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.
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
virtual TGeoMatrix * GetMatrix() const =0
void InspectNode() const
Inspect this node.
Base class describing geometry overlaps.
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
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
Int_t GetIndex(const TGeoNode *node) const
get index number for a given daughter
TGeoPatternFinder * GetFinder() const
TGeoVoxelFinder * GetVoxels() const
Getter for optimization structure.
TGeoShape * GetShape() const
virtual void DrawOnly(Option_t *option="")
draw only this volume
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.
1-D histogram with a double per channel (see TH1 documentation)
1-D histogram with a float per channel (see TH1 documentation)
virtual void LabelsOption(Option_t *option="h", Option_t *axis="X")
Sort bins with labels or set option(s) to draw axis with labels.
static void AddDirectory(Bool_t add=kTRUE)
Sets the flag controlling the automatic add of histograms in memory.
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 UInt_t SetCanExtend(UInt_t extendBitMask)
Make the histogram axes extendable / not extendable according to the bit mask returns the previous bi...
virtual void LabelsDeflate(Option_t *axis="X")
Reduce the number of bins for the axis passed in the option to the number of bins having a label.
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.
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 GetEntriesFast() const
Int_t IndexOf(const TObject *obj) const override
Int_t GetEntries() const override
Return the number of objects in array (i.e.
TObject * At(Int_t idx) const override
TObject * RemoveAt(Int_t idx) override
Remove object at index idx.
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 Draw(Option_t *option="")
Default Draw method for all objects.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
A 3-dimensional polyline.
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 Rndm() override
Machine independent random number generator.
virtual Double_t Uniform(Double_t x1=1)
Returns a uniform deviate on the interval (0, x1).
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 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
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
void SetOptStat(Int_t stat=1)
The type of information printed in the histogram statistics box can be selected via the parameter mod...
A TTree represents a columnar dataset.
Abstract class for geometry checkers.
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.
Policy stamp: when this changes, cached point values may be wrong -> clear.
TString fName
display name
Statefull info for the current geometry level.