void AlignDetectors::getCalibrationWS(MatrixWorkspace_sptr inputWS) { const std::string calFileName = getPropertyValue("CalibrationFile"); if (!calFileName.empty()) { progress(0.0, "Reading calibration file"); loadCalFile(inputWS, calFileName); } else { m_calibrationWS = getProperty("CalibrationWorkspace"); if (!m_calibrationWS) { OffsetsWorkspace_sptr offsetsWS = getProperty("OffsetsWorkspace"); auto alg = createChildAlgorithm("ConvertDiffCal"); alg->setProperty("OffsetsWorkspace", offsetsWS); alg->executeAsChildAlg(); m_calibrationWS = alg->getProperty("OutputWorkspace"); m_calibrationWS->setTitle(offsetsWS->getTitle()); } } }
void AlignDetectors::getCalibrationWS(MatrixWorkspace_sptr inputWS) { m_calibrationWS = getProperty("CalibrationWorkspace"); if (m_calibrationWS) return; // nothing more to do OffsetsWorkspace_sptr offsetsWS = getProperty("OffsetsWorkspace"); if (offsetsWS) { auto alg = createChildAlgorithm("ConvertDiffCal"); alg->setProperty("OffsetsWorkspace", offsetsWS); alg->executeAsChildAlg(); m_calibrationWS = alg->getProperty("OutputWorkspace"); m_calibrationWS->setTitle(offsetsWS->getTitle()); return; } const std::string calFileName = getPropertyValue("CalibrationFile"); if (!calFileName.empty()) { progress(0.0, "Reading calibration file"); loadCalFile(inputWS, calFileName); return; } throw std::runtime_error("Failed to determine calibration information"); }