Re: [ROOT] writing a TGraph to a file

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sat Sep 22 2001 - 13:47:12 MEST


Hi Olav,

Sorry for this late reply.
This problem was corrected this spring in version 3.01

Rene Brun

On Mon, 10 Sep 2001, Olav Franzen wrote:

> Dear friends,
> 
>   why does the following simple program not work?
> 
> {
> 
> Float_t x[5] = {1, 2, 3, 4, 5};
> Float_t y[5] = {3, 3, 3, 3 ,3};
> Float_t ex[5] = {1, 1, 1, 1, 1};
> Float_t ey[5] = {1, 1, 1, 1 ,1};
> 
> TFile f("test.root",  "RECREATE");
> TGraph *g = new TGraphErrors(5, x, y, ex, ey);
> g->Draw("AP");
> g->SetName("hello");
> g->Write();
> f.Close();
> 
> }
> 
> When opening the generated test.root file and starting a TBrowser, one
> obtains:
> 
> 
> root [1] TBrowser b;
> root [2] Error in <TBuffer::CheckByteCount>: object of class
> TGraphErrors read too few bytes
> Warning in <TBuffer::CheckByteCount>: TGraphErrors::Streamer() not in
> sync with data on file, fix Streamer()
> <TCanvas::MakeDefCanvas>: created default TCanvas with name c1
> 
>  *** Break *** segmentation violation
> Root >
>  *** Break *** segmentation violation
> Root >
> 
> 
>  Thanks for your patience,
> 
>   Olav
> 
> 
> PS: I'm using ROOT version 3.00.05 on linux-pc
> 



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