TF1 name and title disappear from ROOT 5 to 6


when I open a canvas from file test.root (46.3 KB) with ROOT 6 all names and titles of the contained TF1s have disappeared. This causes problems when searching for a TF1 via canvas->FindObject(“objectname”). Any ideas on this?

TFile *f1 = TFile::Open("test.root");
TCanvas *cnvMTF = (TCanvas*)f1->Get("cnvMTF");

Output with ROOT 5.34.32:

Output with ROOT 6.04.02:


I run ROOT 6.03/02 on a Debian Linux. I could not reproduce the problem. The TF1-Names look fine here:

root [0] TFile *f = TFile::Open("test.root")
(class TFile *) 0x2e43550
root [1] f->ls()
TFile**         test.root
 TFile*         test.root
  KEY: TCanvas  cnvMTF;1        MTF
root [2] TCanvas *can = (TCanvas*)f->Get("cnvMTF")
(class TCanvas *) 0x3827e60
root [3] can->GetListOfPrimitives()->ls()
OBJ: TList      TList   Doubly linked list : 0
 TFrame  X1= -0.035000 Y1=-0.050000 X2=1.435000 Y2=1.500000
 OBJ: TH1F      Graph    : 1 at: 0x3887700
 OBJ: TF1       fcnMTF1 Modulation Transfer Function;Spatial frequency [mm^{-1}];MTF : 1 at: 0x38ad590
 OBJ: TF1       fcnMTF2 Modulation Transfer Function;Spatial frequency [mm^{-1}];MTF : 1 at: 0x38e1da0
 OBJ: TF1       fcnMTF3 Modulation Transfer Function;Spatial frequency [mm^{-1}];MTF : 1 at: 0x38e4310
 OBJ: TF1       fcnMTF4 Modulation Transfer Function;Spatial frequency [mm^{-1}];MTF : 1 at: 0x38e6860
 TLine  X1=-0.035000 Y1=0.100000 X2=1.435000 Y2=0.100000
 TLine  X1=-0.035000 Y1=0.500000 X2=1.435000 Y2=0.500000
 OBJ: TPaveText TPave   X1= 1.248924 Y1=0.110671 X2=1.351266 Y2=0.195732
 OBJ: TPaveText TPave   X1= 1.248924 Y1=0.509512 X2=1.351266 Y2=0.594573


It took a while but I compiled ROOT 6.03.02 on OpenSUSE 13.1 and you are right - name and title are still there.

Then I recompiled ROOT 6.04.02 with default configuration in case my extensive changes were the reason, but they were not - name and title disappear still!!!

So, I conclude whatever goes wrong was introduced between 6.03.02 and 6.04.02. I guess there must be release notes somewhere…

Can anybody out there reproduce the problem with 6.04.02?

I get this problem with 6.04.02, too.

OK, I see that TF1 changed a lot, e.g. not inheriting from TFormula anymore but directly from TNamed.

When saving a TF1 to file from ROOT 6.04.02 and loading it again with the same ROOT version all works as it should.

Is the lack of backward compatibility intended or accidental? I might not be the only one having stored tons of TF1s that would be sort of lost without name/title because identifiying them all manually is just not feasible.

Do I have to file a formal request for implementation of backward compatibility in the “bugs” section or does this forum post suffice?


This problem should have been fixed already for the newest dev version 6.05.02.
See also the JIRA item