Skip to content

Commit

Permalink
Refs #11435 test adaptive Q integration
Browse files Browse the repository at this point in the history
  • Loading branch information
VickieLynch committed Mar 30, 2015
1 parent 29d1a3b commit 5bff5c4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Code/Mantid/Framework/MDAlgorithms/test/IntegratePeaksMD2Test.h
Expand Up @@ -62,7 +62,7 @@ class IntegratePeaksMD2Test : public CxxTest::TestSuite
/** Run the IntegratePeaksMD2 with the given peak radius integration param */
static void doRun(double PeakRadius, double BackgroundRadius,
std::string OutputWorkspace = "IntegratePeaksMD2Test_peaks",
double BackgroundStartRadius = 0.0, bool edge = true, bool cyl = false, std::string fnct = "NoFit")
double BackgroundStartRadius = 0.0, bool edge = true, bool cyl = false, std::string fnct = "NoFit", double adaptive = 0.0)
{
IntegratePeaksMD2 alg;
TS_ASSERT_THROWS_NOTHING( alg.initialize() )
Expand All @@ -79,6 +79,8 @@ class IntegratePeaksMD2Test : public CxxTest::TestSuite
TS_ASSERT_THROWS_NOTHING( alg.setProperty("PercentBackground", 20.0 ) );
TS_ASSERT_THROWS_NOTHING( alg.setProperty("ProfileFunction", fnct ) );
TS_ASSERT_THROWS_NOTHING( alg.setProperty("IntegrationOption", "Sum" ) );
TS_ASSERT_THROWS_NOTHING( alg.setProperty("AdaptiveQMultiplier", adaptive ) );
if (adaptive > 0.0) TS_ASSERT_THROWS_NOTHING( alg.setProperty("AdaptiveQBackground", true ) );
TS_ASSERT_THROWS_NOTHING( alg.execute() );
TS_ASSERT( alg.isExecuted() );
}
Expand Down Expand Up @@ -180,6 +182,15 @@ class IntegratePeaksMD2Test : public CxxTest::TestSuite
// Error is also calculated
TS_ASSERT_DELTA( peakWS0->getPeak(0).getSigmaIntensity(), sqrt(2.0), 1e-2);*/

// ------------- Adaptive Integration r=MQ+b where b is PeakRadius and m is 0.01 ------------------------
peakWS0->addPeak( Peak(inst, 15050, 1.0, V3D(2., 3., 4.) ) );
doRun(0.1,0.0,"IntegratePeaksMD2Test_peaks",0.0,true,false,"NoFit",0.01);
TS_ASSERT_DELTA( peakWS0->getPeak(1).getIntensity(), 29.0, 1e-2);

// Error is also calculated
TS_ASSERT_DELTA( peakWS0->getPeak(1).getSigmaIntensity(), sqrt(29.0), 1e-2);

// ------------- Integrate with 0.1 radius but IntegrateIfOnEdge false------------------------
doRun(0.1,0.0,"IntegratePeaksMD2Test_peaks",0.0,false);

Expand Down

0 comments on commit 5bff5c4

Please sign in to comment.