In situ characterization of rare earth-CdTe heterostructures by ion beam analysis