Skip to content
Snippets Groups Projects
Commit 6da0e96b authored by Ian Bush's avatar Ian Bush
Browse files

Refs #20285 Clean up generation of errors, clarify docs

parent f929b728
No related branches found
No related tags found
No related merge requests found
...@@ -90,7 +90,7 @@ RunCombinationHelper::checkCompatibility(MatrixWorkspace_sptr ws, ...@@ -90,7 +90,7 @@ RunCombinationHelper::checkCompatibility(MatrixWorkspace_sptr ws,
// Local function used within validateInputWorkspaces() below in a call to // Local function used within validateInputWorkspaces() below in a call to
// std::list::sort(compare) to order the input workspaces by the start of their // std::list::sort(compare) to order the input workspaces by the start of their
// frame (i.e. the first X value). // 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()); return (first->x(0).front() < second->x(0).front());
} }
/// @endcond /// @endcond
...@@ -113,21 +113,14 @@ RunCombinationHelper::validateInputWorkspaces( ...@@ -113,21 +113,14 @@ RunCombinationHelper::validateInputWorkspaces(
for (size_t i = 0; i < inputWorkspaces.size(); ++i) { for (size_t i = 0; i < inputWorkspaces.size(); ++i) {
MatrixWorkspace_sptr ws; MatrixWorkspace_sptr ws;
// Fetch the next input workspace - throw an error if it's not there // 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]); 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 // Check that it has common binning
if (!WorkspaceHelpers::commonBoundaries(*inWS.back())) { if (!WorkspaceHelpers::commonBoundaries(*inWS.back())) {
g_log.error("Input workspaces must have common binning for all spectra"); g_log.error("Input workspaces must have common binning for all spectra");
......
...@@ -16,7 +16,7 @@ This algorithm is written for the geometry of D2B, where the detector tubes have ...@@ -16,7 +16,7 @@ This algorithm is written for the geometry of D2B, where the detector tubes have
General Behavior 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 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
......
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