Hi,
I wrote a simple script in python where I tried to fill a tree branch with an array that has two entries, but only the first entry in filled into the tree branch. The code is the following:
import ROOT as root
import numpy as np
from array import array
file = root.TFile.Open("tree_tester.root", "RECREATE")
tree = root.TTree("tree","tree")
myvar = array('i')
myvar.append(2)
myvar.append(4)
tree.Branch('myvar', myvar, 'myvar/I')
tree.Fill()
tree.Write()
So, how can I create and fill a tree branch with all the array elements?