Problems in reading a TLeafElement with a python script

Dear root experts,

I would like to read the content of an object of type TLeafElement with a simple python script (attached), but I got always 0.0. Another variable of type TLeafI is instead correctly accessed and readout.

I verified with a C++ script, created with MakeClass, that both variables are actually filled correctly, and I can print out and plot their content. I can provide also those if they could be useful.

I created a small chunk of the data from the TTree I am trying to read (also attached).

Do you have any suggestion on how I can correctly access this data?

Thanks for any help,
small.root (18.3 KB) (874 Bytes)


the script that you have attempts to index the trkPix_eta data as if it is a C-array, but it is an std::vector, so you need to get hold of the actual object. For example like so:


Thank you very much. This solves the problem.