Hi
This is probably a stupid question but it is taking me way too long to figure out.
I wanted to access the contents of my TTree in python using the name of the branch rather than Tree.branchname.
This is because I am trying to convert all the branches into a different structure so I wanted to do
for branchname in branches:
and do slightly different things depending on the type of the branch
For floats I can do
branchDict[branchname] = Tree.GetBranch(branchname)
and then
if branchDict[branchname].GetListOfLeaves()[0].GetTypeName() == ‘Float_t’:
value = branchDict[branchname].GetListOfLeaves()[0].GetValue()
however for those branches std::vector , I need something slightly different.
branchDict[branchname].GetObject()
seems to return a pointer but then I can’t seem to get the vector contents.
I’m sure there is some easy way to do this - so apologies(!)
Thanks
Wahid