Skip to content
Snippets Groups Projects
Commit 35b25e65 authored by Harry Jeffery's avatar Harry Jeffery
Browse files

Refs #11355 Fix experimentinfo casting

parent 5405fd93
No related branches found
No related tags found
No related merge requests found
......@@ -418,22 +418,22 @@ void CutMD::exec() {
cutAlg->execute();
Workspace_sptr sliceWS = cutAlg->getProperty("OutputWorkspace");
IMDEventWorkspace_sptr slice =
boost::dynamic_pointer_cast<IMDEventWorkspace>(sliceWS);
MultipleExperimentInfos_sptr sliceInfo =
boost::dynamic_pointer_cast<MultipleExperimentInfos>(sliceWS);
if (!slice)
if (!sliceInfo)
throw std::runtime_error(
"Child algorithm did not produce IMDEventWorkspace");
"Could not extract experiment info from child's OutputWorkspace");
// Attach projection matrix to output
if (slice->getNumExperimentInfo() > 0) {
ExperimentInfo_sptr info = slice->getExperimentInfo(0);
if (sliceInfo->getNumExperimentInfo() > 0) {
ExperimentInfo_sptr info = sliceInfo->getExperimentInfo(0);
info->mutableRun().addProperty("W_MATRIX", projectionMatrix.getVector(),
true);
}
// Done!
setProperty("OutputWorkspace", slice);
setProperty("OutputWorkspace", sliceWS);
}
} // namespace Mantid
......
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