but there is an error:
Traceback (most recent call last):
File “r1.py”, line 16, in
for i in range(1,len(hdata.GetNbinsX())+1):
AttributeError: ‘TObject’ object has no attribute ‘GetNbinsX’
It sems that the type that you are expecting from fdata.Get("z_pt") is a THn class, but you are getting a plain TObject. I will invite @etejedor to this thread; he will be able to shed some light on this.
Just a guess, but in principle in Root you can use (in C macros) Get<Class>('key')
If you know in advance the type of the object you take, you can try with
Hi,
I found that ‘z_pt’ can’t be retrieved from ‘data.root’, because there is some problem with the root file.
Thanks for your solution.
And thanks for all of you!
Cheers