Hello Everyone,
I have problem when i execute f.Map(). It gives me this error
SysError in TFile::Seek: cannot seek to position 100 in file demo.root, retpos=-1 (Bad file descriptor)
Warning in TFile::Map: demo.root: failed to read the key data from disk at 100.
0/000000 At:100 N=1 END
the code is:
{
char name[10], title[20];
TObjArray Hlist(0);
TH1F* h;
//make and fill 15 histogram and add them to the object array
for(Int_t i =0; i<15;++i)
{
sprintf(name,"h%d",i);
sprintf(title,"histo nr:%d",i);
h = new TH1F(name,title,100,-4,4);
Hlist.Add(h);
h->FillRandom("gaus",1000);
}
//open a file and write the array to the file
TFile f("demo.root","recreate");
Hlist.Write();
f.Close();
}