Inconsistency in overlap checking

I found an inconsistency running the /geometry/test/run command either in my main program or in the interactive session.
Namely, if I run my application in visual mode and I execute that command, all the overlap checks return OK, meaning that there are no overlaps. However, if I add the following line to my main() function, before the interactive session is started, then an overlap appears.

G4UImanager* UI = G4UImanager::GetUIpointer();

I have also tried to simply set the corresponding parameter of the G4PVPlacement function to true and, in that case, no overlap is issued.

It seems a bug to me, is it a known behaviour?

I’m using the following software:

_Geant4 Version: v11.1.1
_Operating System: MacOS Ventura 13.3.1
_Compiler/Version: command line tools MacOSX13.3
_CMake Version: 3.22.1

How large is the reported overlap?

The overlap check in Geant4 is based on the Monte-Carlo method - random points are generated on the surface of a volume and then it is checked that the points are not located inside other volumes.

The fact that the overlap is not reported every time can be explained by different sequences of random points. If the overlap is very small, then it may happen that no points will be generated in this region. Try to invoke /geometry/test/run several times and see what happens.

I have tried to invoke /geometry/test/run 3 times in a row (in the same program) and the first an overlap of 268.195 um is reported, the second time no overlap is reported and the third time the overlap is 371.319 um.
If I run it again, I obtain the same: 268.195 um, no overlap and 371.319 um (even if I change the seed).

It looks that it’s a real overlap around 0.4 mm. If you increase the number of random points, for example:

/geometry/test/resolution 1000000

then the overlap should be reported every time

Thanks! I tried to increase the precision and the overlap appears in all cases, as you predicted. It’s useful to know that for complex geometries one should increase the precision to be sure, thanks for the suggestion!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.