Hello,
I have a bunch of files created with win32 version of root 3.05/5. These
files contain lots of root objects including TF1s. I have recently switched
to gdk version of root 3.05/7. I can open and read these files (3.05/5
generated) without problem. However, if after opening one of these files a
create a new TF1 object and then write that out, I do have a problem: That
TF1 object becomes unreadable. HEre's the kind of error I Get:
Error in <TBuffer::CheckByteCount>: object of class TF1 read too few bytes:
1079 instead of 1151
Warning in <TBuffer::CheckByteCount>: TF1::Streamer() not in sync with data
on file, fix Streamer()
Here's how do demonstrate the problem. First, in root version 3.05/5 do the
following:
TFile *f = new TFile("test30505.root","recreate")
TH1F *ph = new TH1F("ph","test",100,-5.,5.)
ph->FillRandom("gaus",100000)
ph->Fit("gaus")
ph->Write()
f->Close()
.q
Then, run root version 3.05/7 and do the following:
TFile *f = new TFile("test30505.root")
TH1F *ph = (TH1F *)f->Get("ph")
ph->Draw() // no problem here!
//
// Now, create a new TF1 attached to a new TH1
//
TH1F *ph1 = new TH1F("ph1","test1",100,-5.,5.)
ph1->FillRandom("gaus",100000)
ph1->Draw()
ph1->Fit("gaus")
TFile *f1 = new TFile("test.root","recreate")
ph1->SetDirectory(f1)
ph1->Write()
f1->Close()
.q
Now run 3.05/7 again and do the following:
TFile *f = new TFile("test.root")
ph1->Draw()
and the error message appears:
Error in <TBuffer::CheckByteCount>: object of class TF1 read too few bytes:
1079 instead of 1151
Warning in <TBuffer::CheckByteCount>: TF1::Streamer() not in sync with data
on file, fix Streamer()
Note: if you try to read test.root from version 3.05/5 - it works fine and
the TF1 is ok!
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:15 MET