You can use dynamic_cast or typeid builtin C++ operators, you can also use ROOT’s own RTTI (and I think, with CINT it’s even better, since, for example, dynamic_cast is incorrect in CINT). But when defining class of object
(obj->Class) you in fact call static member function! This means, for TObject * ptr = file.Get(“name”), prt->Class() you’ll get TClass * from TObject, and this is not what you want. Call IsA() instead, this is the virtual function and it’ll give you the TClass pointer you need.