Error in <TBuffer::CheckByteCount>

Hello,
I am using ROOT version 4.00/08. I am using this version since there exists lot of root file which had been generated using version 4.00/08. I created a new root file (Tree with my own class definition) from the already generated root file. When I tried to read the new root file, I faced with folllowing error

Error in TBuffer::CheckByteCount: object of class JPTrack read too few bytes:

The cuts are so stringent such that few event passes the cut. I searched on the web and found that the solution for the above problem is to use “-lTree” with the executable. I have my another analysis script “copy.C” which uses the new root file. I used following command

root -b copy.C -lTree

But I am still getting the same problem. Could you please help me ?
Thanks,
Manoj

[quote]Error in TBuffer::CheckByteCount: object of class JPTrack read too few bytes: [/quote]This usually indicates that there is a problem with the file and/or your class set up. (You might an old fashion streamer and/or a custom streamer that is not matching the one you used to write the file;).
For a more concrete diagnosis, I would need to have access to your data file and possibly the code you use to read it.

Cheers,
Philippe

Hi Philippe,
Thanks for your reply. I was using different dictionary for writing and reading the root file. The message disappeared whem I used the same dictionary for reading and writing the root file.

Now I am facing a different problem. I am able to write the root files(pippo.root) but unable to read the root file using the same dictionary. I am loading the dictionary from the script (copy.C), and then runing it using the command “root -b copy.C”, I am facing the segmentation fault. Please find the files on the following link.

home.fnal.gov/~manoj/work/MinBias/

I am using root version "4.00/08". Please let me know if you need more information.

Thanks,
Manoj

[quote=“pcanal”][quote]Error in TBuffer::CheckByteCount: object of class JPTrack read too few bytes: [/quote]This usually indicates that there is a problem with the file and/or your class set up. (You might an old fashion streamer and/or a custom streamer that is not matching the one you used to write the file;).
For a more concrete diagnosis, I would need to have access to your data file and possibly the code you use to read it.

Cheers,
Philippe[/quote]

Hi,

Just to note that the segmentation fault was due to a ‘static’ object that was deleted in the destructor (and the pointer to it was not reset accordingly).

Cheers,
Philippe