Motivation. We develop a new generalized framework for fitting crystal structures into density maps. The framework includes three new scoring functions that quantify the goodness of fit between the crystal structure and density map: (A) the scattering potential score, which is based on using a more realistic representation of the input crystal structure in terms of the density map, (B) the non-...