Advanced data analysis procedure for hard x-ray resonant magnetic reflectivity discussed for Pt thin film samples of various complexity

X-ray resonant magnetic reflectivity (XRMR) is a powerful method to determine the optical, structural and magnetic depth profiles of a variety of thin films. Here, we investigate samples of different complexity all measured at the Pt L$_3$ absorption edge to determine the optimal procedure for the analysis of the experimental XRMR curves, especially for nontrivial bi- and multilayer samples that include differently bonded Pt from layer to layer. The software tool ReMagX is used to fit these data and model the magnetooptic depth profiles based on a highly adaptable layer stack which is modified to be a more precise and physically consistent representation of the real multilayer system. Various fitting algorithms, iterative optimization approaches and a detailed analysis of the asymmetry ratio features as well as $\chi^2$ (goodness of fit) landscapes are utilized to improve the agreement between measurements and simulations. We present a step-by-step analysis procedure tailored to the Pt thin film systems to take advantage of the excellent magnetic sensitivity and depth resolution of XRMR.


Introduction
Since the famous experiments by Walter Friedrich, Paul Knipping and Max von Laue [1] as well as Lawrence and William Henry Bragg [2], the analysis of condensed matter by x-ray radiation is one of the most important characterization Original Content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
techniques for any kind of solid states. Here, x-ray reflectivity (XRR) is a well-established powerful tool to determine layer thickness, analyze the density depth profile, and characterize the quality of interfaces [3][4][5].
Nowadays, XRR is usually evaluated by a simulation and fit of the experimental data utilizing the recursive Parratt formalism [6]. In this process, a multitude of structural and optical parameters have to be considered confronting the fitting algorithms with a wide parameter space. Therefore, the choice of an appropriate fitting algorithm is a nontrivial process since various non-global optimization algorithms only converge to local optima [7].
The modeling becomes even more complicated when we combine reflectivity techniques with the energy tuneability and polarization properties of synchrotron x-ray sources. When tuned to the absorption edge energies, XRR is sensitive to the magnetic moments of the selected element due to the x-ray magnetic circular (XMCD) and linear dichroism influencing the intensity of the reflected and absorbed light [8][9][10][11][12][13][14][15]. This expands the parameter space into the magnetooptic regime, considering the atomic scattering as a function of the magnetic properties.
Combining XRR with XMCD creates a technique that unites the structural and optical depth profiles of the reflectivity experiment with the magnetic information of a given element, thus obtaining a highly accurate magnetooptic depth profile. X-ray resonant magnetic reflectivity (XRMR) measures the change of the specular reflection intensity when the direction of either the circular polarization or applied external magnetic field is reversed in order to obtain the spin depth profile of a material at a specific absorption edge [16][17][18][19][20][21][22].
While XMCD only gives the mean polarization of a thin film, XRMR combines this magnetic information with conventional XRR depth profiling and therefore provides additional spatial resolution which is very high on the order of 1 Å [23,24]. This gain in magnetic information comes at the expense of a more complex analysis since we add the magnetic dimension to the probed parameter space. For particularly complex systems, additional structural information, e.g. surface roughness may be necessary to accurately simulate a multilayer system, especially given that the roughness model is indistinguishable between smooth chemically diffuse or rough diffusion-free interfaces. The structural accuracy directly influences the modeling of the magnetic depth profile. However, there is no standard procedure to analyze XRMR asymmetry ratios even though determining the magnetic depth profile of a thin film is essential for a deeper understanding of spin transport phenomena. These include for instance anisotropic magnetoresistance contributions in spin Hall magnetoresistance measurements [25], anomalous Nernst effects in spin Seebeck experiments [26,27] as well as contributions of the magnetic proximity effect (MPE) in spin-orbit torque devices [28].
Here, we present the spin polarization depth profile of Pt in different types of thin films investigated by interface-sensitive XRMR in the hard x-ray regime. We use ReMagX, a software developed specifically to analyze XRMR curves [29], in order to fit specular reflectivity and asymmetry ratio curves and subsequently determine the magnetooptic depth profile. We show the steps to achieve a real best-fit for the XRR and XRMR scans of three specific systems for which Pt is integrated in the sample in an increasingly complex manner from simple bilayer over multi-layered stacks to Heusler compounds that include Pt.
First of all, we study a Pt/Fe//MgO bilayer system to illustrate the basic principles of the XRMR analysis describing the MPE in Pt and highlight the pros and cons of the different modeling modes. The detailed analysis of a second system, in which Pt is an integral part of a complex multilayer made of a single Pt layer adjacent to a Co layer that induces MPE, is discussed in appendix C [30,31]. The third example is a PtMnSb thin film, a half-metallic Heusler compound, which is an interesting candidate for studies of intrinsic spin-orbit torques [32], with and without a single Pt layer on top.
Besides versatile fitting algorithms and optimization approaches to improve convergence between measured and simulated reflectivity data, we employ an advanced element specific fitting mode to simulate separate density and magnetic depth profiles. Finally, we outline a procedure to analyze features of the XRMR asymmetry ratios in great detail. This process turns out to be crucial for the precise identification of MPE or a magnetic dead layer of Pt based multilayer thin films and comparable systems. In the following, we discuss common limitations of the prevalent analysis procedures and expand the standard approach to optimize the results of our various Pt L 3 XRMR measurements.

