Re: function member as a TTree leaf

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Mon, 16 Jun 2008 09:57:09 +0200


Hi Xianguo,

just load the library that defines your class (more precisely: its dictionary) before opening the .root file.

Cheers, Axel.

On 2008-06-15 23:03, LU Xianguo wrote:
> Hallo rooters,
>
> I notice that some root-defined classes, like TVector3, can be
> saved in a TTree in such a way that its member functions, like
> TVector3::Eta() , can also be viewed and drawed like normal
> variable members.
>
> How can I do this in my own class?
>
> For example, I have defined a class Test, and it has a function
> member
> double Test::X() const { return 3.4;}
>
> How can I view X() in a TTree, if it is saved by:
> Test *aa=new Test;
> myTree->Branch("aa","Test",&a); ?
>
> Thanks a lot !!
>
> Cheers!
> Xianguo
>
> --
> LU, Xianguo
>
> DESY-HERMES
> Notkestrasse 85
> Hamburg, 22607
> Germany
Received on Mon Jun 16 2008 - 09:57:13 CEST

This archive was generated by hypermail 2.2.0 : Mon Jun 16 2008 - 17:50:02 CEST