Skip to content

Commit

Permalink
Refs #9349 - Move monitor det ID check to validator.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterParker committed Jul 24, 2014
1 parent 973f085 commit 5ecd48a
Showing 1 changed file with 1 addition and 6 deletions.
Expand Up @@ -44,7 +44,7 @@ void CalculateTransmission::init()
auto zeroOrMore = boost::make_shared<BoundedValidator<int> >();
zeroOrMore->setLower(0);
// The defaults here are the correct detector numbers for LOQ
declareProperty("IncidentBeamMonitor",EMPTY_INT(),"The UDET of the incident beam monitor");
declareProperty("IncidentBeamMonitor",EMPTY_INT(),zeroOrMore,"The UDET of the incident beam monitor");
declareProperty("TransmissionMonitor",3,zeroOrMore,"The UDET of the transmission monitor");

declareProperty(new ArrayProperty<double>("RebinParams"),
Expand Down Expand Up @@ -75,11 +75,6 @@ void CalculateTransmission::exec()
int beamMonitorID = getProperty("IncidentBeamMonitor");
bool normaliseToMonitor = true;
if ( isEmpty(beamMonitorID) ) normaliseToMonitor = false;
else if (beamMonitorID<0)
{
g_log.error("The beam monitor UDET should be greater or equal to zero");
throw std::invalid_argument("The beam monitor UDET should be greater or equal to zero");
}

// Check that the two input workspaces are from the same instrument
if ( sampleWS->getInstrument()->getName() != directWS->getInstrument()->getName() )
Expand Down

0 comments on commit 5ecd48a

Please sign in to comment.