Applicable steps and limitations in the refinement of the XRMR analysis
The studies discussed in the following are examples of the current XRMR literature presenting possible solutions to improve the significance of the obtained results with regard to the study of the Pt specific magnetic depth profiles in bi-and multilayer systems. For instance, many simulations of the specular reflectivity and asymmetry ratio can be found in literature which do not fit the data within the constraints set by the model or yield ambiguous results. The discrepancies are occasionally attributed to very noisy data in critical regions of the simulation [33].
There are various approaches to challenge these methodical limitations usually resorting to additional degrees of freedom in the structural and magnetooptic simulation process or gathering more structural and magnetic information on the system. The biggest challenge is to find a modeling method to extract the magnetic depth profile unambiguously, which has been addressed in manifold ways usually explicitly tailored for specific samples so far.
In general, very few constraints or a vague model allow for the simulation of a perfect asymmetry ratio. However, the interpretation of the simulated magnetooptic parameters is often inconsistent and not convincing. Depending on the system being investigated and the x-ray photon energy, different methods are thus utilized to counter those limitations and to exploit the excellent sensitivity of the XRMR technique to probe magnetic phenomena.
Complex interfacial depth profiles are often accounted for by multi-slicing layers, a method which facilitates a perfect agreement between experiment and simulation at the expense of numerous free parameters to model interface transitions. Those simulated depth profiles should thus be interpreted very carefully regarding diffusion, hybridization, exchange interactions or other interface effects. As shown by Awaji et al [34], multiple depth profiles of magnetism have to be evaluated to rule out the implausible variations and to show the most probable solution. Another approach is to revert back to theoretical calculations to refine the specifications of the simulated magnetic depth profiles for an unambiguous result [35].
A reasonable first step to refine the fitting process is to determine the sample structure by fitting reflectivity measured at energies far from the resonance to be able to derive a magnetic depth profile from a fit of resonant data with constant structural parameters later on. This supports the XRMR studies on thin films reported in the hard x-ray [22] as well as in the soft x-ray regime [36]. Where applicable, the magnetization can be split and confined to separate interface layers [37] similarly to the structural part. Thus, it can be modeled by an inhomogeneous distribution of magnetization throughout the magnetic layer via additional sublayers [38]. In some studies, primarily the charge peaks (resonant reflections) or only the main features of the asymmetry ratio are taken into account [39,40] to enable an adequate simulation.
Even a combination of these modeling steps does not guarantee a successful simulation of the magnetic depth profile since the information derived from simpler models may be insufficient to reproduce the observed magnetic reflectivity [41]. Performing polarized neutron reflectivity experiments [42,43] can refine the simulated complex magnetization depth profiles in heterostructures [44,45] and provide results which are not even supported by one of the techniques separately [46]. However, neutron reflectivity is only sensitive to the total magnetic moment and cannot distinguish between the magnetic moments of the different elements. Furthermore, the yield of magnetic information by neutron reflectivity takes much more time, especially for small magnetic moments as in the case of interface magnetism or MPE.
As shown by Zafar et al, multiple measurements and simulations on one system should be performed to check how robust the simulated magnetic depth profile actually is, especially when XRMR is used to detect very small moments or tiny spin polarized layers [47].
This variety of complex approaches used to compensate for the limitations of the standard XRMR analysis procedures underlines the need for a consistent and reliable method, e.g. to study MPE samples of increasing complexity. In the following, we establish a step-by-step procedure to obtain robust results of the Pt specific magnetic depth profiles in bi-and multilayer thin films.

Experimental and theoretical details
In our work, we focus on XRMR measurements performed on systems with increasing complexity but at the same absorption edge to facilitate the comparison. The resonant XRMR scans were measured at a fixed photon energy slightly below the whiteline energy of the Pt L 3 absorption edge at the maximum of the magnetic dichroism [17,21,24,48]. We prepared three different multilayers on 10 × 10 mm 2 MgO (001) and SiO x /Si(001) substrates by magnetron sputter deposition in Ar + atmosphere in the range of 3 × 10 −3 mbar in two different sputter deposition systems at Bielefeld University. The epitaxial Pt/Fe//MgO(001) bilayer and TaO x /MgO/Ta/Co/Pt//SiO x /Si(001) multilayer were deposited at room temperature. In contrast, the PtMnSb thin films were prepared at high temperatures to achieve optimal growth without utilizing any seed layer [32] and were in situ capped with either AlO x /MgO or Pt. The theoretical and experimental details regarding the XRMR measurements and beamline specifications can be found in appendix A.
The goal of the magnetooptic analysis is to accurately extract the structural and magnetic depth profiles. Therefore, the layer thickness and roughness are usually defined as free fitting parameters within realistic intervals while literature values are used to keep the optical constants fixed during the first step of the optimization process. In case of the Pt/Fe bilayer, the off-resonant XRR measurements 100 eV below the Pt absorption edge were used to determine the correct structural properties which were in turn used to derive the optical constants at the resonance energy. Here, each element is assumed to have a homogeneous layer density based on the epitaxial growth [32] as well as a finite interface roughness which are determined far from the absorption edge. This procedure detailed by Klewe et al [22] is only applicable for simple and well-defined systems that are easy to model with high accuracy (e.g. bilayers with smooth interfaces).
For structurally more sophisticated systems or systems with a distinct level of inter-diffusion, interface roughness, oxidation or a general sample inhomogeneity, the structural parameters are not fully transferable. Based on experience, the thin film model is usually limited to the most reasonable parameters. However, these can be insufficient when dealing with structurally complex systems exhibiting various minor inhomogeneities which are not independently parameterized following the principle of Occam's razor. Here, the fitted parameters have to account for the inevitable shortcomings of the applied model. Generally speaking, all sample complexity beyond the model capability is compensated to a certain degree by minor adjustments of the structural and optical parameters. Since these best-fit approximations are not necessarily independent of the photon energy, the transferability of the structural parameters is not guaranteed. In that case, the structural parameters should be first extracted by modeling the resonant XRR intensity I and then used as input parameters in the XRMR analysis of the asymmetry ratio ∆I. The exact process of calculating this ratio in the XRMR measurement is detailed in appendix A.
The non-magnetic reflectivity is simulated as a function of the scattering vector q = 4π/λsin(θ) using the recursive Parratt algorithm [6] and a Névot-Croce [49] roughness model. This approach is fine to determine the structural and optical depth profiles, but not sufficient to obtain a fully accurate model of the asymmetry ratio. Therefore, we use a full matrix-based magnetooptic representation. The asymmetry ratio is simulated relying on a Zak matrix [50] formalism which simulates the roughness by adaptively slicing the interface into a series of segments. As a result, the sample is divided into thin layers of which each section has optical and magnetooptic properties corresponding to the density and magnetic depth profile spread vertically through the layer stack. A step-by-step guide to the basics of analyzing reflectivity measurements is presented in the review by Macke and Goering on magnetic reflectivity of heterostructures [20].
The quality of the asymmetry ratio simulation is always determined by the sum of the squared error of every asymmetry ratio data point ∆I i . The goodness of fit of the specular reflectivity is defined as since the detected intensity I i decays by orders of magnitude as a function of q. However, this method of least squares based on simple optimization is not sufficient to define a good fit. Due to the often complex sample structure and variety of free parameters, χ 2 usually has a multi-dimensional landscape with numerous local minima impeding simple downhill algorithms [51]. For more complex thin films with numerous structural parameters a second more sophisticated optimization algorithm is required. Hence, the asymmetry ratio simulation and its corresponding χ 2 landscape have to be analyzed in great detail to obtain reliable solutions for non-trivial magnetic depth profiles. It is especially important to set reasonable constraints to the fitting parameters and to use the most probable starting configuration determined from the sample growth as well as a procedure sampling the complete configured parameter landscape like a heuristic algorithm. Therefore, aside from the standard Simplex optimization algorithm, an evolution approach based on a generic algorithm fitting routine [52][53][54] was implemented in ReMagX. The procedure for modeling reflectivity curves of thin films is usually based on layers of different materials or compounds with a homogeneous density. Therefore, the modeling of thin films utilizes a specific list of the various layered materials or compounds, of which thickness, roughness of the interfaces as well as the dispersion and absorption coefficients δ and β are the defining parameters. Beside this layer specific fitting (LSF) mode, ReMagX supports an advanced element specific fitting (ESF) mode to simulate separate density and magnetic depth profiles. In this work, we combine the ESF mode with a detailed analysis of the asymmetry ratio features and χ 2 landscape to determine a global best-fit of the XRR and XRMR data and create a consistent representation of the structural and magnetic depth profiles of our bi-and multilayer thin films.
Element specific simulations are based on separate depth profiles for each element with specific scattering factors [55]. This method enables us to model entirely different depth profiles for each element of a thin film or heterostructure. It can also be extended to describe a depth profile based on an exclusive magnetic scattering factor (no non-magnetic scattering contribution) and, thus, allows us to simulate a layer independent magnetization. Therefore, separate layer depth profiles are used for each element in the ESF mode with specific scattering factors f 1 and f 2 . Here, the magnetic depth profile is modeled using a separate dummy element having the scattering factors set to zero and the magnetic scattering factor f m = f 1m + if 2m providing the magnetooptic properties. For comparison, the asymmetry ratio is also fitted in the classical LSF mode, simulating the magnetooptic ∆δ and ∆β depth profiles and specifying the magnetization dependent changes in the optical parameters of the refractive index.
When it comes to analyzing reflectivity data obtained for complex multilayers with structures possessing imperfect interfaces, significant contamination or oxidation, even this advanced ESF technique is still no guarantee for a successful simulation of the asymmetry ratio. Therefore, we suggest an extended analysis approach, including χ 2 mapping, to avoid discrepancies within the results and to reduce the need for further measurements, which is a common problem in diverse XRMR studies of comparable thin film systems.

