Home | News | Documentation | Download

TStreamerInfo warning when open TFile of newer version


#1

Hello,

I try to rewrite some root files generated by newer version of ROOT (for example 6.14) with an older veresion of ROOT (5.xx)

I store a simple TTree (with some casual data) in the originial root file (of ROOT 6). Only for testing. Then open it with ROOT 5. All data of the TTree can be loaded correctly. But a warning is shown as:

Warning in <TStreamerInfo::BuildCheck>: 
   The StreamerInfo of class TAttMarker read from file test.root
   has the same version (=2) as the active class but a different checksum.
   You should update the version to ClassDef(TAttMarker,3).
   Do not try to write objects with the current class definition,
   the files will not be readable.

I want to write the TTree object to a new root file (by ROOT 5). But the message warning that first I should “update the version to ClassDef…”

So, how can I get rid of this warning and correctly write a copy of the TTree object to a new file with ROOT 5?

Thanks.


#3

I just tried to reproduce this issue using the macro hsimple.C in the tutorials directory of ROOT. This macro generates a file called hsimple.root. I ran this macro using ROOT 6.
So I get a file generated by ROOT 6. This file has an ntuple in it (TNtuple derived class from TTree). When I open this file using ROOT 5 I get some error messages but not those you get. I get the following:

root [0]    TFile hsimple("hsimple.root");
Error in <TClass::New>: cannot create object of class TH2
Error in <TClass::New>: cannot create object of class TH1
Warning in <TClass::TClass>: no dictionary for class ROOT::TIOFeatures is available

Do you have some reproducer example giving the error messages about TAttMArker ?


#4

Hi couet,

This is the test source I used. I use ROOT 6 to produce a root file test.root, then open it with ROOT 5.

There are warnings about TAttMarker, and some other TObjects.

I test the hsimple.root with ROOT (5.34.05). It also warning about TAttMarker (and many other). So, it maybe some differents in the ROOT 5 I used?

It seems that most of the classes cannot be loaded correctly, but the data in TTree is valid (can be shown).

So I am looking forward to a method to extract the data in TTree to a clean new root file with ROOT 5. At this time, when I open the test.root with ROOT 5, I cannot write any new root file (Due to the ClassDef warnings “Do not try to write objects with the current class definition, the files will not be readable”). Says that when I open these new root files produced by ROOT 5, there are also CalssDef warnings.

Thanks

void test() {
    const int VOL = 100;
    float x[VOL];
    int n;
    int nEvent = 100;

    TRandom3 gen;

    TFile *fout = new TFile("test.root", "recreate");

    TTree *t = new TTree("test", "test");
    t->Branch("n", &n, "n/I");
    t->Branch("x", x, "x[n]/F");

    for (int i = 0; i < nEvent; ++i) {
        n = (int) gen.Uniform(1, VOL - 1);

        for (int j = 0; j < n; ++j) {
            x[j] = gen.Gaus();
        }

        t->Fill();
    } // for nEvent

    fout->Write();
    fout->Close();

    delete fout;
}

#5

On my mac I get a different warning:

$ root root6.root 
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.34/39     12 March 2018   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

ROOT 5.34/39 (heads/v5-34-00-patches@v5-34-38-1-g507abd2, Aug 31 2018, 15:17:00 on macosx64)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
Type ? for help. Commands must be C++ statements.
Enclose multiple statements between { }.
root [0] 
Attaching file root6.root as _file0...
Warning in <TClass::TClass>: no dictionary for class ROOT::TIOFeatures is available
root [1] 

TAttMarker is not involved but still there is a dictionary issue. I think @pcanal can tell more about this.


#6

@couet note the ROOT version:


#7

@Wile_E_Coyote yes I saw. Difficult for me to try it. I have only the most recent 5.34.
It might be also that similar issue can show with a file generated with 5.34/39 and read with 5.34.05.

@Inspect is there a very good reason why you need to stick with 5.34.05 ?


#8

Yes I also try a latest root 5.

But there is a PC farm in our workplace with only 5.34.05. So I try to produce compatible root files for it.

Now I extract the TTree from ROOT 6 into a text file and then rebuild the text to TTree with ROOT 5. It’s a little complex to avoid the dictionary problem.


#9

Hi,

Out of curiosity what does:

TClass::GetClass("TAttMarker")->GetStreamerInfo()->ls();

print on the screen in both your version of v5 and your version of v6?

Thanks,
Philippe.


#10

With 6.17/01 and 5.34/39 on Mac, it gives the same:

root [0] TClass::GetClass("TAttMarker")->GetStreamerInfo()->ls();

StreamerInfo for class: TAttMarker, version=2, checksum=0x291d8bec
  short          fMarkerColor    offset=  8 type= 2 Marker color index  
  short          fMarkerStyle    offset= 10 type= 2 Marker style        
  float          fMarkerSize     offset= 12 type= 5 Marker size         
   i= 0, fMarkerColor    type= 22, offset=  8, len=2, method=0 [optimized]
   i= 1, fMarkerSize     type=  5, offset= 12, len=1, method=0

#11

@Inspect what about in your version of v5 ( 5.34.05) ?


#12

Hi, this is the printout of v5 and v6, thanks!

v5 (before open the root file produced by v6)

StreamerInfo for class: TAttMarker, version=2, checksum=0xfacd2184
  short          fMarkerColor    offset=  8 type= 2 Marker color index
  short          fMarkerStyle    offset= 10 type= 2 Marker style
  float          fMarkerSize     offset= 12 type= 5 Marker size
   i= 0, fMarkerColor    type= 22, offset=  8, len=2, method=0
   i= 1, fMarkerSize     type=  5, offset= 12, len=1, method=0

v5 (after open the root file produced by v6)

StreamerInfo for class: TAttMarker, version=2, checksum=0x291d8bec
  short          fMarkerColor    offset=  8 type= 2 Marker color
  short          fMarkerStyle    offset= 10 type= 2 Marker style
  float          fMarkerSize     offset= 12 type= 5 Marker size
   i= 0, fMarkerColor    type= 22, offset=  8, len=2, method=0
   i= 1, fMarkerSize     type=  5, offset= 12, len=1, method=0

v6

StreamerInfo for class: TAttMarker, version=2, checksum=0x291d8bec
  short          fMarkerColor    offset=  8 type= 2 Marker color
  short          fMarkerStyle    offset= 10 type= 2 Marker style
  float          fMarkerSize     offset= 12 type= 5 Marker size
   i= 0, fMarkerColor    type= 22, offset=  8, len=2, method=0 [optimized]
   i= 1, fMarkerSize     type=  5, offset= 12, len=1, method=0

#13

Sometimes in the life cycle of 5.34, we updated the checksum calculation resulting in this problem. The best solution would be to update the PC farm to use v5.34/39 (okay the best would really be to upgrade to v6 :slight_smile: but the latest v5 would do ).

Cheers,
Philippe


#14

Agree. I will try to keep up for the latest versions.

Best regards