GaAs/InGaAs/AlGaAs optoelectronic switch in avalanche heterojunction phototransistor vertically integrated with a resonant cavity