Results and discussion
In the following, we outline a systematic method to simulate XRMR asymmetry ratio data and achieve reliable XRMR simulations for our increasingly complex Pt based structures without the implementation of any additional layers, unreasonable fit parameters or supplementary measurements.

Standard Pt/Fe bilayer
In order to visualize the difference between the layer and independent element based simulation methods and to point out the strength of the ESF mode of ReMagX, we present a direct comparison of both simulations in figure 1. Here, we show the XRR intensity I and corresponding asymmetry ratio ∆I of a Pt/Fe bilayer on MgO measured at the Pt L 3 edge. This is a prominent example of an MPE in a bilayer [21], for which an unambiguous asymmetry ratio is observed, and confirms the presence of spin polarization at the Pt/FM interface. The specular reflectivity curve of this sample is shown in figure 1(a) along with the corresponding best-fit simulation. They show Kiessig fringes [56,57] with the expected oscillation length ∆q Fe and faint overlaying additional Kiessig fringes with the oscillation length ∆q Pt . These determine the Pt thickness to be 3.0 nm and the Fe thickness to be 9.5 nm with a roughness of 0.3 nm and 0.5 nm, respectively, and an MgO substrate roughness of 0.2 nm. Figures 1(c) and (e) present the magnetic asymmetry ratio with an amplitude of up to 4 % and corresponding fits obtained by the different layer and element specific modes of ReMagX. Figure 1(b) shows the optical depth profiles for the real δ and imaginary parts β derived from the reflectivity simulation. This is fundamental for the simulation of the magnetic depth profile using the LSF mode, by which the magnetooptic depth profile is derived from a convolution of a Gaussian function with the optical depth profile. Thus, we derive the ∆δ and ∆β depth profiles at the Pt/Fe interface based on the optical depth profile of the atoms at the chosen absorption edge, in this case Pt [22]. This is illustrated in figure 1(d), where the best-fit places the Gaussian function far into the Fe layer, yet the convolution with the interface roughness of Pt yields the reasonable ∆β depth profile close to the Pt/Fe interface as illustrated in the inset of figure 1(d). Notably, the full width at half maximum (FWHM) of the Gaussian function is much larger than the FWHM of the resulting magnetic depth profile (compare black and red curve in figure 1(d)). The corresponding fit of the asymmetry ratio perfectly simulates all main features despite an increasing noise level for higher scattering vectors q.
We repeated the simulation using the ESF mode with separate element specific density depth profiles. Here, we obtained an equivalent simulation and confirmed that this mode is as precise as the conventional LSF approach when modeling simple magnetic layers (see figure 1(f)), yet more flexible in the simulation of realistic magnetic depth profiles especially of more sophisticated magnetic systems. Since the magnetooptic parameter ∆δ is close to zero at the absorption edge [21], we focus on the parameter ∆β. This parameter is now modeled as an independent layer with its own thickness and interface roughness. So it has to be constricted to the sample structure to model a realistic spin polarized layer at the interface. In the ESF mode, this is done by assuming that the magnetic depth profile adapts the structural interface roughness between the non-magnetic metal and the ferromagnet layer, which is therefore significantly affecting the magnetic coupling [22,58].
Simulating a magnetic depth profile based on a discrete layer adapting the roughness of the Pt density depth profile results in a magnetooptic ∆β depth profile very similar to that obtained using the LSF mode by convolving the Gaussian function with the optical depth profile. Both results are directly compared in the inset of figure 1(d), revealing a minor increase in ∆β on the right flank of the corresponding depth profile (100-115 Å from the substrate) derived in the LSF mode in relation to the ESF solution. Overall, the ESF simulation of the asymmetry ratio only shows slight variations from the LSF result constituting an equivalent best-fit quality. Hence, one should consider utilizing the ESF mode to benefit from the versatility in modeling complex compounds and multilayer structures as well as independent magnetic depth profiles.
We can calculate and analyze the multi-dimensional χ 2 landscape to optimize our fitting routine and determine a true global best-fit. Since this is a problem scaling with the number of free parameters in our simulation, we focus on a simple fit of the XRR intensity in the ESF mode and two specific parameters for illustration. In figure 2, the simulation of the Pt/Fe bilayer reflectivity is mapped onto the χ 2 landscape determined as a function of the thickness d and roughness σ of the Pt layer. The XRR best-fit at the global minimum is compared to two adjacent fits in local minima clearly showing a deviation from the experimental Kiessig fringes because of a variation in thickness. Due to the nature of the oscillatory pattern, we see multiple local minima at fixed multiples of d Pt . In general, higher values of Pt roughness σ Pt are accompanied by increasing χ 2 effective errors. A downhill algorithm operating on this simple map could easily fit the reflectivity if all other parameters are already determined. Naturally, the multi-dimensional χ 2 landscape is highly complex when we vary the parameters outlined above to simulate a real multilayer system.
Selected other 2D maps within the same multi-dimensional landscape of χ 2 are presented in figure 3. These maps serve to illustrate the principles of a detailed analysis of the χ 2 landscape. Although the global minimum is pronounced in every displayable combination, we see many local minima demanding heuristic algorithms. The values of χ 2 in figure 3(a) are determined by varying the Fe and Pt thickness parameters d Fe and d Pt which induce a combined oscillatory character. This results in a striped oscillatory pattern rotated by 45 % relative to the coordinate axes. Here, the pattern is defined by multiples of d Fe and d Pt evenly arranged with regard to the best-fit parameters in the center of the map (see appendix B).
In contrast, the maps generated by varying the thickness in one dimension and the corresponding roughness in the other show an interference like pattern. The map displayed in figure 3(b) was analyzed in figure 2 and is included here for the sake of completeness. Figure 3(c) illustrates the map as a function of the Fe layer thickness d Fe and the Fe roughness σ Fe while figure 3(d) is a function of both roughnesses σ Pt and σ Fe . The run through the d Fe dimension of the χ 2 map reveals the established oscillatory pattern while higher values of Pt roughness σ Pt again lead to increasing χ 2 values. In both maps of figures 3(c) and (d), the roughness of the upper Fe interface σ Fe yields particularly broad minima along this parameter dimension which indicates a higher level of uncertainty regarding this value in the simulation. Therefore, σ Fe must be confirmed by secondary measurements or a detailed check of χ 2 to restrict this parameter to realistic values. This example illustrates how important a detailed analysis of the χ 2 landscape is to determine the real best-fit. Moreover, the simulation of asymmetry ratios can be equally sophisticated. The χ 2 maps defined by the simulation of the asymmetry ratio and thus the magnetooptic depth profiles are presented at the bottom of figure 3. The χ 2 landscape of map figure 3(e) is generated by a variation of the magnetic depth profile roughness σ Pt,mag in relation to the FWHM of the magnetic depth profile FWHM Pt,mag . This effective thickness of the magnetic Pt depends on the thickness d Pt,mag of the initially used magnetic layer that becomes the magnetic depth profile ∆β of figure 1(f) when the magnetic roughness σ Pt,mag is taken into account. Here, the dependence is FWHM Pt,mag = 0.0198 nm −1 · d 2 Pt,mag + 0.0476 · d Pt,mag + 11.5 nm for Pt(3.0 nm)/Fe(9.5 nm)//MgO. The map shows a distinct global minimum and no local minima which allows us to obtain an optimal solution in this simple case by utilizing a basic downhill fitting algorithm. This approach is equally applicable when the magnetooptic parameters ∆δ and ∆β are determined in the asymmetry ratio simulation since the 2D χ 2 map figure 3(f) illustrates a global minimum best described as a χ 2 well. In general, it is particularly important to check multiple χ 2 maps, as presented in figure 3, when there are local minima close to the global best-fit. These minima usually represent good fits yet semi-optimal solutions which can impede optimal simulations of the asymmetry ratio established on the corresponding structural parameters.
A similar analysis of a structurally more complex system still involving an interface of Pt adjacent to a 3d ferromagnet is presented in appendix C. This sample is particularly challenging due to a partially inhomogeneous multilayer structure and intermixed oxide based capping which has a significant influence on the reflectivity curve. A combination of fitting algorithms and an in-depth examination of the χ 2 maps is presented in order to identify the global best-fit minimum and ultimately the MPE based magnetic depth profile within the buried Pt layer [28].

