Improve the efficiency of the TisTos with a vector of relations rather than map of particle to relation
@jzhuo suggestion. Need to see how the user interface would change along with the efficiency.
Sorry for jumping in, it seems that we need to handle this map because the TIS/TOS algorithm outputs a
Relation<Particle,map<string,int>>
. However, I have concerns regarding the efficiency of usingstd::map
as the output type. Althoughstd::map
is a self-balancing binary search tree, searching through it every time can be quite inefficient, especially for large datasets. While it may be acceptable for offline selection, I wonder if it can be improved by changing the output type tostd::vector<Relation<Particle,int>>
and using aSplittingTransformer
to unpack it into a Python dict. This way, the line association can be done on the Python side, and we can always useF.MAP_TO_RELATED
to access the information, thereby avoiding the costly search operation. BTW, this approach will be v2-friendly, resulting in an output ofstd::vector<LHCb::Event::RelationTable1D<v2::Particles, int_field>>
instead ofLHCb::Event::RelationTable1D<v2::Particles, SOA_MAP<string, int>>
. To implement this, you need to first design theSOA_MAP
. (And actually, the concept of SOA_MAP does not make sense to me) WDYT?