Skip to content

Commit

Permalink
refs #6215. Seems to work and is tested too.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwenArnold committed Nov 22, 2012
1 parent 8152b0f commit abb5c85
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Code/Mantid/Framework/MDEvents/src/IntegratePeaksMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ namespace MDEvents
<< std::endl;
}

peakWS->mutableRun().addProperty("PeakRadius", PeakRadius, true);
peakWS->mutableRun().addProperty("BackgroundInnerRadius", BackgroundInnerRadius, true);
peakWS->mutableRun().addProperty("BackgroundOuterRadius", BackgroundOuterRadius, true);

// Save the output
setProperty("OutputWorkspace", peakWS);

Expand Down
21 changes: 20 additions & 1 deletion Code/Mantid/Framework/MDEvents/test/IntegratePeaksMDTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,26 @@ class IntegratePeaksMDTest : public CxxTest::TestSuite

}

void test_writes_out_selected_algorithm_parameters()
{
createMDEW();
const double peakRadius = 2;
const double backgroundOutterRadius = 3;
const double backgroundInnerRadius = 2.5;

doRun(peakRadius, backgroundOutterRadius, "OutWS", backgroundInnerRadius);

auto outWS = AnalysisDataService::Instance().retrieveWS<PeaksWorkspace>("OutWS");

double actualPeakRadius = atof(outWS->mutableRun().getProperty("PeakRadius")->value().c_str());
double actualBackgroundOutterRadius= atof(outWS->mutableRun().getProperty("BackgroundOuterRadius")->value().c_str());
double actualBackgroundInnerRadius = atof(outWS->mutableRun().getProperty("BackgroundInnerRadius")->value().c_str());

TS_ASSERT_EQUALS(peakRadius, actualPeakRadius);
TS_ASSERT_EQUALS(backgroundOutterRadius, actualBackgroundOutterRadius);
TS_ASSERT_EQUALS(backgroundInnerRadius, actualBackgroundInnerRadius);
}

};


Expand Down Expand Up @@ -376,7 +396,6 @@ class IntegratePeaksMDTestPerformance : public CxxTest::TestSuite
IntegratePeaksMDTest::doRun(0.02, 0.03);
}
}

};


Expand Down

0 comments on commit abb5c85

Please sign in to comment.