diff --git a/Examples/Python/python/acts/examples/odd.py b/Examples/Python/python/acts/examples/odd.py index c66eaf979fc..ec8cbcb9438 100644 --- a/Examples/Python/python/acts/examples/odd.py +++ b/Examples/Python/python/acts/examples/odd.py @@ -20,6 +20,13 @@ def getOpenDataDetector( odd_dir: Optional[Path] = None, logLevel=acts.logging.INFO, ): + """This function sets up the open data detector. Requires DD4hep. + Parameters + ---------- + mdecorator: Material Decorator, take RootMaterialDecorator if non is given + odd_dir: if not given, try to get via ODD_PATH environment variable + logLevel: logging level + """ import acts.examples.dd4hep customLogLevel = acts.examples.defaultLogging(logLevel=logLevel) @@ -86,11 +93,9 @@ def geoid_hook(geoid, surface): ) detector = acts.examples.dd4hep.DD4hepDetector() - config = acts.MaterialMapJsonConverter.Config() if mdecorator is None: - mdecorator = acts.JsonMaterialDecorator( - rConfig=config, - jFileName=str(odd_dir / "config/odd-material-mapping-config.json"), + mdecorator = acts.examples.RootMaterialDecorator( + fileName=str(odd_dir / "data/odd-material-maps.root"), level=customLogLevel(minLevel=acts.logging.WARNING), ) diff --git a/Examples/Python/tests/test_examples.py b/Examples/Python/tests/test_examples.py index 1447f98adf7..b1a669f0dd4 100644 --- a/Examples/Python/tests/test_examples.py +++ b/Examples/Python/tests/test_examples.py @@ -28,7 +28,7 @@ GenericDetector, AlignedDetector, ) -from acts.examples.odd import getOpenDataDetector +from acts.examples.odd import getOpenDataDetector, getOpenDataDetectorDirectory u = acts.UnitConstants @@ -678,7 +678,14 @@ def test_material_mapping(material_recording, tmp_path, assert_root_hash): s = Sequencer(numThreads=1) - detector, trackingGeometry, decorators = getOpenDataDetector() + odd_dir = getOpenDataDetectorDirectory() + config = acts.MaterialMapJsonConverter.Config() + mdecorator = acts.JsonMaterialDecorator( + level=acts.logging.INFO, + rConfig=config, + jFileName=str(odd_dir / "config/odd-material-mapping-config.json"), + ) + detector, trackingGeometry, decorators = getOpenDataDetector(mdecorator) from material_mapping import runMaterialMapping