Reading root file: works on OpenSUSE but not on Ubuntu

Hello,

My research group have got a data analysis software which includes root somehow. My group is using OpenSUSE and there all the developed codes are stored. And I am using Ubuntu 12.04

When I tried to run a piece of code which reads a root file. It worked without any problem on the main OpenSUSE system but not on my Ubuntu.

Error messages from the terminal are as following:

Warning in <TClass::TClass>: no dictionary for class TCutG is available
Error in <TBufferFile::ReadClassBuffer>: Could not find the StreamerInfo for version 4 of the class TNamed, object skipped at offset 56
Error in <TBufferFile::CheckByteCount>: object of class TNamed read too few bytes: 2 instead of 447
Error in <TBufferFile::CheckByteCount>: object of class TGraph read too many bytes: 475 instead of 455
Warning in <TBufferFile::CheckByteCount>: TGraph::Streamer() not in sync with data on file ./d_cuts_dp.root, fix Streamer()

What should I do ? Let me know if you need any further detail on this issue.

Best
Gunn

Hi,

what is the version in the two cases, Ubuntu and OpenSuse?
Is the installation on ubuntu working fine? For example:

  • Does root boot fine?
  • Do you have the libGraf.so and libGraf.rootmap in the $ROOTSYS/lib directory?
    Can you exclude that the rootfile is not corrupted?

Danilo

Hi Danilo,

Ubuntu 12.04 LTS (64 bit) has root Version 5.34/09
OpenSUSE 13.1(64 bit) has root Version 5.34/18

I also tried installing the root 5.34/18 on my Ubuntu, but it didn’t help.

And yes, the root works fine on Ubuntu, I have been using root almost every day on ubuntu since last 1 year, no problem. These errors started to show up after some updates in our analysis software.
Yes I do have .so and .rootmap for libGraf:

gunn@khatri:/usr/local/root/lib$ ls libGraf* libGraf3d.rootmap libGraf3d.so libGraf.rootmap libGraf.so
Yes I am able to execute the root file, it opens with root command and I can see the content using TBrowser as well. It used to work before I updated the code.

PS: I checked something online just now but it doesn’t go through my head. May be you wanna have a look:
[url]Hadd mistery
http://manpages.ubuntu.com/manpages/trusty/en/man1/rlibmap.1.html

Gunn

Hi,

what exactly did you update ( you say " It used to work before I updated the code.")?

Danilo

HI Danilo,

The code is in c++ with many classes, each having function of analysing data of different parts of the detectors. The update was in the part where we apply particle identification using Graphical cuts (saved as .root file). Those graphical cuts were made long time ago and it was being used in one of the classes. Later the code developed and there were more than one class which would require this .root files of the cuts. And therefore the last update was made to create a special class which simply holds the cuts and one can call them by extern function into other classes. To show you a bit, I will paste part of some code below:

Below the code defines the function of cut which reads the root file, this can be called to any class which requires it.

......
Int_t Init_TGPID(Char_t *fInFileCutsP, Char_t *fInFileCutsD)
{

  fprintf(stderr, "PID 3 entering");

 if(Meth_3) return 1;   // already initiated
  else Meth_3 = kTRUE;

  //gDirectory->pwd();
  TDirectory *curdir = new TDirectory;
  curdir = gDirectory->CurrentDirectory();
  fcutsD=TFile::Open(fInFileCutsD,"read");

  for (int e =0; e<5; e++){
    for (int de=0;de<12;de++){
      char cutName[50];
      sprintf(cutName,"d_%d_%d",e,de);
      fprintf(stderr, cutName);
      dCut[e][de]=(TCutG *)fcutsD->Get(cutName)->Clone();
    }
  }
  for (int e =5; e<10; e++){
    for (int de=12;de<24;de++){
      char cutName[50];
      sprintf(cutName,"d_%d_%d",e,de);
      fprintf(stderr, cutName);
      dCut[e][de]=(TCutG *)fcutsD->Get(cutName)->Clone();
    }
  } 
  fcutsD->Close();

  fcutsP=TFile::Open(fInFileCutsP,"read");

  for (int e =0; e<5; e++){
    for (int de=0;de<12;de++){
      char cutName[50];
      sprintf(cutName,"p_%d_%d",e,de);
      //fprintf(stderr, cutName);
      pCut[e][de]=(TCutG *)fcutsP->Get(cutName)->Clone();
    }
  }
  for (int e =5; e<10; e++){
    for (int de=12;de<24;de++){
      char cutName[50];
      sprintf(cutName,"p_%d_%d",e,de);
      //fprintf(stderr, cutName);
      pCut[e][de]=(TCutG *)fcutsP->Get(cutName)->Clone();
    }
  } 
  fcutsP->Close();
  curdir->cd();
  return 1;
}

......
......

INTU2 PID3(float che, int chde, int e, int de)
{
  // Function should be used to fill Event.P1Type..
  // 0 <--- Unidentified
  // 1 <--- Proton
  // 2 <--- Deuteron
    
  if(!Meth_3)   // not initiated ???
    {
      fprintf(stderr, "PID method 3 requested but not initiated\n");
      exit(0);
    }
  int partType=0;
  
  if ((e<5 && de>11) || (e>4 && de<12)) return 0;
  
  if(dCut[e][de]->IsInside(che,chde))partType=2;
  if(pCut[e][de]->IsInside(che,chde))partType=1;

  //fprintf(stderr, "\t bla bla %i,%i,%i",partType, e,de); 
  return  partType;
}

Below the line shows how the function is called inside other classs:

.....
extern Int_t Init_TGPID(Char_t *InFileCutsP, Char_t *InFileCutsD);
.....

Gunn

Hi,

I cannot figure out much from this description.
I asked a reproducer in a duplicated post.

Danilo

This problem was solved in a duplicate post:
[url]Errors: no dictionary for class TCutG, no StreamerInfo

This problem was caused by the ROOT auto-loading mechanism not being enabled. Adding a TApplication to the main solved the problem.

SOLVED