I am having trouble to read info from the branches of a TTree using the following code:
z = array('d',[0.])
tree.SetBranchAddress("L0_END_VZ",z)
pt = array('d',[0.])
tree.SetBranchAddress("L0_PT",pt)
for j in range(tree.GetEntries()):
tree.GetEntry(j)
print(z[0])
print(pt[0])
and I got in the prints very small numbers like 5.721481036e-315 I don't understand because this method used to work for me...
please note that while reading TTree data from a Python for loop works fine in general, it is also much slower than alternative interfaces (namely RDataFrame) so make sure you don’t use raw Python loops for large-scale, full-blown analysis.