Example #1
0
# using the new Mgr.

import sys

# From PyCintex in ROOT
dlflags = sys.getdlopenflags()
sys.setdlopenflags( 0x100 | 0x2 )    # RTLD_GLOBAL | RTLD_NOW

import libSniperMgr
import libSniperPython


if __name__ == "__main__":

    mgr = libSniperMgr.SniperMgr()
    libSniperPython.setProperty("Sniper", "EvtMax", 5)
    libSniperPython.setProperty("Sniper", "InputSvc", "NONE")
    libSniperPython.setProperty("Sniper", "LogLevel", 2)

    mgr.configure()
    # TODO
    # How To add the Alg into the MGR?
    #op.addOption("Sniper")

    import libHelloWorldPy

    x = libHelloWorldPy.HelloAlg("x")
    #x.MyString = 'GOD'
    libSniperPython.setProperty("x", "MyString", "GOD")
    libSniperPython.setProperty("x", "MyVectorInt", range(4))
    libSniperPython.setProperty("x", "MyStrInt", {"str1":1, "str2":2})
Example #2
0
# Last modified: 2013-11-12 00:48
# Filename: test.py
# Description:

import os
import sys
sys.setdlopenflags( 0x100 | 0x2 )    # RTLD_GLOBAL | RTLD_NOW

import libSniperMgr
import libSniperPython as sp

mgr = libSniperMgr.SniperMgr()
mgr.setProp("EvtMax", 5)
mgr.setProp("InputSvc", "NONE")
mgr.setProp("LogLevel", 1)
sp.setProperty("Sniper", "Dlls", ["RecTimeLikeAlg","RecEvent", "SimEvent", "Geometry", "TopAlg", "DetSimResultCnv", "PmtRec"])

mgr.configure()

svcMgr = sp.SvcMgr.instance()
algMgr = sp.AlgMgr.instance()

#get the DataBuffer service
bufsvc=sp.SvcMgr.get("DataBufSvc", True)
svcMgr.add(bufsvc.name())

vp=["/Event/Sim/Test", "/Event/Rec/Test", "/Event/Ana/Test",
        "/Event/Rec/RecHeader", "/Event/Calib/CalibHeader",
        "/Event/Sim/SimHeader",

        "/Topology/TopHeader"]
Example #3
0
# using the new Mgr.

import sys

# From PyCintex in ROOT
dlflags = sys.getdlopenflags()
sys.setdlopenflags( 0x100 | 0x2 )    # RTLD_GLOBAL | RTLD_NOW

import libSniperMgr
import libSniperPython


if __name__ == "__main__":

    mgr = libSniperMgr.SniperMgr()
    libSniperPython.setProperty("Sniper", "EvtMax", 5)
    libSniperPython.setProperty("Sniper", "InputSvc", "NONE")
    libSniperPython.setProperty("Sniper", "LogLevel", 2)
    libSniperPython.setProperty("Sniper", "Dlls", ["HelloWorld"])


    #libSniperPython.setProperty("AlgMgr", "Contents", ["HelloAlg/x"])

    mgr.configure()
    # TODO

    #x = libSniperPython.AlgMgr.get("x",False)
    x = libSniperPython.AlgMgr.get("HelloAlg/x",True)

    x.setProp("MyString", "GOD")
    x.setProp("MyVectorInt", range(6))
Example #4
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# author: lintao

import sys
sys.setdlopenflags( 0x100 | 0x2 )    # RTLD_GLOBAL | RTLD_NOW

import libSniperMgr
import libSniperPython as sp

mgr = libSniperMgr.SniperMgr()
sp.setProperty("Sniper", "EvtMax", 5)
sp.setProperty("Sniper", "InputSvc", "NONE")
sp.setProperty("Sniper", "LogLevel", 0)
sp.setProperty("Sniper", "Dlls", ["RootWriter", "DummyAlg"])

mgr.configure()

rw = sp.SvcMgr.get("RootWriter", True)
# now to configure the algs and svcs.
d = {"FILE1": "output1.root", "FILE2": "output2.root"}
rw.setProp("Output", d)

dalg = sp.AlgMgr.get("DummyAlg/dalg", True)


# begin to run
mgr.initialize()
mgr.run()
mgr.finalize()
Example #5
0
# using the new Mgr.

import sys

# From PyCintex in ROOT
dlflags = sys.getdlopenflags()
sys.setdlopenflags( 0x100 | 0x2 )    # RTLD_GLOBAL | RTLD_NOW

import libSniperMgr
import libSniperPython


if __name__ == "__main__":

    mgr = libSniperMgr.SniperMgr()
    libSniperPython.setProperty("Sniper", "EvtMax", 5)
    libSniperPython.setProperty("Sniper", "InputSvc", "NONE")
    libSniperPython.setProperty("Sniper", "LogLevel", 2)
    libSniperPython.setProperty("Sniper", "Dlls", ["HelloWorld"])


    libSniperPython.setProperty("AlgMgr", "Contents", ["HelloAlg/x"])

    mgr.configure()
    # TODO

    libSniperPython.setProperty("x", "MyString", "GOD")
    libSniperPython.setProperty("x", "MyVectorInt", range(4))
    libSniperPython.setProperty("x", "MyStrInt", {"str1":1, "str2":2})

    libSniperPython.getProperty("x", "MyString").value()
Example #6
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# author: lintao

# using the new Mgr.

import sys

# From PyCintex in ROOT
dlflags = sys.getdlopenflags()
sys.setdlopenflags( 0x100 | 0x2 )    # RTLD_GLOBAL | RTLD_NOW

import libSniperMgr
import libSniperPython

if __name__ == "__main__":
    mgr = libSniperMgr.SniperMgr()
    libSniperPython.setProperty("Sniper", "InputSvc", "NONE")
    libSniperPython.setProperty("Sniper", "Dlls", ["RootWriter"])
    mgr.configure()

    rw = libSniperPython.SvcMgr.get("RootWriter/rw", True)
    rw.setProp("Output", {"FILE1":"hello.root"})
    print rw