basic function for xrf fit