Last active
December 28, 2015 00:09
-
-
Save ndawe/7411021 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from root_numpy import tree2rec | |
from root_numpy.testdata import get_filepath | |
from rootpy.io import root_open | |
import rootpy.compiled as C | |
C.register_code(""" | |
double mult(double x, double y) | |
{ | |
return x * y; | |
} | |
""", "mult".split()) | |
assert C.mult(2, 2) == 4 | |
filename = get_filepath('test.root') | |
with root_open(filename) as rfile: | |
print tree2rec(rfile.tree, | |
branches=['x', 'y', 'mult(x, y)'], | |
selection='z > 0', | |
start=0, stop=10, step=2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment