Split TrigBmumuxComboHypo::findBmumuxCandidates() into three subroutines and add brief description to the header file.
Main idea:
At first step we calculate all possible (dimuon+track) and (track+track) combinations. Then, we perform fast fit for combinations if they occurred more than 5 times. If fast fit fails we do not perform fit for all B candidates if they include this combination. In other words, we do not fit (dimuon+trk1+trk2) if we already know that fit failed for (dimuon+trk1) combination. We also do not try to fit (trk1+trk2+trk3) combination if any of (trk_i, trk_j) fits failed.
Checked with valid1.801921.P8B_A14_CTEQ6L1_Bs_Jpsim3p5mu3p5_phi.recon.RDO.e8542_e8528_s4159_s4114_r14844
The number of calls of Trk::TrkVKalVrtFitter has been reduced by ~25%. There has also been a significant reduction in WARNING messages from TrigBmumuxComboHypo (4 bearable warnings for 1000 events).
I think the optimization should not lead to the bias (explicitly checked for small MC dataset). Nevertheless, we decided not to use fast pre-fit for
- B+ -> mu+ mu- K+
- B_c+ -> mu+ mu- pi+
- B_s0 -> mu+ mu- phi(-> K+ K-)
CC @abarton