Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-16 09:02:54

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 from acts.examples import JsonFormat
0010 
0011 import epic
0012 from material_mapping import runMaterialMapping
0013 
0014 if "__main__" == __name__:
0015 
0016     p = argparse.ArgumentParser(
0017         description="Script to generate material map for ePIC geometry"
0018     )
0019     p.add_argument(
0020         "--xmlFile",
0021         default=os.environ.get("DETECTOR_PATH", "")+"epic_craterlake.xml",
0022         help="input xml file containing ePIC geometry",
0023     )
0024     p.add_argument(
0025         "--geoFile",
0026         type=str,
0027         default="geometry-map.json",
0028         help="input json file to define volumes and layers used in material mapping",
0029     )
0030     p.add_argument(
0031         "--matFile",
0032         type=str,
0033         default="material-map.json",
0034         help="output filename for the generated material map, can be json and cbor formats",
0035     )
0036     args = p.parse_args()
0037 
0038     mapName = args.matFile.split('.')[0]
0039 
0040     detector, trackingGeometry, decorators = epic.getDetector(
0041         args.xmlFile, args.geoFile)
0042 
0043     runMaterialMapping(
0044         trackingGeometry,
0045         decorators,
0046         outputDir = os.getcwd(),
0047         inputDir  = os.getcwd(),
0048         readCachedSurfaceInformation=False,
0049         mapVolume= False,
0050         mapName  = mapName,
0051     ).run()