Structural effects on carrier doping in carbon nanotube thin-film transistors