hi all
i have a tree with branches which have arrays of floats saved in them. and i’d like a way to do a SetBranchAddress in pyroot. i tried the following:
#! /usr/bin/python
from ROOT import *
file = TFile("/afs/cern.ch/user/p/pandolf/public/tree.root")
tree = file.Get("mt2")
var = vector('double')()
tree.SetBranchAddress("jet_pt", var)
tree.GetEntry(3)
print "tree.jet_pt[0]: " + str(tree.jet_pt[0])
print "tree.jet_pt[1]: " + str(tree.jet_pt[1])
print "tree.jet_pt[2]: " + str(tree.jet_pt[2])
print "var[0]: " + str(var[0])
which you can easily execute yourself from AFS, and the last command crashes.
what am i doing wrong?
thanks in advance
f