Ion-beam-induced reactions in metal-semiconductor and metal-metal thin film structures