# TFile gets same pointer for a different key version

**URL:** <https://root-forum.cern.ch/t/tfile-gets-same-pointer-for-a-different-key-version/43868>\
**Category:** ROOT\
**Created:** [March 8, 2021, 7:52am UTC](https://root-forum.cern.ch/t/tfile-gets-same-pointer-for-a-different-key-version/43868 "2021-03-08T07:52:30Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [March 9, 2021, 8:42am UTC](https://root-forum.cern.ch/t/tfile-gets-same-pointer-for-a-different-key-version/43868/12 "2021-03-09T08:42:18Z")

</div>

> [@Broken TDirectoryFile::FindObjectAny and TDirectoryFile::FindKeyAny](https://root-forum.cern.ch/t/broken-tdirectoryfile-findobjectany-and-tdirectoryfile-findkeyany/20943/16):
>
> Although it is not recommended, I saw many cases in which people store, in a single file, many histograms (or graphs, or even some “event” objects) which have the same “name”, but they differ in the “cycle” number (I did it myself, too). Each histogram (or graph) keeps a “sub-sample” of data. In the end, you may need to analyze/compare different “sub-samples”, or you may want to add them all (to get the “total result”). One may argue that, in such cases, one should create a TTree with a branch…

BTW. [Search the ROOT’s documentation for “cycle” and/or “namecycle”.](https://root-forum.cern.ch/t/aux-1-aux-2-aux3/13345/2)

---

_[View the full topic](https://root-forum.cern.ch/t/tfile-gets-same-pointer-for-a-different-key-version/43868)._
