Re: [ROOT] TObject::kSingleKey

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Apr 17 2001 - 15:03:41 MEST


Hi Benoit,

I do not see a problem with TClonesArray.
Could you run the following small test with your version (3.01 ?)

{
   TClonesArray *cls=new TClonesArray("TLine");
   TClonesArray &clones = *cls;

   new(clones[0]) TLine(0,0,1,1);
   new(clones[1]) TLine(0,0,1,2);
   new(clones[2]) TLine(0,0,1,3);
   
   TFile f("junk.root","recreate");
   clones.Write("test",TObject::kSingleKey);
}

then in a new Root session, do;
 root > TFile f("junk.root");
 root > test.ls();

you should see the following output:

TLine  X1= 0.000000 Y1=0.000000 X2=1.000000 Y2=1.000000
TLine  X1= 0.000000 Y1=0.000000 X2=1.000000 Y2=2.000000
TLine  X1= 0.000000 Y1=0.000000 X2=1.000000 Y2=3.000000


Rene Brun

FORESTIER Benoit wrote:
> 
> Hi,
> I have a problem with the new version of root:
> I want to write a TClonesArray to file using the
> option TObject::kSingleKey.
> It was working with the old version of root, but
> with the new one, the TClonesArray is written to
> file but i can't read it back.
> 
> Benoit Forestier



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:43 MET