calcDistance function

cofactor selection based on the QTL windowsize