# Issues understanding BuildIndex()

**URL:** <https://root-forum.cern.ch/t/issues-understanding-buildindex/45002>\
**Category:** Newbie\
**Tags:** tree, root\
**Created:** [May 20, 2021, 3:40pm UTC](https://root-forum.cern.ch/t/issues-understanding-buildindex/45002 "2021-05-20T15:40:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PPierre](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/ebca7d/32.png) [@PPierre](https://root-forum.cern.ch/u/PPierre)\
**Post date:** [May 20, 2021, 3:40pm UTC](https://root-forum.cern.ch/t/issues-understanding-buildindex/45002/1 "2021-05-20T15:40:06Z")

</div>

Hi Root users,

I do not understand the command myTree-\>BuildIndex( major, minor). Why root need 2 arguments in this function and what will root do with it ?  
I’m sorry I don’t get the concept of major sort and minor sort, for me you can sort according to a condition (increasing, decreasing,…)

Thanks for your time,  
PPierre

_ROOT Version:_ Not Provided  
_Platform:_ Not Provided  
_Compiler:_ Not Provided

* * *

---

<div class="post-metadata">

**Author:** ![jblomer](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@jblomer](https://root-forum.cern.ch/u/jblomer)\
**Post date:** [May 20, 2021, 8:31pm UTC](https://root-forum.cern.ch/t/issues-understanding-buildindex/45002/2 "2021-05-20T20:31:53Z")

</div>

Hi Pierre,

There is some explanation in [`TTreeIndex`](https://root.cern.ch/doc/master/classTTreeIndex.html#a08aac749ab22fd5c8ab792a0061a4b0f). The index allows you to identify an event by the combined value of two of its integer branches, e.g. a run number and an event number.

Cheers,  
Jakob
