Optimized getMostActiveSegmentForCells