Fix bug and change interface of getMaxWeight and move track/cluster encoding parts to MarlinUtil #163
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Make getMaxWeight functionality templated that allows passing any comparator. Moving track/caluster weight encodings functionality into MarlinUtil
Added with LCIO v02-18 (https://github.com/iLCSoft/LCIO/releases/tag/v02-18) utility methods to extract the highest weight for LCRelationNavigator are not working properly.
getMaxWeightIt()
must return max_element in every if branch, otherwise passed "weight" parameter is just ignoredLCIO/src/cpp/src/UTIL/LCRelationNavigator.cc
Lines 72 to 81 in 2a0d5d1
std::string& weightType
as an argument, must have an empty string as a default.We have discussed with @tmadlener that it would be nice to keep the functionality as general as possible in LCIO and have track/cluster specific weight encoding parts in the MarlinUtil, as these encodings are defined only to some specific LCRelation collections which are created by MarlinReco.
This PR fixes bugs described above and changes the interface to be more generic allowing an arbitrary
comparatorfunction as an argument instead of previously string parameter.Two specific comparator function for track and cluster weights will be added to the MarlinUtil soon.
BEGINRELEASENOTES
getRelatedTo(From)MaxWeightObject()
andgetRelatedTo(From)MaxWeight()
now accept generic decode function offloat(float)
signature as a second argument, which specifies how to decode the weight. Default option is identity function (just compares weights as they are).ENDRELEASENOTES