Skip to content

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 using std::map as the output type. Although std::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 to std::vector<Relation<Particle,int>> and using a SplittingTransformer to unpack it into a Python dict. This way, the line association can be done on the Python side, and we can always use F.MAP_TO_RELATED to access the information, thereby avoiding the costly search operation. BTW, this approach will be v2-friendly, resulting in an output of std::vector<LHCb::Event::RelationTable1D<v2::Particles, int_field>> instead of LHCb::Event::RelationTable1D<v2::Particles, SOA_MAP<string, int>>. To implement this, you need to first design the SOA_MAP. (And actually, the concept of SOA_MAP does not make sense to me) WDYT?

Edited by Abhijit Mathad