Hello everyone,
I have received a very old Root file with some data that I need. However, the data is stored as a custom class and I am having trouble reading the file. I also have the source file of the custom class.
Here is what it tried:
rootcint -v -f dict.cpp -c BCR_PDF.h
g++ -o libBCR_PDF.so $(root-config --cflags --libs --ldflags) -I. dict.cpp BCR_PDF.C -shared -fPIC
g++ -o main $(root-config --cflags --libs --ldflags) -I. main.cpp libBCR_PDF.so
LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH ./main
main.cpp
contains the following:
#include <TFile.h>
#include "BCR_PDF.h"
int main(int argc, char** argv)
{
TFile f("ZeusJets.root");
f.ls();
f.Get("CTEQ5D_f2");
f.Close();
}
Running the script results in the following error message:
Error in <TBufferFile::CheckByteCount>: object of class BCR_PDF read too few bytes: 51 instead of 1823399
I know that the Root file was previously used on a 32bit machine running Root 5.26. Now, I am trying to read it on a 64bit machine with Root 5.34. Maybe that is part of the problem. But looking at the class header, it contains no machine dependent member variables, such as size_t
.
I have attached the Root file as well as the source code. To make the above steps work, I had to move the definitions of the variables chNum
and debug
from the header to the source file. But presumably, at some point the files where working without any modification. Therefore I am not sure if I am on the right track. How can I read this file?
data.tar.gz (713.5 KB)