Add PairwiseDetectionExplicitFunction, pair-programming with @martinsch