Skip to content
Snippets Groups Projects
Commit 5bff5c44 authored by Lynch, Vickie's avatar Lynch, Vickie
Browse files

Refs #11435 test adaptive Q integration

parent 29d1a3b2
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment