Skip to content

Commit

Permalink
fix: ODD with macOS (#1258)
Browse files Browse the repository at this point in the history
This fix the common.py to be able to use the ODD with macOs. It also make the error message a bit more explicite if the path to the ODD factory was not set.
  • Loading branch information
Corentin-Allaire committed May 17, 2022
1 parent 9ddf828 commit 6c2807a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Examples/Scripts/Python/common.py
Expand Up @@ -28,7 +28,7 @@ def getOpenDataDetector(mdecorator=None):
lib_name = "libOpenDataDetector.so"
elif sys.platform == "darwin":
env_vars = ["DYLD_LIBRARY_PATH", "DD4HEP_LIBRARY_PATH"]
lib_name = "libOpenDataDetector.dyld"
lib_name = "libOpenDataDetector.dylib"

if lib_name is not None and len(env_vars) > 0:
found = False
Expand All @@ -41,7 +41,7 @@ def getOpenDataDetector(mdecorator=None):
if not found:
msg = (
"Unable to find OpenDataDetector factory library. "
f"You might need to point {'/'.join(env_vars)} at it"
f"You might need to point {'/'.join(env_vars)} to build/thirdparty/OpenDataDetector/factory or other ODD install location"
)
raise RuntimeError(msg)

Expand Down
20 changes: 20 additions & 0 deletions docs/getting_started.md
Expand Up @@ -310,6 +310,26 @@ The following environment variables might be useful.
| HepMC3_DIR | Search path for the HepMC3 installation |
| Pythia8_DIR | Search path for the Pythia8 installation |

## The OpenDataDetector

Acts comes packaged with a detector modeled using DD4Hep that can be used to test your algorithms. It comes equipped with a magnetic field file as well as an already built material map.
It is available via the git submodule feature by performing the following steps (git lfs need to be installed on your machine) :

.. code-block:: console

git submodule init
git submodule update

To use it, you will then need to build acts with the ACTS_BUILD_ODD option and then point either LD_LIBRARY_PATH on Linux or
DYLD_LIBRARY_PATH and DD4HEP_LIBRARY_PATH on MacOs to the install path of the ODD factory (for example : build/thirdparty/OpenDataDetector/factory).

You can now use the ODD in the python binding by using :

```oddMaterialDeco = acts.IMaterialDecorator.fromFile("PATH_TO_Acts/thirdparty/OpenDataDetector/data/odd-material-maps.root")
detector, trackingGeometry, decorators = getOpenDataDetector(oddMaterialDeco)
```


## Using Acts

When using Acts in your own CMake-based project, you need to include the
Expand Down

0 comments on commit 6c2807a

Please sign in to comment.