In x-ray photoelectron spectroscopy, why is the work function of the sample not considered in the calculations? Why is the work function of the sample is not considered to formula for the kinetic energy of the photoelectron, whereas the work function of detector does get considered?
 A: The short answer to this question is twofold (i) we calibrate the binding energy scale with respect to the Fermi level and (ii) the kinetic energy of the photoelectrons is measured by the spectrometer.
Please see the attached image:

Let me explain what is going on here.


*

*The electron in one of the energy levels of the sample is kicked out by a photon of energy $h\nu$ (the left side of the image). 

*The electron (now it is appropriate to call it a photoelectron) travels in vacuum to the spectrometer (middle part of the image).

*The kinetic energy of the photoelectron is measured by the spectrometer as $E_k$ (the right side of the image).
Now if you look at the "length" of the arrows in the image you can see that
$$h\nu=E_k+\phi_\mathrm{sp}+E_{B}^{F}$$
Becuase the binding energy is almost always scaled to the Fermi level then it is very common to drop the superscript F and write
$$h\nu=E_k+\phi_\mathrm{sp}+E_{B}$$
There you have it; the binding energy of the photoelectron depends on the work function of the spectrometer ($\phi_\mathrm{sp}$) not the sample ($\phi_\mathrm{sample}$).
There is one thing to keep in mind here, that is, this is valid only for the case where the sample is metal (or better to say sufficiently conductive) and the sample and spectrometer are in Ohmic contact, which causes their Fermi levels to align.
*Image source 
A: The work function is important in XPS spectra but we just don't call it a work function.
The work function is effectively a chemical binding energy. If we measure the energy of the electron from an isolated atom then compare it with the energy from an electron in some solid we find they are different. The difference is due to the energy of the interaction between the atoms in the solid.
We see this in XPS and in fact XPS gives us even more detail. For example see this XPS spectrum from silicon (image from Wikipedia):

The peak at $99.69$ eV is from pure silicon while the peak at $102.72$ eV is from silicon atoms in $\text{Si}_2\text{O}_3$ and the peak at $103.67$ is from silicon atoms in $\text{Si}\text{O}_2$. So we see different XPS energies for the same element depending on its chemical environment. These differences are analogous to the work functions that we can measure in optical photoelectron spectroscopy. In effect the different silicon compounds have different work functions.
A: We don't consider the work function of a material when doing X-ray
absorption spectroscopy, because the work function is the energy to remove
an outer electron from a surface.
X-rays (few keV energy photons) interact mainly with inner electrons,
not outer electrons, and the absorption of X-rays does not require
electron ejection from the surface (promotion to unoccupied energy
levels is sufficient).

The step  in the above curve indicates the increased absorption of X-rays when energy is sufficient to eject the inner shell (1S) electrons of copper.   Those two electrons absorb an order of magnitude more
radiation than the outer shells' 27 electrons, as seen in the step size.
A variant, Auger spectroscopy, DOES
look at ejected electron energies after X-ray absorption, but the circa-one-eV
work function of a typical material is not a dominant part of the
few-keV energy budget.
