Skip to content

Commit

Permalink
Remove some unused properties.
Browse files Browse the repository at this point in the history
Refs #10169
  • Loading branch information
martyngigg committed Oct 29, 2014
1 parent 8b08ecb commit 91644b7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 36 deletions.
Expand Up @@ -176,7 +176,7 @@ namespace Mantid

size_t m_acrossIdx, m_upIdx, m_beamIdx; // indices of each direction
Kernel::V3D m_beamDir; // Directional vector for beam
double m_srcR1, m_srcR2; // beam umbra, penumbra radius (m)
double m_srcR2; // beam penumbra radius (m)
double m_halfSampleHeight, m_halfSampleWidth, m_halfSampleThick; // (m)
double m_maxWidthSampleFrame; // Maximum width in sample frame (m)
Geometry::Object const *m_sampleShape; // sample shape
Expand Down
22 changes: 4 additions & 18 deletions Code/Mantid/Framework/CurveFitting/src/CalculateMSVesuvio.cpp
Expand Up @@ -469,7 +469,7 @@ namespace Mantid
/// Constructor
CalculateMSVesuvio::CalculateMSVesuvio() : Algorithm(),
m_randgen(NULL),
m_acrossIdx(0), m_upIdx(1), m_beamIdx(3), m_beamDir(), m_srcR1(0.0), m_srcR2(0.0),
m_acrossIdx(0), m_upIdx(1), m_beamIdx(3), m_beamDir(), m_srcR2(0.0),
m_halfSampleHeight(0.0), m_halfSampleWidth(0.0), m_halfSampleThick(0.0),
m_maxWidthSampleFrame(0.0), m_sampleShape(NULL), m_sampleProps(NULL),
m_detHeight(-1.0), m_detWidth(-1.0), m_detThick(-1.0),
Expand Down Expand Up @@ -522,12 +522,8 @@ namespace Mantid
setPropertyGroup("AtomicProperties", "Sample");

// -- Beam --
declareProperty("BeamUmbraRadius", -1.0, positiveNonZero,
"Radius, in cm, of part in total shadow.");
declareProperty("BeamPenumbraRadius", -1.0, positiveNonZero,
"Radius, in cm, of part in partial shadow.");
setPropertyGroup("BeamUmbraRadius", "Beam");
setPropertyGroup("BeamPenumbraRadius", "Beam");
declareProperty("BeamRadius", -1.0, positiveNonZero,
"Radius, in cm, of beam");

// -- Algorithm --
declareProperty("Seed", 123456789, positiveInt,
Expand Down Expand Up @@ -607,18 +603,8 @@ namespace Mantid
m_upIdx = rframe->pointingUp();
m_beamIdx = rframe->pointingAlongBeam();

m_srcR1 = getProperty("BeamUmbraRadius");
m_srcR2 = getProperty("BeamPenumbraRadius");
if(m_srcR2 < m_srcR1)
{
std::ostringstream os;
os << "Invalid beam radius parameters. Penumbra value="
<< m_srcR2 << " < Umbra value="
<< m_srcR1;
throw std::invalid_argument(os.str());
}
m_srcR2 = getProperty("BeamRadius");
// Convert to metres
m_srcR1 /= 100.0;
m_srcR2 /= 100.0;

// Sample shape
Expand Down
20 changes: 3 additions & 17 deletions Code/Mantid/Framework/CurveFitting/test/CalculateMSVesuvioTest.h
Expand Up @@ -95,21 +95,8 @@ class CalculateMSVesuvioTest : public CxxTest::TestSuite
CalculateMSVesuvio alg;
alg.initialize();

TS_ASSERT_THROWS(alg.setProperty("BeamUmbraRadius", -1.5), std::invalid_argument);
TS_ASSERT_THROWS(alg.setProperty("BeamUmbraRadius", 0.0), std::invalid_argument);
TS_ASSERT_THROWS(alg.setProperty("BeamPenumbraRadius", -1.5), std::invalid_argument);
TS_ASSERT_THROWS(alg.setProperty("BeamPenumbraRadius", 0.0), std::invalid_argument);
}

void test_setting_umbra_less_than_penumbra_throws_invalid_argument()
{
auto testWS = createFlatPlateSampleWS();
auto alg = createTestAlgorithm(testWS);

alg->setProperty("BeamUmbraRadius", 2.5);
alg->setProperty("BeamPenumbraRadius", 1.5);

TS_ASSERT_THROWS(alg->execute(), std::invalid_argument);
TS_ASSERT_THROWS(alg.setProperty("BeamRadius", -1.5), std::invalid_argument);
TS_ASSERT_THROWS(alg.setProperty("BeamRadius", 0.0), std::invalid_argument);
}

void test_input_workspace_with_detector_that_has_no_shape_throws_exception()
Expand All @@ -134,8 +121,7 @@ class CalculateMSVesuvioTest : public CxxTest::TestSuite
const double sampleProps[9] = {1.007900, 0.9272392, 5.003738, 16.00000, 3.2587662E-02, 13.92299,
27.50000, 4.0172841E-02, 15.07701};
alg->setProperty("AtomicProperties", std::vector<double>(sampleProps, sampleProps + 9));
alg->setProperty("BeamUmbraRadius", 1.5);
alg->setProperty("BeamPenumbraRadius", 2.5);
alg->setProperty("BeamRadius", 2.5);
// outputs
alg->setPropertyValue("TotalScatteringWS", "__unused_for_child");
alg->setPropertyValue("MultipleScatteringWS", "__unused_for_child");
Expand Down

0 comments on commit 91644b7

Please sign in to comment.