The optimal way to store variable tracks count in a TTree

Each trace comes from a separate detector (and stores those 6 values vs time, time corresponding to the consecutive cells of, for example, traces[100][150].SimSignal_X). Only traces that trigger the detector’s electronics would be stored. The idea is to have a separate array for each Event, that says that trace[0] in this particular event is (for example) detector 5, trace[1] is detector 11, etc. That’s why I actually asked the question about indexing with a separate branch array in On-fly dictionary generation for vector<myclass> and use as a branch - #11 by LeWhoo