FairShip
Loading...
Searching...
No Matches
check_overlaps.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# SPDX-License-Identifier: LGPL-3.0-or-later
3# SPDX-FileCopyrightText: Copyright CERN for the benefit of the SHiP Collaboration
4
5"""Standalone script to check for overlaps quickly."""
6
7import argparse
8
9import ROOT
10
11
12def main() -> None:
13 """Check for overlaps quickly."""
14 parser = argparse.ArgumentParser(description=__doc__)
15 parser.add_argument(
16 "-g",
17 "--geofile",
18 help="""Geometry file to use."""
19 """Supports retrieving files from EOS via the XRootD protocol.""",
20 required=True,
21 )
22 args = parser.parse_args()
23 with ROOT.TFile.Open(args.geofile) as geofile:
24 geo_manager = geofile.Get("FAIRGeom")
25 geo_manager.SetNmeshPoints(10000)
26 geo_manager.CheckOverlaps(0.1) # 1 micron takes 5minutes
27 geo_manager.PrintOverlaps()
28 # check subsystems in more detail
29 for node in geo_manager.GetTopNode().GetNodes():
30 node.CheckOverlaps(0.0001)
31 geo_manager.PrintOverlaps()
32
33
34if __name__ == "__main__":
35 main()