Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dd4hep.py
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file dd4hep.py
1 import subprocess
2 import sys
3 
4 
5 # Cannot conveniently catch linker errors, so we launch a suprocess to
6 # try importing and see if it works in order to provide a useful error message
7 try:
8  subprocess.check_call(
9  [sys.executable, "-c", "from acts import ActsPythonBindingsDD4hep"]
10  )
11 except subprocess.CalledProcessError as e:
12  print("Error encountered importing DD4hep. Likely you need to set LD_LIBRARY_PATH.")
13  sys.exit(1)
14 
15 from acts._adapter import _patch_config, _detector_create
16 from acts import ActsPythonBindingsDD4hep
17 
18 _patch_config(ActsPythonBindingsDD4hep)
19 ActsPythonBindingsDD4hep.DD4hepDetector.create = _detector_create(
20  ActsPythonBindingsDD4hep.DD4hepDetector,
21  ActsPythonBindingsDD4hep.DD4hepGeometryService.Config,
22 )
23