Si nanowires with porous segments for photon-triggered transistors