Cannot open file created with 4.02/00 with 4.00/08

Hi,

I created and filled a root file using root 4.02/00 compiled with gcc 3.3 on a G5 running Mac OS 10.3.2 with the following syntax in a c++ program:

TFile dat(“QQ.root”, “RECREATE”);
TTree Data(“Data”, “QQ”);

double m = 0.0;
//…(declare more variables)

Data.Branch(“Mass”,&m,“m/D”);
//…(set more Branches)

for(int ii=0; ii<N;ii++){
//…(Do some physics)
Data.Fill();
}
Data.Write();
dat.Close();

The file appears fine and can be opened with root v4.02/00 on the computer I created it with. However, when I try opening it on my laptop, which has root 4.00/08 installed (again, compiled with gcc 3.3, this time under Mac OS 10.3.8.) I get the warning message

“Warning in TClass::TClass: no dictionary for class TRefTable is available”

and then when I try and access the tree root crashes (taking the terminal with it!)

Any idea why that happens? The file is only 7Mb in size and the same thing occurs if I try using root 3.02 on a Linux box to open the file. Are files created with 4.02 not always backwards compatible?

cheers

James

[quote]Any idea why that happens? The file is only 7Mb in size and the same thing occurs if I try using root 3.02 on a Linux box to open the file. Are files created with 4.02 not always backwards compatible?
[/quote]We try as much as we can to update the ROOT code so that ROOT files produced by newer version of ROOT can be read with older version of ROOT (technically this is called forward compatibility … where an old version of the code can read file that might be supporting new (and of course unknown at the time) features).
Unfortunately, we sometimes have to break this forward compatibility in order to be able to support new useful feature.

I recommend that you download a newer version of ROOT for your laptop.

Cheers,
Philippe.

Well of course I can do that on my laptop, but I have no control over the other computers I might need to open the file on. Just out of interest, what new feature is causing the problem with earlier versions of root? I have saved other files with 4.02 that have opened fine on earlier versions, but they didn’t have a TTree in them - is there any way I can use the older TTree definition (in the same way that MS Word, for example, still allows saving in Word 95/97 format). We only updated from 3.10 to 4.08 last week (to use files > 1.9GB) and this is the first time I have come across the problem.

thanks for the help.

James

The ‘feature’ is question is ability to have trees with a very large number of entries. This resulted in changeda large number of data members from 32 bytes to 64 bytes. Unfortunately the code for at least one class (TBranch) in older version of ROOT was not able to cope with forward compatiblity (we corrected this at the same time we changed the data types).
We have not (yet?) any way to tell ROOT to write file in an the same format as an older version, we might want to add this feature.

Philippe.