Skip to content
Snippets Groups Projects
Commit 8925be79 authored by Matthew Andrew's avatar Matthew Andrew
Browse files

Added workspace cloneing when no other operations Re #23642

parent bb2461f0
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,8 @@ public:
"data. Sample logs are modified to record the input parameters.";
}
const std::vector<std::string> seeAlso() const override {
return {"MuonProcess"};
return {"MuonProcess", "ApplyDeadTimeCorr", "ChangeBinOffset",
"CropWorkspace", "Rebin"};
}
private:
......@@ -53,6 +54,8 @@ private:
MatrixWorkspace_sptr applyRebinning(MatrixWorkspace_sptr ws,
const std::vector<double> &rebinArgs);
MatrixWorkspace_sptr cloneWorkspace(MatrixWorkspace_sptr ws);
/// Add the correction inputs into the logs
void addPreProcessSampleLogs(WorkspaceGroup_sptr group);
......
......@@ -182,6 +182,11 @@ MatrixWorkspace_sptr MuonPreProcess::correctWorkspace(MatrixWorkspace_sptr ws) {
ws = applyCropping(ws, xMin, xMax);
ws = applyRebinning(ws, rebinParams);
if (deadTimes == nullptr && offset == EMPTY_DBL()
&& (xMin == EMPTY_DBL() || xMax == EMPTY_DBL()) && rebinParams.empty()){
ws = cloneWorkspace(ws);
}
return ws;
}
......@@ -243,6 +248,15 @@ MuonPreProcess::applyRebinning(MatrixWorkspace_sptr ws,
}
}
MatrixWorkspace_sptr MuonPreProcess::cloneWorkspace(MatrixWorkspace_sptr ws) {
IAlgorithm_sptr cloneWorkspace = this->createChildAlgorithm("CloneWorkspace");
cloneWorkspace->setProperty("InputWorkspace", ws);
cloneWorkspace->execute();
Workspace_sptr wsClone = cloneWorkspace->getProperty("OutputWorkspace");
return boost::dynamic_pointer_cast<MatrixWorkspace>(wsClone);
}
void MuonPreProcess::addPreProcessSampleLogs(WorkspaceGroup_sptr group) {
const std::string numPeriods = std::to_string(group->getNumberOfEntries());
......
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