Skip to content

Refactor of Combo Hypo

Tim Martin requested to merge tamartin/athena:comboHypoRefactor into master

Here I re-factor the code of the ComboHypo to try an make it a bit easier to follow.

I also lay the groundwork for adding restrictions based on ROI, but the actual logic for that part is not included yet. This will be added in a follow up MR.

I found the data structures were getting a bit confusing so I split some of it out into a simple ComboHypoCombination helper class. This (for a given leg-ID) keeps track of the number of passing Decision objects, and for each of these, the Decision object's (type-less) "feature" and "initialRoI" hash identifiers.

Notes:

  • We were keeping count of the number of times a feature was seen for a given leg-ID. But we were then never using these data with the exception of the ATH_MSG_DEBUG(" Feature Id "<<feat.first<<", mult "<<feat.second); message.
  • The map<featureID, counter> is replaced with a vector<pair<featureID,roiID>>. The roiID is not currently used.
  • I changed from a map to a vector as I want to keep a one-to-one correspondence between the "dmap" and "fmap", which are both combined into the ComboHypoCombination here. We should also always have a feature, this is a requirement on the HypoAlg.
  • When it comes to use the featureID, what we care about is unique values for a given leg-ID. Before we iterated over the map and checked on entry.first, now we iterate over the vector of pairs and check on entry.first which is equivalent. No dupes are expected, but this is still de-duped via a set.

cc @fpastore to check over. I don't expect to see any changes in counts here yet. (though we might when ROI filtering is added)

FYI @vcroft

Merge request reports