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
Showing
- Framework/Algorithms/inc/MantidAlgorithms/SofQWNormalisedPolygon.h 3 additions, 10 deletions.../Algorithms/inc/MantidAlgorithms/SofQWNormalisedPolygon.h
- Framework/Algorithms/src/SofQWNormalisedPolygon.cpp 91 additions, 106 deletionsFramework/Algorithms/src/SofQWNormalisedPolygon.cpp
- Framework/Algorithms/test/SofQWCutTest.h 20 additions, 20 deletionsFramework/Algorithms/test/SofQWCutTest.h
- Framework/Algorithms/test/SofQWNormalisedPolygonTest.h 19 additions, 19 deletionsFramework/Algorithms/test/SofQWNormalisedPolygonTest.h
- docs/source/algorithms/SofQWNormalisedPolygon-v1.rst 15 additions, 10 deletionsdocs/source/algorithms/SofQWNormalisedPolygon-v1.rst
Loading
Please register or sign in to comment