-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy path__init__.py
31 lines (24 loc) · 903 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""Python module for the EDM4HEP datamodel and utilities."""
import sys
from .__version__ import __version__
import ROOT
res = ROOT.gSystem.Load('libedm4hepDict.so')
if res < 0:
raise RuntimeError('Failed to load libedm4hepDict.so')
res = ROOT.gSystem.Load('libedm4hepRDF.so')
if res < 0:
raise RuntimeError('Failed to load libedm4hepRDF.so')
res = ROOT.gInterpreter.LoadFile('edm4hep/utils/kinematics.h')
if res != 0:
raise RuntimeError('Failed to load kinematics.h')
res = ROOT.gInterpreter.LoadFile('edm4hep/utils/dataframe.h')
if res != 0:
raise RuntimeError('Failed to load dataframe.h')
res = ROOT.gInterpreter.LoadFile('edm4hep/Constants.h')
if res != 0:
raise RuntimeError('Failed to load Constants.h')
from ROOT import edm4hep
# Make TAB completion work for utils
setattr(edm4hep, 'utils', edm4hep.utils)
# Make `import edm4hep` work
sys.modules['edm4hep'] = edm4hep