File indexing completed on 2025-01-18 10:18:32
0001
0002
0003
0004
0005 import argparse
0006 from pathlib import Path
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 import acts
0024 import acts.examples.dd4hep
0025
0026 from acts import (
0027 Vector4,
0028
0029
0030
0031
0032
0033
0034 MaterialMapJsonConverter
0035 )
0036
0037 import json
0038
0039 def buildePICGeometry(
0040 xmlFile,
0041 jsonFile="",
0042 logLevel=acts.logging.WARNING,
0043 ):
0044 customLogLevel = acts.examples.defaultLogging(logLevel=logLevel)
0045 logger = acts.logging.getLogger("BuildePICGeometry")
0046
0047 matDeco = None
0048 if len(jsonFile)>0:
0049 file = Path(jsonFile)
0050 logger.info("Adding material from %s", file.absolute())
0051 matDeco = acts.IMaterialDecorator.fromFile(
0052 file,
0053 level=customLogLevel(maxLevel=acts.logging.INFO),
0054 )
0055
0056 dd4hepConfig = acts.examples.dd4hep.DD4hepGeometryService.Config(
0057 xmlFileNames=[xmlFile],
0058 logLevel=logLevel,
0059 dd4hepLogLevel=customLogLevel(),
0060 )
0061 detector = acts.examples.dd4hep.DD4hepDetector()
0062
0063 config = acts.MaterialMapJsonConverter.Config()
0064
0065 trackingGeometry, deco = detector.finalize(dd4hepConfig, matDeco)
0066
0067 return detector, trackingGeometry, deco