A profile model for use in optical metrology of structures in a wafer is
selected, the profile model having a set of geometric parameters
associated with the dimensions of the structure. A set of optimization
parameters is selected for the profile model using one or more input
diffraction signals and one or more parameter selection criteria. The
selected profile model and the set of optimization parameters are tested
against one or more termination criteria. The process of selecting a
profile model, selecting a set of optimization parameters, and testing
the selected profile model and set of optimization parameters is
performed until the one or more termination criteria are met.