13 Check if the Belle II geometry has some overlaps.
16 import b2test_utils
as b2tu
21 with b2tu.clean_working_directory():
23 overlap_checker = b2.find_file(
'geometry/examples/check_geometry.py')
25 output = subprocess.check_output([
'basf2', overlap_checker,
'100'], encoding=
'utf-8')
26 except subprocess.CalledProcessError
as error:
29 good_string =
'Checking overlaps for volume'
30 error_string =
'[ERROR] Overlap'
32 if error_string
in output:
33 errors = [e
for e
in output.splitlines()
if not e.startswith(good_string)]
34 print(
'\n'.join(errors))
35 b2.B2FATAL(
'There are overlaps in the geometry. '
36 f
'Please run the script {overlap_checker} and fix them.')