I am trying to read an object from a root file that is not derived from TObject using PyROOT. The dictionary for this class is available but I am not sure how to get a python instance of the correct type after calling ReadObjectAny:
>>> r = k.ReadObjectAny(ROOT.TClass.GetClass("RCTransLog"))
How do I convert PyLongBuffer into RCTransLog ?
Answering my own question, this seems to work:
<ROOT.RCTransLog object at 0xa59d848>
or the more direct ROOT.BindObject(), which takes r, though (i.e. a long address, rather than the buffer). Difference being that ROOT.TPython is supposed to work from CINT, so calls to it from python go through the dictionary layer once more, and that BindObject() will take CObjects as well and can handle classes (rather than only strings). In the end, they call the same function, though.