Energy deposition around swift proton and carbon ion tracks in biomaterials