Skip to content

Commit

Permalink
Refs #8550. Use new functionality in PlotAsymmetryByLogValue.
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbekasov committed Dec 6, 2013
1 parent 1d6178b commit 8b104b6
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions Code/Mantid/Framework/Algorithms/src/PlotAsymmetryByLogValue.cpp
Expand Up @@ -270,21 +270,31 @@ namespace Mantid

if(m_autogroup)
{
IAlgorithm_sptr applyGrouping = createChildAlgorithm("ApplyGroupingFromMuonNexus");
applyGrouping->initialize();
applyGrouping->setProperty("InputWorkspace", loadedWs);
applyGrouping->setPropertyValue("Filename", fn.str());
Workspace_sptr loadedDetGrouping = load->getProperty("DetectorGroupingTable");

if ( ! loadedDetGrouping )
throw std::runtime_error("No grouping info in the file.\n\nPlease specify grouping manually");

// Could be groups of workspaces, so need to work with ADS
ScopedWorkspace inWS(loadedWs);
ScopedWorkspace grouping(loadedDetGrouping);
ScopedWorkspace outWS;

try
{
IAlgorithm_sptr applyGrouping = createChildAlgorithm("MuonGroupDetectors", -1, -1, false);
applyGrouping->initialize();
applyGrouping->setPropertyValue( "InputWorkspace", inWS.name() );
applyGrouping->setPropertyValue( "DetectorGroupingTable", grouping.name() );
applyGrouping->setPropertyValue( "OutputWorkspace", outWS.name() );
applyGrouping->execute();

loadedWs = outWS.retrieve();
}
catch(...)
{
throw std::runtime_error("Unable to auto-group the workspace. Please specify grouping manually");
throw std::runtime_error("Unable to group detectors.\n\nPlease specify grouping manually.");
}

loadedWs = applyGrouping->getProperty("OutputWorkspace");
}

WorkspaceGroup_sptr loadedGroup = boost::dynamic_pointer_cast<WorkspaceGroup>(loadedWs);
Expand Down

0 comments on commit 8b104b6

Please sign in to comment.