In situ characterizations of photoelectrochemical cells for solar fuels and chemicals