Two-idexed TTree...?

Probably a stupid question, but…

In my understanding, a normal root tree of N entries is sorted by one index n, so that each entry is numbered by that index:
with n=0 to N-1.

Now, I need a tree of N*M entries such that I can accede to a given entry by means of a couple of indices n and m; something like:
with n=0 to N-1 and m=0 to M-1.

Is it possible to have such a structure under root?

see TTree::BuildIndex where you can use up to 2 Tree variables to index your search.