A Physics Based Unified Circuit Model for Single Photon and Analog Detector