How to check the integrity of all contents of a ROOT file

Dear experts,

is there a script or method available in pyROOT or ROOT that inspects all the objects (one by one) written in a ROOT file and ensures that everything is ok (no corrupt objects, no nan histograms, etc…)
and if not gives you a list of all the problematic ones?


_ROOT Version: any
_Platform: any
_Compiler: any

Hello Alexandros,

I am not aware of any such tool, perhaps @Axel or @pcanal know?

Hello @etejedor

thank you for the reply. I am guessing there has to be something of that effect, so @Axel, @pcanal or anyone that knows please let me know. Otherwise, I guess I might need to write one by myself.


Hi Attikis,

A “read everything” would me a nice tool, it’s a good idea! In principle it’s easily done by simply reading all TKeys in all TDirectorys, recursively.

NaN-histograms are a very different beast, though: they might be “just fine” in certain use cases; it’s a fairly personal definition of what’s “broken”…

Cheers, Axel.

Hi Axel,

yes, I agree. I am actually surprised that this does not exist (?) yet! And my thoughts of such a script were also based on using objKeys = GetListOfKeys() and FindObjectAny(objKey) in a loop. But of course the complexity arises from having different ROOT object types etc… T


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.