diff --git a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/ConvolutionFitSequential.h b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/ConvolutionFitSequential.h index c05b9e9d4ca3ee677d83fab1e7022fa43d109ae6..22858f33571a57157b3905fe49ce6caed43d0916 100644 --- a/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/ConvolutionFitSequential.h +++ b/Framework/WorkflowAlgorithms/inc/MantidWorkflowAlgorithms/ConvolutionFitSequential.h @@ -53,7 +53,7 @@ private: const std::vector<std::string> &); std::vector<double> squareVector(std::vector<double>); std::vector<double> cloneVector(const std::vector<double> &); - API::MatrixWorkspace_sptr convertInputToElasticQ(API::MatrixWorkspace_sptr &, + void convertInputToElasticQ(API::MatrixWorkspace_sptr &, const std::string &); void calculateEISF(API::ITableWorkspace_sptr &); std::string convertBackToShort(const std::string &); diff --git a/Framework/WorkflowAlgorithms/src/ConvolutionFitSequential.cpp b/Framework/WorkflowAlgorithms/src/ConvolutionFitSequential.cpp index ca93f043d7c3be341127f310b33c8102ed5ad5f8..dc94ab1ede4acb59e4bc58ec85694f0f5e2fa5cc 100644 --- a/Framework/WorkflowAlgorithms/src/ConvolutionFitSequential.cpp +++ b/Framework/WorkflowAlgorithms/src/ConvolutionFitSequential.cpp @@ -180,7 +180,7 @@ void ConvolutionFitSequential::exec() { // Convert input workspace to get Q axis const std::string tempFitWsName = "__convfit_fit_ws"; - auto tempFitWs = convertInputToElasticQ(inputWs, tempFitWsName); + convertInputToElasticQ(inputWs, tempFitWsName); Progress plotPeakStringProg(this, 0.0, 0.05, specMax - specMin); // Construct plotpeak string @@ -446,15 +446,13 @@ ConvolutionFitSequential::cloneVector(const std::vector<double> &original) { } /** - * Converts the input workspaces to get the Elastic Q axis + * Converts the input workspaces to spectrum axis to ElasticQ and adds it to the + * ADS to be used by PlotPeakBylogValue * @param inputWs - The MatrixWorkspace to be converted * @param wsName - The desired name of the output workspace - * @return Shared pointer to the converted workspace */ -API::MatrixWorkspace_sptr ConvolutionFitSequential::convertInputToElasticQ( +void ConvolutionFitSequential::convertInputToElasticQ( API::MatrixWorkspace_sptr &inputWs, const std::string &wsName) { - auto tempFitWs = WorkspaceFactory::Instance().create( - "Workspace2D", inputWs->getNumberHistograms(), 2, 1); auto axis = inputWs->getAxis(1); if (axis->isSpectra()) { auto convSpec = createChildAlgorithm("ConvertSpectrumAxis"); @@ -471,16 +469,14 @@ API::MatrixWorkspace_sptr ConvolutionFitSequential::convertInputToElasticQ( throw std::runtime_error("Input must have axis values of Q"); } auto cloneWs = createChildAlgorithm("CloneWorkspace"); + cloneWs->setAlwaysStoreInADS(true); cloneWs->setProperty("InputWorkspace", inputWs); cloneWs->setProperty("OutputWorkspace", wsName); cloneWs->executeAsChildAlg(); - tempFitWs = cloneWs->getProperty("OutputWorkspace"); } else { throw std::runtime_error( "Input workspace must have either spectra or numeric axis."); } - - return tempFitWs; } /**