Skip to content

WIP: Add std::pair support for Relation Table

@ldufour shows in DPA-WP3 (https://indico.cern.ch/event/1616095/#5-dtf-issues) that a simple LHCb::Particle to LHCb::Particle relation table can cause problems in events with multiple candidates.

The issue appears when two decay trees share some particles, for example { A -> B + C, D -> C + E }. The simple Particle table that relates the original particle to the fitted particle becomes:

A -> Fitted(Decay A), Particle(A)
B -> Fitted(Decay A), Particle(B)
C -> Fitted(Decay A), Particle(C)
C -> Fitted(Decay D), Particle(C)
D -> Fitted(Decay D), Particle(D)
E -> Fitted(Decay D), Particle(E)

The bug is that when FunTuple tries to use this relation table to find Fitted(Decay D), Particle(C) from the original particle C, it instead gets Fitted(Decay A), Particle(C), which is clearly wrong.

To solve this problem, we can extend FunTuple so that it considers not only the target particle but also the decay origin. For this we need the Relation Table to support std::pair<LHCb::Particle, LHCb::Particle> as the FROM type, where the first element is the decay origin and the second is the target particle. This allows it to return the correct TO entry.

This MR adds the basic support needed in the Relation Table. After that, I will adapt the DTF (in Rec) and FunTuple (in DaVinci). The key idea is to hide everything in the backend so the user will not see any change in the interface but the bug will be fixed.

FYI: @masmith @ldufour

Merge request reports

Loading