Skip to content

Commit

Permalink
Re #9543. Handle the addition of monitor workspace chunks.
Browse files Browse the repository at this point in the history
This step explicitly adds monitor workspaces in addition to the main
data. This means that if the monitor workspace is still present after
the processing step (a user could extract it there if they wanted), it
will be available for the post-processing or be carried right through
to the output if there is no post-processing step.
  • Loading branch information
RussellTaylor committed Jun 6, 2014
1 parent cb397b5 commit 374775a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Code/Mantid/Framework/LiveData/src/LoadLiveData.cpp
Expand Up @@ -286,6 +286,18 @@ namespace LiveData
*/
void LoadLiveData::addMatrixWSChunk(const std::string& algoName, Workspace_sptr accumWS, Workspace_sptr chunkWS)
{
// Handle the addition of the internal monitor workspace, if present
auto accumMW = boost::dynamic_pointer_cast<MatrixWorkspace>(accumWS);
auto chunkMW = boost::dynamic_pointer_cast<MatrixWorkspace>(chunkWS);
if ( accumMW && chunkMW )
{
auto accumMon = accumMW->monitorWorkspace();
auto chunkMon = chunkMW->monitorWorkspace();

if ( accumMon && chunkMon ) accumMon += chunkMon;
}

// Now do the main workspace
IAlgorithm_sptr alg = this->createChildAlgorithm(algoName);
alg->setProperty("LHSWorkspace", accumWS);
alg->setProperty("RHSWorkspace", chunkWS);
Expand All @@ -297,9 +309,8 @@ namespace LiveData
}
else
{
// Is this really necessary?

// Get the output as the generic Workspace type
// This step is necessary for when we are operating on MD workspaces (PlusMD)
Property * prop = alg->getProperty("OutputWorkspace");
IWorkspaceProperty * wsProp = dynamic_cast<IWorkspaceProperty*>(prop);
if (!wsProp)
Expand Down

0 comments on commit 374775a

Please sign in to comment.