Skip to content

Commit

Permalink
Refs #5678. Match units between detvan and background workspace.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Reuter committed Oct 19, 2012
1 parent 53c4870 commit 096efd0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Code/Mantid/Framework/WorkflowAlgorithms/src/DgsDiagnose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,17 +253,18 @@ namespace Mantid
integrate->executeAsSubAlg();
backgroundIntWS = integrate->getProperty("OutputWorkspace");

// Need to match the units between background and detector vanadium
const std::string detVanIntRangeUnits = reductionManager->getProperty("DetVanIntRangeUnits");
IAlgorithm_sptr cvu = this->createSubAlgorithm("ConvertUnits");
cvu->setProperty("InputWorkspace", backgroundIntWS);
cvu->setProperty("OutputWorkspace", backgroundIntWS);
cvu->setProperty("Target", "Energy");
cvu->setProperty("Target", detVanIntRangeUnits);
cvu->executeAsSubAlg();
backgroundIntWS = cvu->getProperty("OutputWorkspace");

// Normalise the background integral workspace
if (dvCompWS)
{

MatrixWorkspace_sptr hmean = 2.0 * dvWS * dvCompWS;
hmean /= (dvWS + dvCompWS);
backgroundIntWS /= hmean;
Expand Down

0 comments on commit 096efd0

Please sign in to comment.