Vertical electropolishing for 1.3 GHz single- and nine-cell superconducting niobium cavities: A parametric optimization and rf performance