Access TFile elements when cycle maxes out

I’ve inherited a ROOT file that was badly constructed (by merge) which has ended up with an obscene number of elements (they happen to be TVectorT) with identical name. Specifically there are ~50,000 of them, so when the cycle caps out at 2^15, I’m not sure how to access them.

GetListOfKeys still correctly identifies the number of keys (I assume), but the last ~16000 keys alternate between having a cycle number of 32767 and -32768. Using *namecycle thus doesn’t appear capable of retrieving these objects.

The GetSeekKey method on the elements of the key list still appear to return a unique address for each of these, so hopefully it’s possible to recover? I just couldn’t find the right spot in the documentation to dig these elements of the TFile out by address.

* Bonus if it’s easy to do this in PyROOT
* I fully acknowledge that the structure of the TFile I’m trying to code is nuts, and this isn’t half of it.

Thank you @Wile_E_Coyote! I hadn’t realized that I could simply iterate through my .GetListOfKeys() and .ReadObj() for each TKey, which in PyROOT handles the types seamlessly. I guess I learned years ago to get objects from a file based on namecycle and never moved on.

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