1. A method comprising: obtaining a first spectrum associated with an electron energy excited from one or more elements in a sample film; obtaining a processed spectrum, said processed spectrum having a background spectrum removed from said first spectrum; optimizing a simulated spectrum as a function of element distribution profile for said one or more elements; matching said processed spectrum to said simulated spectrum using a minimization algorithm; and determining a distribution profile for said one or more elements in said sample film based on the matching and minimizing.