Skip to content

Commit

Permalink
Refs #4261. Fixes GetEi not to throw on EventWorkspace input.
Browse files Browse the repository at this point in the history
GetEi no extracts the monitors as a Workspace2D so that the existing
algorithm can function.
  • Loading branch information
martyngigg committed Dec 5, 2011
1 parent 94cf9f1 commit 664198e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Code/Mantid/Framework/Algorithms/src/GetEi2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,18 @@ MatrixWorkspace_sptr GetEi2::extractSpectrum(size_t ws_index, const double start
childAlg->setProperty("XMin", start);
childAlg->setProperty("XMax", end);
childAlg->executeAsSubAlg();
return childAlg->getProperty("OutputWorkspace");
MatrixWorkspace_sptr monitors = childAlg->getProperty("OutputWorkspace");
if( boost::dynamic_pointer_cast<API::IEventWorkspace>(m_input_ws) )
{
// Convert to a MatrixWorkspace representation
childAlg = createSubAlgorithm("ConvertToMatrixWorkspace");
childAlg->setProperty("InputWorkspace", monitors);
childAlg->setProperty("OutputWorkspace", monitors);
childAlg->executeAsSubAlg();
monitors = childAlg->getProperty("OutputWorkspace");
}

return monitors;
}

/**
Expand Down

0 comments on commit 664198e

Please sign in to comment.