1. A method of measuring dimensions for an optical system so as to measure a critical dimension of a sample object comprising: preparing a plurality of standard objects, each of said plurality of standard objects having a grating-shaped standard pattern with a predetermined pitch and line width; selecting a predetermined focus metric algorithm; performing an analyzing process on each of said plurality of standard objects comprising: moving the standard object to a plurality of predetermined off-focus positions with respect to an on-focus position of the optical system; capturing a plurality of off-focus images of the standard object on the predetermined off-focus positions using the optical system; and analyzing the off-focus images using the predetermined focus metric algorithm to generate a plurality of distributions of focus metric values on the predetermined off-focus positions, each of said plurality of distributions of focus metric values having at least one extreme value; analyzing said plurality of distributions of focus metric values to determine target orders from the extreme value and a plurality of characteristic values corresponding to the target orders of said plurality of distributions of focus metric values; generating a reference relation correlating the characteristic values with the line widths of the standard objects; measuring the sample object to acquire a measured characteristic value; and determining the critical dimension of the sample object based on the measured characteristic value and the reference relation.