Plasma diagnostics during laser ablation in a cavity