Re: pyroot question about TTrees containing TObjects

From: <wlavrijsen_at_lbl.gov>
Date: Fri, 20 Jan 2012 14:14:20 -0800


Erkcan,

> So I have nothing and I am looking for a magic python solution. :-)

okay, but then the point needs to be made that it is neither magic, nor python that is providing the functionality. Rather, underneath in C++ the class definition (typically as a dictionary in the class library) is used to do all the boilerplate work as needed.

Dictionaries can be loaded on-demand based on as little as the class name, and contain enough information to figure out how to turn the bytes on disk into a representation in memory (that was the point of dictionaries after all :) ). Using only the streamer it is possible to do something with individual data members of the original class (which in the end always are some form of builtin type), and you can see this in action when using the TBrowser for example. In PyROOT, there's no support for that, though: it always requires the full class dictionary.

Best regards,

            Wim

-- 
WLavrijsen_at_lbl.gov    --    +1 (510) 486 6411    --    www.lavrijsen.net
Received on Fri Jan 20 2012 - 23:14:31 CET

This archive was generated by hypermail 2.2.0 : Sat Jan 21 2012 - 11:50:01 CET