diff --git a/Code/Mantid/Framework/MDAlgorithms/test/IntegratePeaksMD2Test.h b/Code/Mantid/Framework/MDAlgorithms/test/IntegratePeaksMD2Test.h index fa6a6d32befc2e784ee4d3cba77346bf73150d86..f83bbdd97a973797691f3b2780156a9f18e2b7d3 100644 --- a/Code/Mantid/Framework/MDAlgorithms/test/IntegratePeaksMD2Test.h +++ b/Code/Mantid/Framework/MDAlgorithms/test/IntegratePeaksMD2Test.h @@ -62,7 +62,7 @@ public: /** 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() ) @@ -79,6 +79,8 @@ public: 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() ); } @@ -180,6 +182,15 @@ public: // 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);