Half-Heusler compound PtMnSb with and without additional Pt layer
When we analyze the structurally and magnetically more complex PtMnSb bilayer system, the need for a detailed XRR and XRMR analysis becomes obvious, in particular for the investigation of the magnetic depth profile in an AlO x /MgO capped system. Figure 4 summarizes the fit results of the reflectivity and asymmetry ratio scans and the corresponding optical, density and magnetooptic depth profiles. Figure 4(a) shows an almost perfect XRR fit of the experimental data with only slight deviation for scattering vectors q > 0.2 Å −1 . The optical depth profile presented in figure 4(b) is dominated by the homogeneously grown half-Heusler compound. The oxidized capping layer primarily shapes the decline of δ and β at the air interface since the intermixed light elements exhibit optical parameters roughly one order of magnitude lower than PtMnSb at the Pt absorption edge.
The fitted asymmetry ratio is presented in figure 4(c). Here, every main feature of this curve is reproduced within the bestfit. The only major deviation can be found at the third peak of the asymmetry ratio. However, the nature of the deviation is highly important to determine the quality of the fit which is discussed in detail later on. This asymmetry ratio feature is in principle part of the simulated curve at an identical scattering vector merely with a smaller amplitude. The density depth profile obtained from the XRR analysis and the magnetooptic ∆β depth profile calculated within the XRMR simulation are combined in figure 4(d). This magnetic depth profile is the best fit result representing a uniformly magnetized half-Heusler layer with an unpolarized layer at the upper interface probably due to oxidization.
Based on this simulation result, we analyze the χ 2 landscape of the magnetooptic depth profile parameters of the lower and upper PtMnSb interface. Figures 5(d) Here, we focus on minor details of the fit to draw conclusions from this XRMR analysis regarding the Pt magnetization depth profile. The displayed difference in the magnetic depth profiles of Pt at the bottom interface (compare figures 5(c) and (d)) most significantly changes the slope of the asymmetry ratio features as shown in figures 5(i) and (j). An even closer look at the simulated asymmetry ratio is necessary to investigate the magnetic Pt depth profile at the upper interface (compare figures 5(d) and (e)). The asymmetry ratio simulation of the best-fit depth profile and the extended magnetic depth profile (see figures 5(g) and (h)) are hard to differentiate by eye and closely follow the measured dataset with only marginal differences in the third and sixth feature of the scan. However, this is exactly the part of the asymmetry ratio simulation we have to take into account very carefully since an adequate fit here is crucial for the identification of the real magnetic Pt depth profile. When we compare the enlarged graphic parts figures 5(j) and (k) it appears that the first dip of the feature is not exactly modeled and the upwards counterpart is exaggerated in the case of the extended magnetooptic depth profile. This small difference, conveniently but not necessarily accompanied by a lower value of χ 2 , serves to identify the most probable magnetic Pt depth profile which includes an unpolarized Pt layer at the oxide interface.
The detailed XRMR analysis based on the variation of the magnetooptic depth profile of an identical layer of 20.5 nm PtMnSb capped with 3.4 nm Pt instead of AlO x /MgO is presented in figure D2 and discussed in appendix D. In accordance with the results presented here, we are able to eliminate the possibility of a pronounced magnetic dead layer at the substrate interface of the Pt/PtMnSb bilayer based on a detailed analysis of the main periodic features of the asymmetry ratio and the corresponding χ 2 maps. The potential extension of the magnetic depth profile into the Pt layer is considered as well, however the simulated asymmetry ratio based on an extended magnetic depth profile involves an inconspicuous yet important deviation between data and fit. The best-fit solution represents a magnetic depth profile which is closely resembling the determined structural half-Heusler depth profile yet identifying a few angstroms of unpolarized Pt at both interfaces.

General XRMR analysis recipe procedure
The XRMR analysis presented here for samples at the Pt L 3 edge is summarized in a process flow diagram. Due to its wide applicability for structurally similar bi-and multilayer thin films, a guideline for the XRMR evaluation is created which includes all options for an improved fit convergence discussed in this work. This recipe procedure for the determination of a robust XRMR asymmetry ratio simulation is summarized in the flowchart presented in figure 6. The core is based on the guide for analyzing XRMR measurements presented by Macke and Goering [20] extended by the conclusions of our work. The whole procedure can be divided into three sections: the spectroscopic, structural and magnetic analysis.
Within the spectroscopic analysis, the first step is to scale the resonant x-ray absorption spectrum (XAS) to the tabulated off-resonant values of the absorptive optical parameter β [59,60], which enables us to derive the corresponding dispersive part δ of the index of refraction via a Kramers-Kronig transformation. Hence, this step requires a measurement of the material absorption. An alternative is to perform ab initio calculations of the energy-dependent absorption which is increasingly difficult for complex materials when the Coulomb interaction is not negligible.
The central part of this procedure is the structural XRR analysis in order to obtain the correct thickness, roughness as well as optical parameters. Here, off-resonant XRR data is useful to eliminate any influence of the absorption edges. However, the reliability of the obtained optical fitting parameters must be checked since a direct transferability is only valid within the strict constrains and complexity level of the employed model. Additional information on the composition and material growth is beneficial in assessing the obtained parameters. In particular the optical constants should be checked for their reliability in order to evaluate the applicability of the model. When the structural model has been determined with adequate quality, the obtained information is used as the structural basis on which a reasonable and parameterized magnetic model can be developed for the XRMR analysis. The thereby obtained magnetooptic depth profiles are subsequently optimized based on a detailed analysis of the χ 2 landscapes and asymmetry ratio features until satisfactory results are achieved. Where possible, measurements at further photon energies of interest should be performed, specified with the help of the spectroscopic analysis, in order to separate out different models. For instance, XRMR scans at the L 2 edge or the inflexion point of the dichroic response are useful to create a robust model of the magnetic depth profile. Recipe procedure for the determination of a robust XRMR asymmetry ratio simulation for our bi-and multilayer systems. The central blocks of the spectroscopic, structural and magnetic analysis correspond to the general steps suggested by Macke and Goering [20]. The structural part includes the more accurate evaluation procedure using off-resonant scattering data presented by Klewe et al [22] and additionally takes into account the possibility of an impeded transferability of the structural parameters. The additional boxes demonstrate the alternative approaches and more complex analysis methods discussed here. Proceeding options regarding χ 2 landscape and asymmetry ratio feature analysis are appended in red while optional methodical alternatives are presented in grey and improvements in green, respectively. Beneficial fitting options implemented in ReMagX are shown in blue.
The applicable improvements (green) and advanced proceeding options (red) are discussed here and by Klewe et al [22]. Options available in the program ReMagX are presented in blue. The basic steps of the conventional approach, outlined in the center, are sufficient for most simple systems such as bilayer samples. The multi-slicing method is accompanied by the introduction of various free parameters often leading to complex depth profiles, but less physically feasible results. For more complex heterostructures and multilayer systems, the extended steps beyond standard procedures are recommended for a detailed analysis.

Conclusion
In conclusion, we have investigated various samples of increasing complexity by means of XRMR at the Pt L 3 edge and determined a robust procedure for the analysis of the measured XRMR curves. We have shown that methods based on simple downhill algorithms used to simulate the XRMR measurements are reaching their limit when investigating magnetic profiles with a complex landscape of χ 2 and proposed methods to reliably obtain qualitative and quantitative fits without the need for additional measurements or exploiting further unrealistic degrees of freedom in the simulation. Furthermore, we utilized the software tool ReMagX to fit the experimental curves and model magnetooptic depth profiles based on different fitting algorithms, iterative optimization approaches and a detailed analysis of the asymmetry ratio features as well as χ 2 landscapes in order to improve the agreement between the XRMR data and simulation.
We have investigated a standard Pt/Fe bilayer to discuss the difference between layer and independent element based simulation methods. The latter is preferable for the independent modeling of nontrivial magnetic depth profiles. The supporting detailed analysis of the complex multi-dimensional χ 2 landscape has been introduced as a fundamental tool to determine accurate structural and magnetooptic depth profiles. Additionally, the detailed study of the dominating asymmetry ratio features is introduced as a potent method to determine and evaluate supposed best-fit solutions. Both approaches are especially important to obtain physically consistent structural and magnetic information of complex sample structures.
Crucial parts of the asymmetry ratio for various magnetic depth profiles in bilayers based on the half-Heusler compound PtMnSb have been studied to visualize the significance of even minimal deviations in an asymmetry ratio simulation and underline the importance of a close examination of the key features to identify the most probable solution. Here, the influence of an oxide capping on the magnetic depth profile has been studied in relation to a Pt capped twin sample, discussed in appendix D. The XRMR study of a multilayer including a Co/Pt interface, which has been investigated to refine our analytic approach for structurally and magnetically complex systems, is presented in appendix C. By developing a recipe procedure for the determination of a robust XRMR asymmetry ratio simulation, in particular applicable for Pt based thin film samples as well as adaptable for a wide range of similar systems, we are able to use the excellent magnetic sensitivity and depth resolution of XRMR to full capacity.

Acknowledgment
We acknowledge DESY (Hamburg, Germany), a member of the Helmholtz Association HGF, and the European Synchrotron Radiation Facility (ESRF) (Grenoble, France) for the provision of experimental facilities. Parts of this research were carried out at PETRA III. We would like to thank David Reuther and Philipp Glaevecke at DESY and the beamline BM28 staff at the ESRF for technical support as well as Tobias Pohlmann, Panagiota Bougiatioti and Johannes Mendil for assistance during the beamtimes. We also thank Sebastian Macke for providing software support of the fitting tool ReMagX and Günter Reiss for making available the laboratory equipment in Bielefeld.

Appendix A. Supplementary experimental and theoretical details
The asymmetry ratio of the reflectivity is measured at the Pt L 3 absorption edge using circularly polarized x-rays at room temperature. The magnetic contrast is achieved in two ways either by flipping a saturating external magnetic field and, thus, the magnetization of the thin film system or by switching the helicity of the circularly polarized light. Each method independently results in slightly different x-ray reflectivity curves when varying the magnetization direction relative to the xray polarization due to a change in the optical constants of the spin polarized material based on the refractive index n = 1 − δ + iβ. Thus, the dispersion and absorption coefficients δ and β are modified by the fraction ∆δ and ∆β defined by the magnetooptic index ∆n = ∆δ − i∆β of the circular dichroism for different magnetization directions. In a geometry, in which the x-ray light is propagating parallel to the magnetization, the complex refractive index is generally expressed by In case of magnetization as well as helicity switching the asymmetry ratio is detected for both x-ray polarizations or magnetization orientations, respectively. For instance, in case of helicity switching, the intensity is collected for right I + and left I − circular polarization for each angle of incidence θ and for the sample magnetization parallel to the scattering vector. The magnetic asymmetry ratio ∆I = (I + − I − )/(I + + I − ) can thus be calculated at each angle. The same measurement can also be repeated with the sample magnetization being reversed. The new asymmetry ratio should thus be equal but opposite in sign. The final asymmetry ratio can thus be extracted by calculating the half difference between the two measurements A c = 1/2 · (A + − A − ). This method allows to subtract non-magnetooptic effects.
The Pt/Fe bilayer and TaO x /MgO/Ta/Co/Pt//SiO x multilayer sample were measured at the P09 beamline at PETRA III (Hamburg, Germany). A single diamond quarter-wave plate was used to produce (99 ± 1)% degree of circular polarization. An external magnetic field of ± 90 mT applied parallel to the sample surface in the scattering plane was produced by a four-coil electromagnet. The reflectivity curves were collected in a conventional θ − 2θ scattering geometry. The PtMnSb thin films were investigated at the XMaS beamline BM28 [61] at ESRF (Grenoble, France) in the same scattering geometry at room temperature using circularly polarized x-rays. A ± 200 mT magnetic field was applied in the scattering plane parallel to the sample surface. The incoming x-ray photons were converted to (88 ± 1)% of circular polarization [62] by means of a diamond phase-plate. To improve the signal to noise ratio, the helicity was reversed at 11.5 Hz by a piezo driven device [63]. The measurements were carried out at the Pt L 3 absorption edge (11 568 eV) and off-resonance (11 468 eV). These energies can be slightly different from our prior XRMR experiments [21,22,24,27,64] depending on the current energy calibration of the beamline.

Appendix B. Analysis of the χ 2 landscape for the Pt/Fe bilayer
The χ 2 landscape spanned by the thickness of the Pt layer d Pt and the Fe layer d Fe is shown in figure B1 together with three reflectivity simulations at particular χ 2 minima of the parameter space. The global minimum of the best-fit is compared to two adjacent local minima on this χ 2 map which is part of the selected 2D landscapes presented in figure 3. The two fits representing the local minima are clearly showing a deviation from the Kiessig oscillations due to a variation in thickness. The global minimum is very clearly located in the center of the map. apparent that those fits are partially inaccurate due to the misrepresented Fe thickness which manifests in a displacement of the Kiessig oscillation and will ultimately preclude simulations of the asymmetry ratio constituted on those structural parameters.

Appendix C. Structurally complex multilayer including a Co/Pt interface
The analysis of a structurally complex multilayer system involving an interface of Pt adjacent to a 3d ferromagnet is presented in figure C1. Depending on the method of preparation and capping, we expect density depth profiles with varying layer roughness and start the simulation process with little information on the diffusive or oxidative condition. Next to the XRR intensity plot with the best-fit simulation shown in figure C1(a), the corresponding optical depth profile is presented in figure C1(b) illustrating the interface positions and roughness parameters for each transition between the elements or compounds in this ESF simulation. The interface positions and the roughnesses of adjacent materials are coupled to each other similar to the simulation in the LSF mode. For the partially oxidized TaO x capping structure, the description of layers consisting of individual elements is not necessary. It is expedient to define a single compound for the capping layer and thus reduce the number of free parameters in the XRR simulation. Here, the structural parameters are not transferable without modifying the off-resonant XRR fit results to the fitting simulation of the resonant XRR due to the increased sample inhomogeneity and complex oxide capping which significantly alters the reflectivity curve. The reliability of the optical constants has to be checked in order to guarantee that structural and optical parameters are fitted within realistic physical intervals based on the resonant reflectivity curve.
Optimizing the fit of the XRR intensity with a combination of an evolutionary algorithm and a simplex fitting approach allows us to determine the best parameters. Due to the challenging modeling of the capping layer, the XRR fit is reasonably accurate yet no perfect agreement with the obtained curve is reached in particular for higher scattering vectors q. As a consequence, the simulated asymmetry ratio has to be carefully tested to determine the influence of these inaccuracies since the magnetooptic depth profile is directly connected to the obtained structural parameters. The experimental asymmetry ratio and best simulation are plotted in figure C1(c) where every major characteristic of the presented curve is reasonably featured by the simulation although the measured ratio is on average below 2%. Figure C1(e) shows a close-up of the Pt magnetic depth profile of this sample fixed to the right flank of the Pt density depth profile. Thus, the Pt magnetic depth profile follows the Pt density depth profile at the interface and drops towards the substrate following the depth profile of a realistic magnetooptic depth profile (compare figure 1(d) and inset).
The importance of accurately modeling every feature of a reflectivity or asymmetry ratio becomes apparent when we examine the χ 2 map of this heterostructure spanned by the thicknesses d Co and d Pt shown in figure C2. In principle this map is comparable to the one presented in figure 3(a) since it is spanned by a variation of two thickness parameters thus establishing an oscillatory pattern of local minima. Here, we can clearly identify the global minimum broadened along the map diagonal as observed for the Pt/Fe bilayer. However, due to the irregular nature of the Kiessig fringes of this complex multilayer, the oscillatory pattern is diluted resulting in a landscape of various overlapping and a few sharp local minima. The XRR intensity simulations in figures C2(a) and (c) show two distinct fits using the parameters of local minima. The first one illustrates a sharp local minimum being close to the global minimum (figure C2(d)) which represents the best-fit established in figure C1. The difference in the fit quality between the local minima is dramatic although the parameters of the worse fit are similar to the best-fit except for d Pt while the objectively better fit is far from the global minimum in both mapped parameters. The reflectivity simulations in a local (figure C2(a)) and the global minimum (figure C2(d)) differ in just fitting one Kiessig fringe at the start of the reflectivity curve. However, the simulation is a good coarse fit which cannot be optimized by established fitting algorithms in this local minimum and would ultimately render the subsequent asymmetry ratio simulation impossible.
If we want to take advantage of the excellent sensitivity of XRMR in detecting magnetic depth profiles and variations of those in a series of samples, we have to analyze the features of our reflectivity and asymmetry ratio data in detail. This is ultimately more important than a pure minimization of χ 2 since a straight line can qualify as a stable fit through an oscillation in extreme cases.
In  σ Pt at the Co interface. The fit shown in figure C3(c), representing a local minimum at half the Pt thickness of the best simulation, coarsely matches most Kiessig fringes in the first part of the plot yet it lacks accuracy at higher values of the scattering vector q. Figure C3(d) shows a fit in a shallow local minimum. However, the quality of this fit is hardly better than a straight line through the middle of the oscillations although it is a stable minimum in terms of χ 2 inescapable by a standard simplex algorithm [65]. Furthermore, the χ 2 map is highly anisotropic. While the thickness d Pt is defined precisely by the global minimum which is steeply sloping along this axis within the map, χ 2 is increasing only marginally when leaving the global minimum along the axis defined by the parameter σ Pt . In order to take advantage of the outstanding sensitivity of XRMR to magnetic moments at interfaces, the roughness should be defined precisely in the reflectivity simulation. Therefore, the best-fit value for the roughness has to be identified as an unambiguous global minimum on the χ 2 landscape and if possible confirmed by other methods such as transmission electron microscopy.
Sections of the complex multi-dimensional χ 2 landscape for TaO x /MgO(2.6 nm)/Ta(3.3 nm)/Co(1.8 nm)/ Pt(2.9 nm)//SiO x are presented in figure C4. In particular, it shows the maps spanned by the Pt and Co thickness, the corresponding roughness values, the FWHM of the magnetic depth profile along the z-direction (distance from the substrate) FWHM Pt,mag and the roughness of its lower boundary σ Pt,mag as well as the magnetooptic parameters ∆δ and ∆β. Similar to the sectioned map shown in figure 3 for the Pt/Fe//MgO bilayer system, we see many local minima obligating us to an asymmetry ratio analysis starting with heuristic algorithms. The 2D landscape presented in figure C4(a) shows the same parameter space probed and discussed in terms of figure C2(b). However, in this selection the axes are inverted to fit the map compilation. Map figure C4(b) is discussed in figure C3 with regard to the analysis of the XRR simulations. The χ 2 map of figure C4(c) is again highly anisotropic. In this case, the thickness d Co is defined precisely by the global minimum while χ 2 is only slightly increasing when the global minimum is left probing the parameter σ Co . The χ 2 map of figure C4(d) based on both σ Co and σ Pt roughness parameters reveals a global minimum steeply sloping towards lower roughness values. It is however particularly spread-out towards rougher interfaces, in general implying higher levels of uncertainty regarding these structural roughness parameters. As stated in the main text, additional information on the interfaces is required for a precise analysis of the structural parameters. By combining various χ 2 maps, as shown in figure C4, we are able to make an educated assessment of the real roughness parameter of the Co/Pt interface which is crucial when investigating the MPE in the multilayer system as outlined above.
The χ 2 landscape of map figure C4(e) is created by varying the magnetic depth profile roughness σ Pt,mag in relation to the FWHM of the magnetic depth profile FWHM Pt,mag . This effective thickness of the magnetic Pt depends on the thickness d Pt,mag of the initially used magnetic layer that becomes the magnetic depth profile ∆β of figure C1(e) when the magnetic roughness σ Pt,mag is considered. Here, the dependence is FWHM Pt,mag = 0.0285 nm −1 · d 2 Pt,mag + 0.191 · d Pt,mag + 5.87 nm for the TaO x /MgO(2.6 nm)/Ta(3.3 nm)/Co(1.8 nm)/Pt(2.9 nm)//SiO x multilayer. This χ 2 map features a global minimum, which increases marginally when leaving the global minimum along both axes. However, the maximum value of χ 2 on this map is 3.7 × 10 −4 , which is one order of magnitude lower than the maximum of the comparable parameter space presented in figure 3(c) for the Pt/Fe bilayer. Independent of the overall χ 2 gradient, the map shows a distinct global minimum and no local minima enabling us to refine the magnetooptic depth profile utilizing a simple downhill fitting algorithm. In figure C4(f), the χ 2 map is spanned by the magnetooptic parameters ∆δ and ∆β demonstrating a χ 2 well with a distinct global minimum. It is similar to the map created with the same parameters for the asymmetry ratio simulation of the Pt/Fe bilayer.

