From 6da0e96becbaaff67b5b8bb68f85d9f9187f7c1c Mon Sep 17 00:00:00 2001 From: Ian Bush <bush@ill.fr> Date: Thu, 23 Nov 2017 10:47:53 +0100 Subject: [PATCH] Refs #20285 Clean up generation of errors, clarify docs --- .../RunCombinationHelper.cpp | 21 +++++++------------ .../algorithms/SumOverlappingTubes-v1.rst | 2 +- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/Framework/Algorithms/src/RunCombinationHelpers/RunCombinationHelper.cpp b/Framework/Algorithms/src/RunCombinationHelpers/RunCombinationHelper.cpp index e5c390ba740..adde7248cd6 100644 --- a/Framework/Algorithms/src/RunCombinationHelpers/RunCombinationHelper.cpp +++ b/Framework/Algorithms/src/RunCombinationHelpers/RunCombinationHelper.cpp @@ -90,7 +90,7 @@ RunCombinationHelper::checkCompatibility(MatrixWorkspace_sptr ws, // Local function used within validateInputWorkspaces() below in a call to // std::list::sort(compare) to order the input workspaces by the start of their // frame (i.e. the first X value). -static bool compare(MatrixWorkspace_sptr first, MatrixWorkspace_sptr second) { +static bool compare(MatrixWorkspace_sptr &first, MatrixWorkspace_sptr &second) { return (first->x(0).front() < second->x(0).front()); } /// @endcond @@ -113,21 +113,14 @@ RunCombinationHelper::validateInputWorkspaces( for (size_t i = 0; i < inputWorkspaces.size(); ++i) { MatrixWorkspace_sptr ws; // Fetch the next input workspace - throw an error if it's not there - try { - ws = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>( + ws = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>( + inputWorkspaces[i]); + if (!ws) { + throw std::runtime_error( + "Could not find a MatrixWorkspace with the name " + inputWorkspaces[i]); - if (!ws) { - g_log.error() << "Input workspace " << inputWorkspaces[i] - << " not found.\n"; - throw Kernel::Exception::NotFoundError("Data Object", - inputWorkspaces[i]); - } - inWS.push_back(ws); - } catch (Exception::NotFoundError &) { - g_log.error() << "Input workspace " << inputWorkspaces[i] - << " not found.\n"; - throw; } + inWS.push_back(ws); // Check that it has common binning if (!WorkspaceHelpers::commonBoundaries(*inWS.back())) { g_log.error("Input workspaces must have common binning for all spectra"); diff --git a/docs/source/algorithms/SumOverlappingTubes-v1.rst b/docs/source/algorithms/SumOverlappingTubes-v1.rst index 709242ded81..aff4f8e76fe 100644 --- a/docs/source/algorithms/SumOverlappingTubes-v1.rst +++ b/docs/source/algorithms/SumOverlappingTubes-v1.rst @@ -16,7 +16,7 @@ This algorithm is written for the geometry of D2B, where the detector tubes have General Behavior ################# -For the output workspace a grid is made, the x-axis is the scattering angle and the y-axis is the tube height. Counts from the input workspaces are then put onto this grid. Where one of the entries in the scattering angle is between two angles the count are split between the two, unless the ScatteringAngleTolerance option is set. +For the output workspace a grid is made, the x-axis is the scattering angle and the y-axis is vertical distance from the centre of the tube (referred to as the tube height). Counts from the input workspaces are then put onto this grid. Where one of the entries in the scattering angle is between two angles the count are split between the two, unless the ScatteringAngleTolerance option is set. If the Normalise option is set then the counts for each point in the OutputWorkspace are divided by the number of contributing points to that pixel. The scaling goes as -- GitLab