McTal merge requestshttps://iffgit.fz-juelich.de/zakalek/mctal/-/merge_requests2023-03-06T09:51:44Zhttps://iffgit.fz-juelich.de/zakalek/mctal/-/merge_requests/30Correct the wavelength distributions2023-03-06T09:51:44ZNorberto SchmidtCorrect the wavelength distributionsAfter some discussions with @jingli and @schwab, we realized that the peak of the wavelength distribution $`\phi(\lambda)`$ was not at the same position as the energy distribution $`\phi(E)`$. This was because, after the change of variab...After some discussions with @jingli and @schwab, we realized that the peak of the wavelength distribution $`\phi(\lambda)`$ was not at the same position as the energy distribution $`\phi(E)`$. This was because, after the change of variables, the corresponding jacobian was missing. This was properly implemented for the angular distribution.
Consider that $`|\phi(E) dE| = |\phi(\lambda) d\lambda|`$, and $`\lambda [\textup{~\AA}] = \sqrt{81.82/E [\mathrm{meV}]}`$, it is possible to see that $`dE = |81.82 \cdot (-2) \cdot \lambda^{-3}| d\lambda`$.
So, for each bin between $`\lambda_{\mathrm{min}}`$ and $`\lambda_{\mathrm{max}}`$, it would be necessary to divide by the integral of the jacobian, i.e. $`|81.82\cdot(\lambda^{-2}_{\mathrm{min}}-\lambda^{-2}_{\mathrm{max}})|`$.
For doing this, a new `WavelengthAxis` class was implemented to plot the distributions with the proper normalization (same idea as `AngleAxis`). Also, the `tracks-vs-tallies.inp` example was changed to see the new shape of the wavelength distributions (see attached).
And, with these implementations, now the peak of both distributions is at the same position :smiley:
![tracks-vs-tallies](/uploads/ce5859c777d9aafbb0a9c5e123b77494/tracks-vs-tallies.png)Paul ZakalekPaul Zakalekhttps://iffgit.fz-juelich.de/zakalek/mctal/-/merge_requests/19Wip2022-02-18T09:41:42ZPaul ZakalekWiphttps://iffgit.fz-juelich.de/zakalek/mctal/-/merge_requests/12Wip2022-02-07T08:50:45ZPaul ZakalekWiphttps://iffgit.fz-juelich.de/zakalek/mctal/-/merge_requests/2Wip2022-02-02T15:10:59ZPaul ZakalekWip