Effects of electrical contacts on the photoconductive gain of nanowire photodetectors