Skip to content
Snippets Groups Projects
Commit 65f5dc52 authored by Antti Soininen's avatar Antti Soininen
Browse files

SofQWNormalisedPolygon: fix theta width calculation

The algorithm was assuming too much about the input workspace's
detectors resulting in too large theta width for ILL's IN4 and
IN6 instruments. Also, the algorithm expected a constant L2 for all
detectors which is not true for IN5. Further, picking the first detector
only for the theta width calculation was not sufficient for cases like the
detector groups in the workspace used in the unit tests.

We now calculate top, centre and bottom points of the detector's
bounding box, apply rotation and translation taking the sample position
into account, and calculate the 2theta angle between the points and the
beam direction. This is repeated for all detectors in a group. The final
theta width is the difference between all thetas calculated.

Additionally:
- Remove phi angle stuff, it is not needed for anything.
- General cleanup and refactoring.

Re #24041
parent f5a0fed1
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment