Filling TTree but setting Event ID manually?

Why not defining an additional branch with the ‘event id’ ?

Later, you can re-order the tree by event id using TTree::GetTreeIndex