[ATR-23731] Extend the ComboHypoTool to support more than one object per leg
Builds on additional combinatiorics generators added in !44879 (merged) (thanks @tbold), extends the exiting ComboHypoTool work (thanks @fpastore) to implement the missing "TODO" of supporting more than one physics object on each leg.
Each combination is still a vector of pair<ID,DecisionObject>
, with the ID
denoting the leg on which the DecisionObject
is being supplied in the given combination.
The code was additionally reviewed and tidied up a little. One bug was found, features were only propaged from the final passing combination rather than all passing combinations. This is fixed.
The clients of this base class are all updated to conform to the slightly modified fn signature (pass in as const, add namespace on typedef). In addition I added some more error-catching code to warn if any instance gets a combination which it is unable to deal with.
As all ComboHypoTools instances now need to know their chain's explicit per-leg multiplicity, the setting of these data is done by the ComboHypo passing in its per-chain-per-leg multiplicity dict in initialize
, we then fill m_legDecisionIds
at the same time. This replaces a section of code in the BPhys derived ComboHypo which set m_legDecisionIds
itself. The interface to read m_legDecisionIds
is not changed.
cc @amoreira for AFP - this should work as you want it to now, @abarton and @lyubushk for the changes to the bphys - I'm pretty sure that the functionality hasn't changed here, but I'd be happier if you'd have a quick look over too. @gipezzul for the updates to the generic combo hypo tool. I just added a WARNING here for now if we get a leg-of-interest with more than one physics object on it. I won't explicitly tag the people related to the other tool instances as the changes there were small
Local count changes - none! Good!
Example from new unit test, here the arbitrary testing rule is that we accept any combination which has one pT:50 object on each leg.
HLT_2e25_3mu15 DEBUG Looking for legs from HLT_2e25_3mu15 ID#270470543 in the map. Map contains features for 20 legs, which may be data for many chains.
HLT_2e25_3mu15 DEBUG Getting 2 legs to combine, for ID: HLT_2e25_3mu15 ID#270470543
HLT_2e25_3mu15 DEBUG Leg 0 --
HLT_2e25_3mu15 DEBUG -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:0
HLT_2e25_3mu15 DEBUG -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:1
HLT_2e25_3mu15 DEBUG -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:2
HLT_2e25_3mu15 DEBUG Leg 1 --
HLT_2e25_3mu15 DEBUG -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:0
HLT_2e25_3mu15 DEBUG -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:1
HLT_2e25_3mu15 DEBUG -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:2
HLT_2e25_3mu15 DEBUG -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:3
HLT_2e25_3mu15 DEBUG For leg 0 we will be choosing any 2 Decision Objects out of 3
HLT_2e25_3mu15 DEBUG For leg 1 we will be choosing any 3 Decision Objects out of 4
HLT_2e25_3mu15 SUCCESS Next Combination:
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:2 pT:30
HLT_2e25_3mu15 DEBUG Combination 0 decided to be passing
HLT_2e25_3mu15 SUCCESS Next Combination:
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:2 pT:30
HLT_2e25_3mu15 DEBUG Combination 1 decided to be passing
HLT_2e25_3mu15 SUCCESS Next Combination:
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS Next Combination:
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:3 pT:20
HLT_2e25_3mu15 DEBUG Combination 3 decided to be passing
HLT_2e25_3mu15 SUCCESS Next Combination:
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:3 pT:20
HLT_2e25_3mu15 DEBUG Combination 4 decided to be passing
HLT_2e25_3mu15 SUCCESS Next Combination:
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:3 pT:20
HLT_2e25_3mu15 SUCCESS Next Combination:
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:3 pT:20
HLT_2e25_3mu15 DEBUG Combination 6 decided to be passing
HLT_2e25_3mu15 SUCCESS Next Combination:
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:3 pT:20
HLT_2e25_3mu15 DEBUG Combination 7 decided to be passing
HLT_2e25_3mu15 SUCCESS Next Combination:
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:3 pT:20
HLT_2e25_3mu15 SUCCESS Next Combination:
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:3 pT:20
HLT_2e25_3mu15 SUCCESS Next Combination:
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:0 pT:50
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:3 pT:20
HLT_2e25_3mu15 SUCCESS Next Combination:
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg000_HLT_2e25_3mu15 ID#3088384102 f:My_ELEC_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:1 pT:40
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:2 pT:30
HLT_2e25_3mu15 SUCCESS -- leg001_HLT_2e25_3mu15 ID#4138555611 f:My_MUON_Container i:3 pT:20
HLT_2e25_3mu15 DEBUG Passing 6 combinations out of 12, HLT_2e25_3mu15 ID#270470543 **ACCEPTS** this event.
HLT_2e25_3mu15 DEBUG -- Passing combination 0 of 6
HLT_2e25_3mu15 DEBUG -- -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:0
HLT_2e25_3mu15 DEBUG -- -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:1
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:0
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:1
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:2
HLT_2e25_3mu15 DEBUG -- Passing combination 1 of 6
HLT_2e25_3mu15 DEBUG -- -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:0
HLT_2e25_3mu15 DEBUG -- -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:2
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:0
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:1
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:2
HLT_2e25_3mu15 DEBUG -- Passing combination 2 of 6
HLT_2e25_3mu15 DEBUG -- -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:0
HLT_2e25_3mu15 DEBUG -- -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:1
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:0
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:1
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:3
HLT_2e25_3mu15 DEBUG -- Passing combination 3 of 6
HLT_2e25_3mu15 DEBUG -- -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:0
HLT_2e25_3mu15 DEBUG -- -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:2
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:0
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:1
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:3
HLT_2e25_3mu15 DEBUG -- Passing combination 4 of 6
HLT_2e25_3mu15 DEBUG -- -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:0
HLT_2e25_3mu15 DEBUG -- -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:1
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:0
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:2
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:3
HLT_2e25_3mu15 DEBUG -- Passing combination 5 of 6
HLT_2e25_3mu15 DEBUG -- -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:0
HLT_2e25_3mu15 DEBUG -- -- leg000_HLT_2e25_3mu15 ID#3088384102 container:HLTNav_Elec, index:2
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:0
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:2
HLT_2e25_3mu15 DEBUG -- -- leg001_HLT_2e25_3mu15 ID#4138555611 container:HLTNav_Muon, index:3
HLT_2e25_3mu15 DEBUG ComboHypoToolBase: End of HLT_2e25_3mu15 ID#270470543, passing elements are:
HLT_2e25_3mu15 DEBUG -- leg000_HLT_2e25_3mu15 ID#3088384102 with 3 elements
HLT_2e25_3mu15 DEBUG -- -- container:HLTNav_Elec, index:0
HLT_2e25_3mu15 DEBUG -- -- container:HLTNav_Elec, index:1
HLT_2e25_3mu15 DEBUG -- -- container:HLTNav_Elec, index:2
HLT_2e25_3mu15 DEBUG -- leg001_HLT_2e25_3mu15 ID#4138555611 with 4 elements
HLT_2e25_3mu15 DEBUG -- -- container:HLTNav_Muon, index:0
HLT_2e25_3mu15 DEBUG -- -- container:HLTNav_Muon, index:1
HLT_2e25_3mu15 DEBUG -- -- container:HLTNav_Muon, index:2
HLT_2e25_3mu15 DEBUG -- -- container:HLTNav_Muon, index:3