Calculation and experimental verification of the RBE-weighted dose for scanned ion beams in the presence of target motion