Hi Stephane,
any object inheriting from TNamed can have a name. You can set
it by using the method SetName("lkdjskdj") and retrieve it with
GetName(). TGraph as well as TH1* inherits from TNAmed so no problem with
these guys, however if you want to store an object not inheriting from
TNamed (e.g TMatrixD) you can use myobj->Write("fjdfkhdj") since
a TKey is written for each object written in a ROOT file and TKey does
inherit from TNamed.
seb
On Tue, 8 Jun 2004, Stephane Plaszczynski wrote:
> hello,
> I am creating a TGraph in a piece of code and saving it in a root file.
> However I don't understand how it get recognized after in an intreactive
> session since it has no name assocaited to it (as a histogram,ntuples
> etc...)
> However there seems to be somreting in my file...
> thanks for help,
> Stephane
>
>
---------------------------------------------------------------------
| Sebastien GREDER tel : +33 (0)3 88 10 63 54 |
| D0 Strasbourg, |
| Institut de Recherches Subatomiques fax : +33 (0)3 88 10 62 34 |
| 23, rue du loess - BP 28 secr : +33 (0)3 88 10 66 40 |
| F-67037- STRASBOURG cedex 2 e-mail : greder@in2p3.fr, |
| greder@fnal.gov |
---------------------------------------------------------------------
This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET