diff --git a/Framework/Algorithms/inc/MantidAlgorithms/WorkspaceJoiners.h b/Framework/Algorithms/inc/MantidAlgorithms/WorkspaceJoiners.h index 6dca28272ab64b7a531de5f2ebd22266b52d80f5..e662c06aad1f4e044d3cc6bd770eaaed4583a4e3 100644 --- a/Framework/Algorithms/inc/MantidAlgorithms/WorkspaceJoiners.h +++ b/Framework/Algorithms/inc/MantidAlgorithms/WorkspaceJoiners.h @@ -53,8 +53,8 @@ protected: API::MatrixWorkspace_sptr execWS2D(const API::MatrixWorkspace &ws1, const API::MatrixWorkspace &ws2); DataObjects::EventWorkspace_sptr - execEvent(const DataObjects::EventWorkspace &event_ws1, - const DataObjects::EventWorkspace &event_ws2); + execEvent(const DataObjects::EventWorkspace &eventWs1, + const DataObjects::EventWorkspace &eventWs2); using Mantid::API::Algorithm::validateInputs; void validateInputs(const API::MatrixWorkspace &ws1, const API::MatrixWorkspace &ws2, const bool checkBinning); diff --git a/Framework/Algorithms/src/AppendSpectra.cpp b/Framework/Algorithms/src/AppendSpectra.cpp index fa28c4f88f8005d8d98fca69b86e9fce5d0e62c9..9ae6ae24a65d667955a8cbd6a6b0981527560bed 100644 --- a/Framework/Algorithms/src/AppendSpectra.cpp +++ b/Framework/Algorithms/src/AppendSpectra.cpp @@ -60,14 +60,14 @@ void AppendSpectra::exec() { // Retrieve the input workspaces MatrixWorkspace_const_sptr ws1 = getProperty("InputWorkspace1"); MatrixWorkspace_const_sptr ws2 = getProperty("InputWorkspace2"); - DataObjects::EventWorkspace_const_sptr event_ws1 = + DataObjects::EventWorkspace_const_sptr eventWs1 = boost::dynamic_pointer_cast<const EventWorkspace>(ws1); - DataObjects::EventWorkspace_const_sptr event_ws2 = + DataObjects::EventWorkspace_const_sptr eventWs2 = boost::dynamic_pointer_cast<const EventWorkspace>(ws2); // Make sure that we are not mis-matching EventWorkspaces and other types of // workspaces - if (((event_ws1) && (!event_ws2)) || ((!event_ws1) && (event_ws2))) { + if (((eventWs1) && (!eventWs2)) || ((!eventWs1) && (eventWs2))) { const std::string message("Only one of the input workspaces are of type " "EventWorkspace; please use matching workspace " "types (both EventWorkspace's or both " @@ -86,14 +86,14 @@ void AppendSpectra::exec() { const int number = getProperty("Number"); MatrixWorkspace_sptr output; - if (event_ws1 && event_ws2) { + if (eventWs1 && eventWs2) { // Both are event workspaces. Use the special method - DataObjects::EventWorkspace_sptr e_output = - this->execEvent(*event_ws1, *event_ws2); + DataObjects::EventWorkspace_sptr eOutput = + this->execEvent(*eventWs1, *eventWs2); for (int i = 1; i < number; i++) { - e_output = this->execEvent(*e_output, *event_ws2); + eOutput = this->execEvent(*eOutput, *eventWs2); } - output = boost::dynamic_pointer_cast<MatrixWorkspace>(e_output); + output = boost::static_pointer_cast<MatrixWorkspace>(eOutput); } else { // So it is a workspace 2D. // The only restriction, even with ValidateInputs=false if (ws1->blocksize() != ws2->blocksize()) diff --git a/Framework/Algorithms/src/ConjoinWorkspaces.cpp b/Framework/Algorithms/src/ConjoinWorkspaces.cpp index f7397666c02c1d483fe920b74f5bb495398caf57..cf39d7d45a6cb3c08ed30e00e0e5f0882a27b89a 100644 --- a/Framework/Algorithms/src/ConjoinWorkspaces.cpp +++ b/Framework/Algorithms/src/ConjoinWorkspaces.cpp @@ -46,14 +46,14 @@ void ConjoinWorkspaces::exec() { // Retrieve the input workspaces MatrixWorkspace_const_sptr ws1 = getProperty("InputWorkspace1"); MatrixWorkspace_const_sptr ws2 = getProperty("InputWorkspace2"); - DataObjects::EventWorkspace_const_sptr event_ws1 = + DataObjects::EventWorkspace_const_sptr eventWs1 = boost::dynamic_pointer_cast<const EventWorkspace>(ws1); - DataObjects::EventWorkspace_const_sptr event_ws2 = + DataObjects::EventWorkspace_const_sptr eventWs2 = boost::dynamic_pointer_cast<const EventWorkspace>(ws2); // Make sure that we are not mis-matching EventWorkspaces and other types of // workspaces - if (((event_ws1) && (!event_ws2)) || ((!event_ws1) && (event_ws2))) { + if (((eventWs1) && (!eventWs2)) || ((!eventWs1) && (eventWs2))) { const std::string message("Only one of the input workspaces are of type " "EventWorkspace; please use matching workspace " "types (both EventWorkspace's or both " @@ -62,9 +62,9 @@ void ConjoinWorkspaces::exec() { throw std::invalid_argument(message); } - if (event_ws1 && event_ws2) { - this->validateInputs(*event_ws1, *event_ws2, false); - auto output = conjoinEvents(*event_ws1, *event_ws2); + if (eventWs1 && eventWs2) { + this->validateInputs(*eventWs1, *eventWs2, false); + auto output = conjoinEvents(*eventWs1, *eventWs2); setYUnitAndLabel(*output); // Set the result workspace to the first input setProperty("InputWorkspace1", output); diff --git a/Framework/Algorithms/src/WorkspaceJoiners.cpp b/Framework/Algorithms/src/WorkspaceJoiners.cpp index 5eb9f8a2fecd76fcf3ea16a90fcdbd94130be970..ff4ec7e077d76bc1c78b3559af55230dafdef003 100644 --- a/Framework/Algorithms/src/WorkspaceJoiners.cpp +++ b/Framework/Algorithms/src/WorkspaceJoiners.cpp @@ -119,45 +119,45 @@ MatrixWorkspace_sptr WorkspaceJoiners::execWS2D(const MatrixWorkspace &ws1, * requirements of this algorithm */ DataObjects::EventWorkspace_sptr -WorkspaceJoiners::execEvent(const DataObjects::EventWorkspace &event_ws1, - const DataObjects::EventWorkspace &event_ws2) { +WorkspaceJoiners::execEvent(const DataObjects::EventWorkspace &eventWs1, + const DataObjects::EventWorkspace &eventWs2) { // Create the output workspace const size_t totalHists = - event_ws1.getNumberHistograms() + event_ws2.getNumberHistograms(); + eventWs1.getNumberHistograms() + eventWs2.getNumberHistograms(); auto output = - create<EventWorkspace>(event_ws1, totalHists, event_ws1.binEdges(0)); + create<EventWorkspace>(eventWs1, totalHists, eventWs1.binEdges(0)); // Initialize the progress reporting object m_progress = new API::Progress(this, 0.0, 1.0, totalHists); - const int64_t &nhist1 = event_ws1.getNumberHistograms(); + const int64_t &nhist1 = eventWs1.getNumberHistograms(); for (int64_t i = 0; i < nhist1; ++i) { - output->getSpectrum(i) = event_ws1.getSpectrum(i); + output->getSpectrum(i) = eventWs1.getSpectrum(i); m_progress->report(); } // For second loop we use the offset from the first - const int64_t &nhist2 = event_ws2.getNumberHistograms(); - const auto &spectrumInfo = event_ws2.spectrumInfo(); + const int64_t &nhist2 = eventWs2.getNumberHistograms(); + const auto &spectrumInfo = eventWs2.spectrumInfo(); auto &outSpectrumInfo = output->mutableSpectrumInfo(); for (int64_t j = 0; j < nhist2; ++j) { // This is the workspace index at which we assign in the output - int64_t output_wi = j + nhist1; - output->getSpectrum(output_wi) = event_ws2.getSpectrum(j); + int64_t outputWi = j + nhist1; + output->getSpectrum(outputWi) = eventWs2.getSpectrum(j); // Propagate spectrum masking. First workspace will have been done by the // factory if (spectrumInfo.hasDetectors(j) && spectrumInfo.isMasked(j)) { - output->getSpectrum(output_wi).clearData(); + output->getSpectrum(outputWi).clearData(); PARALLEL_CRITICAL(setMaskedEvent) { - outSpectrumInfo.setMasked(output_wi, true); + outSpectrumInfo.setMasked(outputWi, true); } } m_progress->report(); } - fixSpectrumNumbers(event_ws1, event_ws2, *output); + fixSpectrumNumbers(eventWs1, eventWs2, *output); return std::move(output); }