InitPyKernel.py 954 Bytes
Newer Older
1
2
3
4
5
from PyKernel import PyKernel

from PyKernel.PyKernel import plot,plot2,fill,fill2,dumpSG,book,bookProf
from PyKernel.PyKernel import plotProf,fillProf,unregister,dumpHist,retrieveHist

6
7
import cppyy
cppyy.loadDictionary("libPyKernelDict")
8
9

# Bind the C++ global namespace to the Python variable g 
10
g = cppyy.gbl
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

## temporary hack to 'fix' #58078
if 0:
    # set ROOT stream
    import re
    import ROOT
    rootStream=None
    from AthenaCommon.AppMgr import ServiceMgr as svcMgr
    EventSelector = svcMgr.EventSelector
    if hasattr(EventSelector,"CollectionType") and  EventSelector.CollectionType == "ExplicitROOT":
        filename = EventSelector.InputCollections[0]
        if not re.search('\.root$',filename):
            filename = filename+'.root'
        file = ROOT.TFile(filename)
        rootStream=ROOT.gROOT.FindObject('CollectionTree')

    # this must be the last one
    PyKernel.init(theApp,rootStream)

    pass # temporary hack