Re: pyroot question about TTrees containing TObjects

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


Erkcan,

> I have neither the source code for the classes, nor the libraries. With
> MakeClass(), I would still some variables named blabla_xyz, which would
> correspond to blabla.xyz in the ROOT file.

I'm not really understanding: you do have a MakeClass(), but no definition of the classes?

Or are you working from the streamer only? The python code is implemented using TClass, not TStreamer, and so requires a full class definition. Of course, if you do have a MakeClass generated code, you can use it to provide a class header: as long as the layout is the same as the original class used to write the data, it can be read back in the new class.

> chain.Photon[1] returns a <ROOT.TObject object ("TObject")>, which has no
> Pt member in its dictionary.

Yes, b/c the down-casting fails since there is no TClass available for the actual class, and hence it sticks to the original class, which is a TObject.

Best regards,

            Wim

-- 
WLavrijsen_at_lbl.gov    --    +1 (510) 486 6411    --    www.lavrijsen.net
Received on Fri Jan 20 2012 - 21:57:22 CET

This archive was generated by hypermail 2.2.0 : Fri Jan 20 2012 - 23:50:01 CET