Electromagnetic tracking performance analysis and optimization