To search peaks, the codes are completely copied from LaueTool