The beam-foil excitation technique applied to heavy ion beams (20<Z<81)