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