Commit 43118844 authored by Alex Buts's avatar Alex Buts
Browse files

Re #16049 This should fix it

parent 3a2d7743
...@@ -180,7 +180,7 @@ void GetEi::getGeometry(API::MatrixWorkspace_const_sptr WS, specnum_t mon0Spec, ...@@ -180,7 +180,7 @@ void GetEi::getGeometry(API::MatrixWorkspace_const_sptr WS, specnum_t mon0Spec,
// repeat for the second detector // repeat for the second detector
try { try {
monWI = WS->getIndexFromSpectrumNumber(mon0Spec); monWI = WS->getIndexFromSpectrumNumber(mon1Spec);
} catch (std::runtime_error &) { } catch (std::runtime_error &) {
g_log.error() g_log.error()
<< "Could not find the workspace index for the monitor at spectrum " << "Could not find the workspace index for the monitor at spectrum "
...@@ -237,7 +237,7 @@ std::vector<size_t> GetEi::getMonitorWsIndexs( ...@@ -237,7 +237,7 @@ std::vector<size_t> GetEi::getMonitorWsIndexs(
throw Exception::NotFoundError("GetEi::getMonitorWsIndexs()", specNum2); throw Exception::NotFoundError("GetEi::getMonitorWsIndexs()", specNum2);
} }
wsInds.push_back(specNumTemp[0]); wsInds.push_back(wsIndexTemp[0]);
return wsInds; return wsInds;
} }
/** Uses E_KE = mv^2/2 and s = vt to calculate the time required for a neutron /** Uses E_KE = mv^2/2 and s = vt to calculate the time required for a neutron
...@@ -325,10 +325,18 @@ void GetEi::extractSpec(int64_t wsInd, double start, double end) { ...@@ -325,10 +325,18 @@ void GetEi::extractSpec(int64_t wsInd, double start, double end) {
childAlg->setProperty<MatrixWorkspace_sptr>("InputWorkspace", childAlg->setProperty<MatrixWorkspace_sptr>("InputWorkspace",
getProperty("InputWorkspace")); getProperty("InputWorkspace"));
childAlg->setProperty("XMin", start); childAlg->setProperty("XMin", start);
childAlg->setProperty("XMax", end); childAlg->setProperty("XMax", end);
childAlg->setProperty("StartWorkspaceIndex", wsInd); if (wsInd < std::numeric_limits<int>::max()) {
childAlg->setProperty("EndWorkspaceIndex", wsInd); auto ivsInd = static_cast<int>(wsInd);
childAlg->setProperty("StartWorkspaceIndex", ivsInd);
childAlg->setProperty("EndWorkspaceIndex", ivsInd);
}
else {
childAlg->setProperty("StartWorkspaceIndex", wsInd);
childAlg->setProperty("EndWorkspaceIndex", wsInd);
}
childAlg->executeAsChildAlg(); childAlg->executeAsChildAlg();
m_tempWS = childAlg->getProperty("OutputWorkspace"); m_tempWS = childAlg->getProperty("OutputWorkspace");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment