Skip to content

Commit

Permalink
Re #11182. deltaTOF is required to be positive
Browse files Browse the repository at this point in the history
  • Loading branch information
peterfpeterson committed Feb 27, 2015
1 parent 5a3c862 commit 71d8f2f
Showing 1 changed file with 7 additions and 5 deletions.
Expand Up @@ -5,6 +5,7 @@
#include "MantidGeometry/IDetector.h"
#include "MantidGeometry/Instrument/Detector.h"
#include "MantidAPI/WorkspaceProperty.h"
#include "MantidKernel/BoundedValidator.h"
#include "MantidKernel/PhysicalConstants.h"
#include "MantidKernel/TimeSeriesProperty.h"
#include "MantidKernel/V3D.h"
Expand Down Expand Up @@ -58,11 +59,14 @@ void EstimatePDDetectorResolution::init() {
declareProperty(new WorkspaceProperty<MatrixWorkspace>("OutputWorkspace", "",
Direction::Output),
"Name of the output workspace containing delta(d)/d of each "
"detector/spectrum. ");
"detector/spectrum.");

auto positive = boost::make_shared<BoundedValidator<double> >();
positive->setLower(0.);
positive->setLowerExclusive(true);
declareProperty(
"DeltaTOF", EMPTY_DBL(),
"DeltaT as the resolution of TOF with unit microsecond (10^-6m). ");
"DeltaTOF", 0., positive,
"DeltaT as the resolution of TOF with unit microsecond (10^-6m).");
}

//----------------------------------------------------------------------------------------------
Expand All @@ -87,8 +91,6 @@ void EstimatePDDetectorResolution::processAlgProperties() {
m_inputWS = getProperty("InputWorkspace");

m_deltaT = getProperty("DeltaTOF");
if (isEmpty(m_deltaT))
throw runtime_error("DeltaTOF must be given!");
m_deltaT *= 1.0E-6; // convert to meter
}

Expand Down

0 comments on commit 71d8f2f

Please sign in to comment.