A detailed description of the analysis of the decay of neutral kaons to ${\mathrm{\pi^+\pi^-}}$ in the CPLEAR experiment