Crystallographic transformation and lifetime of thin carbon foils under ion and laser irradiation