Appendix D. Experimental data and simulation analysis of the Pt/PtMnSb bilayer
Twin samples of the PtMnSb thin film have been prepared replacing the AlO x /MgO capping layer (see figure 4) by Pt as a top layer to investigate possible static MPEs in Pt via XRMR. There is an excellent agreement between the simulation and the reflectivity scan of this bilayer depicted in figure D1(a). The corresponding magnetooptic δ and β depth profiles are shown in figure D1(b) clearly exhibiting the depth profile of the interface transitions within the bilayer. The best-fit of the  Figure D2. asymmetry ratio ∆I generated with the ESF mode accurately reproduces the main features and the oscillations, as illustrated in figure D1(c). This fit is based on the density depth profile of figure D1(d) and results in the magnetooptic depth profile illustrated in the same plot as a function of the distance from the substrate. The magnetooptic depth profile involves no additional spin polarization at the interface in addition to the magnetization inherent to the half-Heusler material. However, the presence of an MPE is highly dependent on the ferromagnetic material and, more importantly, the quality of the interface [21,33]. A detailed study of the MPE in Pt on PtMnSb will be discussed elsewhere. Figure D2 illustrates again a detailed feature analysis regarding the asymmetry ratio simulation of the Pt(3.4 nm)/PtMnSb(20.5 nm)//MgO bilayer. In the middle row we show the global best-fit of the χ 2 landscapes shown in figures D2(a) and (b). In the top row, the simulation of an identical magnetic Pt depth profile with a modification of the lower boundary is shown. Here, we model a magnetic dead layer of 20 Å starting at the interface of the substrate into the PtMnSb layer (see figure D2(c)). The Pt spin depth profile without this dead layer shown in figure D2(d) can similarly be extended at the top boundary of the magnetic depth profile by 20 Å reaching into the Pt cover layer shown in the bottom row in figure D2(e).
We now focus on the feature details of the asymmetry ratio simulations in figures D2(f)-(h). Here, we can rule out a pronounced magnetic dead layer at the substrate interface due to a clear misfit of the main periodic features of the asymmetry ratio ∆I, highlighted in the magnified part of the scan (see figure D2(i)). In spite of a high noise level, due to the relatively tiny asymmetry ratio of below 0.4%, we are able to define a realistic magnetooptic depth profile when carefully analyzing the χ 2 maps. The extension of the magnetic depth profile into the Pt layer is accompanied by an increase of the simulated asymmetry ratio (see figures D2(j) and (k)) and, more importantly, by an offset between data and fit most profound in the center of the asymmetry ratio scan. Comparing the simulations in figures D2(g) and (h), we see a shift in the overall shape of the fit from an upward to a downward directed course of the average curve.
This close look at the simulated asymmetry ratio is essential to investigate the magnetic depth profile with high accuracy. Again, the asymmetry ratio simulation of the best-fit depth profile and the extended magnetic depth profile (see figures D2(g) and (h)) are very similar and show only small, however significant, differences as described above. We have to exercise caution when we evaluate these small deviations in the oscillatory behavior since an adequate fit here is crucial for the identification of an MPE. A close analysis of multiple simulations provides us with the real best-fit and most precise representation of a realistic magnetic depth profile in this system. Figure D3 shows a graphical compilation of highly similar simulations of the asymmetry ratio which yield significantly different magnetic depth profiles. These fits are a result of the XRMR analysis for the Pt(3.4 nm)/PtMnSb(20.5 nm)//MgO bilayer. This specific example shows where a simple downhill algorithms fails to obtain the correct best-fit solution in case of unfavorable starting parameters. When a simple Simplex algorithm is utilized, the simulation can converge to a local minimum representing a decent fit. As illustrated in figures D3(a) and (c), these fits can be almost indistinguishable from the global best-fit solution shown in figure D3(b). Here, only an advanced optimization algorithms such as genetic algorithms or simulated annealing, sampling the whole configuration space, is reliably converging to the global minimum. Once in the overall vicinity of this minimum, a simple downhill algorithms works fine as the final step of the optimization process. In the displayed situation, the use of the genetic, evolution based fit routine can separate the two plausible values which yield a highly similar fit profile as illustrated in the direct comparison of all three fits presented here. The corresponding χ 2 maps presented in figures D3(d) and (e) illustrate the separation of the obtained solutions on the error landscape and visualize the potential barriers encountered by the optimization process. This example illustrates where the use of a genetic algorithms can separate two plausible solutions, which yield highly similar fits yet significantly different magnetic depth profiles, as shown by the distance on these χ 2 maps as well as the range of profiles visualized in figures D2(c)-(e).