Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:07:50

0001 #!/usr/bin/env python3
0002 # SPDX-License-Identifier: LGPL-3.0-or-later
0003 # Copyright (C) 2024 Shujie Li
0004 
0005 import os
0006 import argparse
0007 
0008 import acts
0009 
0010 import epic
0011 from geometry import runGeometry
0012 
0013 if "__main__" == __name__:
0014     p = argparse.ArgumentParser(
0015         description="Script to generate geometry-map.json for ePIC geometry"
0016     )
0017     p.add_argument(
0018         "-i",
0019         "--xmlFile",
0020         default=(
0021             os.environ.get("DETECTOR_PATH", "")
0022             + "/"
0023             + os.environ.get("DETECTOR_CONFIG", "")
0024             + ".xml"
0025         ),
0026         help="Input xml file containing ePIC geometry",
0027     )
0028     args = p.parse_args()
0029 
0030     detector = epic.getDetector(args.xmlFile)
0031     trackingGeometry = detector.trackingGeometry()
0032     decorators = detector.contextDecorators()
0033 
0034     runGeometry(
0035         trackingGeometry,
0036         decorators,
0037         outputDir=os.getcwd(),
0038         outputObj=False,
0039         outputCsv=False,
0040         outputJson=True,
0041     )