File indexing completed on 2025-01-18 09:12:08
0001
0002 from pathlib import Path
0003
0004 import acts
0005 from acts.examples import (
0006 readDigiConfigFromJson,
0007 DigitizationConfigurator,
0008 writeDigiConfigToJson,
0009 GenericDetector,
0010 DigiConfigContainer,
0011 )
0012
0013
0014 u = acts.UnitConstants
0015
0016
0017 def runDigitizationConfig(
0018 trackingGeometry,
0019 input: Path,
0020 output: Path,
0021 ):
0022 inputConfig = readDigiConfigFromJson(str(input))
0023
0024 digiConfigurator = DigitizationConfigurator()
0025 digiConfigurator.compactify = True
0026 digiConfigurator.inputDigiComponents = inputConfig
0027
0028 trackingGeometry.visitSurfaces(digiConfigurator)
0029
0030 outputConfig = DigiConfigContainer(digiConfigurator.outputDigiComponents)
0031
0032 writeDigiConfigToJson(outputConfig, str(output))
0033
0034
0035 if "__main__" == __name__:
0036 detector = GenericDetector()
0037 trackingGeometry = detector.trackingGeometry()
0038
0039 runDigitizationConfig(
0040 trackingGeometry=trackingGeometry,
0041 input=Path(__file__).parent
0042 / "../../Algorithms/Digitization/share/default-smearing-config-generic.json",
0043 output=Path.cwd() / "digi-config-out.json",
0044 )