Modeling of ultrafast metal–semiconductor–metal photodetectors