ATLAS Offline Software
UnitConstants.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 
3 """
4 Wraps the ACTS unit constants loaded from a ROOT dictionary.
5 To use these values please use
6 
7 ```python
8 from ActsInterop import UnitConstants
9 value = 15*UnitConstants.mm
10 ```
11 
12 """
13 # pull in the dictionary/headers with Acts Units
14 from ROOT.Acts.UnitConstants import mm # noqa: F401
15 
16 from ROOT import Acts
17 import inspect
18 
19 # Pull in all named unit constants into this namespace to improve ergonomics
20 for name, val in inspect.getmembers(Acts.UnitConstants):
21  if name.startswith("_"): continue
22  locals()[name] = val
23