Skip to content

Commit

Permalink
Refs #4692. Remove the gap plugging from SofQW2.
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Jan 31, 2012
1 parent 0e21882 commit 1882f8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 29 deletions.
18 changes: 3 additions & 15 deletions Code/Mantid/Framework/Algorithms/src/SofQW2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,9 @@ namespace Mantid
{
continue;
}
double leftWidth(0.5*m_thetaWidth), rightWidth(0.5*m_thetaWidth);
// If the gap between this and the previous pixel is largest than
// the calculate width we need to enlarge the pixel
double gap(0.0);
if( i > 2 )
{
gap = theta - m_thetaPts[i-1];
if( gap > m_thetaWidth )
{
// Move the left boundary to encompass the gap
leftWidth = gap - 0.5*m_thetaWidth;
}
}
const double thetaLower = theta - leftWidth;
const double thetaUpper = theta + rightWidth;
double halfWidth(0.5*m_thetaWidth);
const double thetaLower = theta - halfWidth;
const double thetaUpper = theta + halfWidth;
const double efixed = getEFixed(inputWS->getDetector(i));
for(size_t j = 0; j < nenergyBins; ++j)
{
Expand Down
20 changes: 6 additions & 14 deletions Code/Mantid/Framework/Algorithms/test/SofQW2Test.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@ class SofQW2Test : public CxxTest::TestSuite
TS_ASSERT_EQUALS( (*(result->getAxis(1)))(3), 1.25 );
TS_ASSERT_EQUALS( (*(result->getAxis(1)))(6), 2.0 );

// int bins[6] = {1160, 1145, 1200, 99, 1654, 1025};
// std::cerr << "\n";
// for(int i = 0; i < 6; ++i)
// {
// std::cerr << std::setprecision(12) << result->readY(i)[bins[i]] << " " << result->readE(i)[bins[i]] << "\n";
// }
// std::cerr << "\n";

const double delta(1e-08);
TS_ASSERT_DELTA( result->readY(0)[1160], 17.5583314826, delta);
TS_ASSERT_DELTA( result->readE(0)[1160], 0.197345265992, delta);
Expand All @@ -83,14 +75,14 @@ class SofQW2Test : public CxxTest::TestSuite
TS_ASSERT_DELTA( result->readY(2)[1200], 1.33394133548, delta);
TS_ASSERT_DELTA( result->readE(2)[1200], 0.0419839252961, delta);

TS_ASSERT_DELTA( result->readY(3)[99], 0.0489605347949, delta);
TS_ASSERT_DELTA( result->readE(3)[99], 0.0205020036326, delta);
TS_ASSERT_DELTA( result->readY(3)[99], 0.0446085388561, delta);
TS_ASSERT_DELTA( result->readE(3)[99], 0.0185049423467, delta);

TS_ASSERT_DELTA( result->readY(4)[1654], 0.0176095939231, delta);
TS_ASSERT_DELTA( result->readE(4)[1654], 0.00517369024804, delta);
TS_ASSERT_DELTA( result->readY(4)[1654], 0.0171136490957 , delta);
TS_ASSERT_DELTA( result->readE(4)[1654], 0.005007299861, delta);

TS_ASSERT_DELTA( result->readY(5)[1025], 0.038616901764, delta);
TS_ASSERT_DELTA( result->readE(5)[1025], 0.00769872580375, delta);
TS_ASSERT_DELTA( result->readY(5)[1025], 0.0516113202152, delta);
TS_ASSERT_DELTA( result->readE(5)[1025], 0.0102893133461, delta);

AnalysisDataService::Instance().remove(inputWS);
AnalysisDataService::Instance().remove(outputWS);
Expand Down

0 comments on commit 1882f8b

Please sign in to comment.