Closing a root file improperly

How can I recover the maximum number of good events (TTree) from a root file when it was either closed due to e.g. a power outage (computer shut down) or “ctrl-c”?

I have had a simulation running for several days and the data were written periodically to a root file. Unfortunately the job was terminated unexpectedly. Is there a recover feature so that I can use the events before the crash? Here is the error message when I try to open the file:

Error in TFile::Init: file test_t0.root has an incorrect header length (282) or incorrect end of file length (264)

I tried it using ROOT 6.04/02 and 5.34/32. The message is the same for both cases.

Thanks for any help.


this post is duplicated at Closing a root file improperly
let’s continue the conversation on the other thread.