TODO: Enter a full rst-markup description of your algorithm here.

This algorithm can calculate the 1st and 2nd order Placzek inelastic scattering correction [1]_ [2]_ .

For this particular algorithm:

* The input workspace must

* contain a sample with proper chemical formula as the correction calculation relies on it.

* have a valid instrument geometry attached to it as the correction factors are calculated on a per spectrum (i.e. detector) basis.

* A workspace containing the incident spectrum extracted from the monitor is needed.

* For the first order correction, only the incident spectrum and its first order derivative is needed.

* For the second order correction, the incident spectrum along with its first and second derivate are needed.

* It is implicitly assumed that

* `IncidentSpectra.ReadY(0)` returns the incident spectrum.

* `IncidentSpectra.ReadY(1)` returns the first order derivative.

* `IncidentSpectra.ReadY(2)` returns the second order derivative.

* The algorithm will try to extract temperature from the sample log if it is not provided. However, this will be a simple average without any additional consideration about outliers or bad reading. Therefore, it is recommended to provide a sample temperature in Kelvin explicitly.

* The Placzek correction calculation requires a detector efficiency curve and its derivatives. This algorithm will prioritize the use of input `EfficiencySpectra`. However, when `EfficiencySpectra` is not provided:

* The algorithm will can generate a theoretical detector efficiency curve (see :ref:`He3TubeEfficiency <algm-He3TubeEfficiency>` for details) using the input Parameter `LambdaD`.

* When no `LambdaD` is provided, the default value 1.44 will be used, which is also the implicit value used in the original :ref:`CalculatePlaczekSelfScattering <algm-CalculatePlaczekSelfScattering-v1>`.

* Generally speaking it is better to measure the detector efficiency instead of relying on a theoretical one.

* The calculated Placzek correction factor will be scaled by the packing fraction if `ScaleByPackingFraction` is set to `True` (Default value).

* :math:`f = \frac{L_1}{L_1+L_2}` with :math:`L_1` being the distance between moderator and the sample and :math:`L_2` being the distance between the sample and the detector.

* :math:`\phi_1` is the first order incident flux coefficient.

* :math:`\epsilon_1` is the first order detector efficiency coefficient.

* :math:`c_\alpha` is the number proportion of species :math:`\alpha`.

* :math:`b_\alpha` is the total scattering length of species :math:`\alpha`.

* :math:`m` is the mass of neutron.

* :math:`M_\alpha` refers to the atomic mass of species :math:`\alpha`.

When the incident flux :math:`\phi` is available from monitor, the first order incident flux coefficient, :math:`\phi_1` can be calculated with

where :math:`\phi'(\lambda_i)` is the first order derivative of :math:`\phi(\lambda)` evaluated at :math:`\lambda_i`.

When the detector efficiency :math:`\epsilon` is measured as a function of wave vector :math:`k = 2\pi / \lambda`, the first order detector efficiency coefficient, :math:`\epsilon_1` can be calculated with

.. [1] Howe, McGreevy, and Howells, J., (1989), *The analysis of liquid structure data from time-of-flight neutron diffractometry*, Journal of Physics: Condensed Matter, Volume 1, Issue 22, pp. 3433-3451, `doi: 10.1088/0953-8984/1/22/005 <https://doi.org/10.1088/0953-8984/1/22/005>`__

.. [2] Howells, W.S. 1984. *On the Choice of Moderator for a Liquids Diffractometer on a Pulsed Neutron Source.*, Nuclear Instruments and Methods in Physics Research 223 (1): 141–46. `doi: 10.1016/0167-5087(84)90256-4 <https://doi.org/10.1016/0167-5087(84)90256-4>`__