How to search for a value in ntuple and get the index?

See “Saving the result of Draw to a TEventList, a TEntryList or a TEntryListArray” and then " Using a TEventList, TEntryList or TEntryListArray as Input" in the TTree::Draw method description.