Energy loss of electrons impinging upon glassy carbon, amorphous carbon, and diamond: Comparison between two different dispersion laws