Cavity modelling in stacked quantum well slabs for optically pumped lasers