Why not defining an additional branch with the ‘event id’ ?
Later, you can re-order the tree by event id using TTree::GetTreeIndex