Allotropic effects on the energy loss of swift H+ and He+ ion beams through thin foils