Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-26 09:25:02

0001 import acts
0002 import pytest
0003 
0004 from helpers import detrayEnabled
0005 
0006 u = acts.UnitConstants
0007 
0008 
0009 @pytest.mark.skipif(not detrayEnabled, reason="Detray plugin not available")
0010 def test_detray_propagator_bindings():
0011     import acts.examples.detray as exdetray
0012 
0013     assert hasattr(exdetray, "StraightLinePropagatorODD")
0014     assert hasattr(exdetray, "HelixPropagatorODD")
0015 
0016 
0017 @pytest.mark.skipif(not detrayEnabled, reason="Detray plugin not available")
0018 def test_detray_surface_grid_policy():
0019     from acts import detray
0020     import acts.json
0021 
0022     cfg = detray.DetraySurfaceGridConfig()
0023     assert cfg.vertexZHalfRange == pytest.approx(150 * u.mm)
0024     assert cfg.minPt == pytest.approx(0.5 * u.GeV)
0025     assert cfg.numberOfBinsFactor == pytest.approx(2.0)
0026     assert cfg.lookupOnLayer
0027     cfg.minPt = 1 * u.GeV
0028     cfg.numberOfBinsFactor = None
0029     assert cfg.numberOfBinsFactor is None
0030 
0031     factory = detray.addDetraySurfaceGridPolicy(
0032         acts.NavigationPolicyFactory.make().add(acts.TryAllNavigationPolicy), cfg
0033     )
0034     assert factory is not None
0035 
0036     jsonCfg = acts.json.TrackingGeometryJsonConverter.Config()
0037     detray.addDetrayNavigationPolicies(jsonCfg)
0038     acts.json.TrackingGeometryJsonConverter(jsonCfg)