I have a tree structure as following:
I want to get values of the “global_time_stamp” leaf in the Plane_0 object.
My code I would expect to work:
import ROOT
f_flame = ROOT.TFile("/afs/desy.de/user/d/dudarboh/FCAL/synchronization/fire1036_srs184_FIRE.root")
t_flame = f_flame.TreeOnFire
for event in t_flame:
event_time = event.GetLeaf("Plane_0.global_time_stamp").GetValue()
print(event_time)
return:
TClass::Init:0: RuntimeWarning: no dictionary for class Plane is available
TClass::Init:0: RuntimeWarning: no dictionary for class TimeFrame is available
Traceback (most recent call last):
File "sync.py", line 33, in <module>
event_time = event.GetLeaf("Plane_0.global_time_stamp").GetValue()
ReferenceError: attempt to access a null-pointer
or accessing it by dot operators like this:
event_time = event.Plane_0.global_time_stamp
return:
TClass::Init:0: RuntimeWarning: no dictionary for class Plane is available
TClass::Init:0: RuntimeWarning: no dictionary for class TimeFrame is available
Traceback (most recent call last):
File "sync.py", line 33, in <module>
event_time = event.Plane_0.global_time_stamp
AttributeError: 'Plane' object has no attribute 'global_time_stamp'
BUT
I can acces these variables by:
event_time = event.GetLeaf("global_time_stamp").GetValue()
return:
expected behavior
Additional info:
print(event.GetLeaf("global_time_stamp").GetFullName())
return:
Plane_0.global_time_stamp
Questions:
Is this expected behaviour? Or what am I doing wrong?
How do I access Plane_1, Plane_2, etc…
ROOT file is here for testing.
cheers,
Bohdan
ROOT Version: 6.22/00
Platform: Centos 7
Python: 3.7.6