Re: Usage of TTree / old ROOT files in v2.23_07

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Nov 03 1999 - 12:19:03 MET


Hi Stefan,
Thanks for sending me a copy of your file.
Your file had never been correctly closed. The pointer (called fEND) at
the beginning of your file is 0. It should point to the end of the file.
You can continue to work if you recover the file.
You can recover the file permanently by doing:
  TFile f("myfile.root","update");
  f.Recover();

If you do not want to update the file, simply add the statement
  f.recover() immediatly after opening the file.

I added a protection in 2.23/08 to prevent reading beyond the end of
file.
This protection is too strict in case your file need to be recovered.

Users worried by Stefan's message can check if their file has this
symptom.
Do
  TFile f("myfile.root")
  f.Dump();

if the fEND data member is 0, follow the procedure above.

Rene Brun

  
Stephan Heising wrote:
> 
> Hello
> I installed the new version of ROOT v2.23_07 and later v2.23_08 as
> well. I tried to
> used old macros running under v2.22_10. Now when reading an event from
> the ROOT-file
> I get error messages:
> 
> SysError in <TFile::ReadBuffer>: error reading from file
> mobilfd40s.root (Invali
> d argument)
> 
> The code is:
> 
>    TFile hfile("mobilfd80s.root","READ");
> 
>    TTree *tree = (TTree*) hfile.Get ("T");
>    TBranch *branch = tree->GetBranch ("Davinci");
>    TBranch *brt = tree->GetBranch ("Temp");
>    TBranch *brb = tree->GetBranch ("Bias");
>    branch->SetAddress (&dav);
>    brt->SetAddress (&temp);
>    brb->SetAddress (&bias);
> 
>    Int_t nevent = tree->GetEntries ();
>    printf ("Entries: %d\r\n", nevent);
>    ...
>    for (Int_t i=0; i<nevent; i++)
>    {
> >>
>       nb += tree->GetEvent (i);
> >>   this line produces the error.
>       .
>       .
>       .
>    }
> 
> It is a modified example of the tutorials.
> What happened???
> 
> Cheers Stephan Heising



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:42 MET