A method for the energy calibration of a heavy ion accelerator