One dimensional (1D) Schottky diodes between metals and carbon nanotubes (CNTs) can separate the photo-generated electron-hole (e-h) pairs in order to produce photocurrent in the CNT infrared (IR) sensors for detection and quantification. However, the traditional Schottky barrier theories developed for the metal and planar semiconductor contacts are different from the contacts between metal and CNT owing to the unique properties originated from CNT's nano-scale size. Therefore how to optimize the performance of the 1D Schottky photodiodes is still a mystery. The properties of the 1D Schottky diodes are determined by the energy alignment between metals and CNT. In order to improve our understating of its working principle, we not only used different metals to explore the role of metal work function, but also investigated the performances of the photodetectors by varying the Fermi levels of the CNT through electrostatic doping utilizing the gate from CNT field effect transistor (CNTFET). It was observed that a low work function metal electrode (Cu) based photodetector can render a higher on/off ratio than its high work function contender (Au) by suppressing the dark current with a higher barrier. It was also demonstrated photocurrent was maximized by selecting high built-in potential and moderate doping using the CNTFET. CNTs may become important building blocks for future nano-optoelectronic sensors.