Skip to content

Commit

Permalink
Merge pull request #37404 from mantidproject/symmetrise_bug
Browse files Browse the repository at this point in the history
Bug preventing Mantid from processing  algorithms from some indirect/inelastic interfaces
  • Loading branch information
SilkeSchomann authored May 24, 2024
2 parents abf94c6 + 8dc7b46 commit 645b183
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ void DiffractionReduction::runGenericReduction(const QString &instName, const QS
rebin = rebinStart + "," + rebinWidth + "," + rebinEnd;

// Get detector range
std::vector<long> detRange;
detRange.emplace_back(static_cast<long>(m_uiForm.spSpecMin->value()));
detRange.emplace_back(static_cast<long>(m_uiForm.spSpecMax->value()));
std::vector<int> detRange;
detRange.emplace_back(m_uiForm.spSpecMin->value());
detRange.emplace_back(m_uiForm.spSpecMax->value());

// Get generic reduction algorithm instance
IAlgorithm_sptr msgDiffReduction = AlgorithmManager::Instance().create("ISISDiffractionReduction");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ void ISISDiagnostics::run() {
QString suffix = "_" + getAnalyserName() + getReflectionName() + "_slice";
QString filenames = m_uiForm.dsInputFiles->getFilenames().join(",");

std::vector<long> spectraRange;
spectraRange.emplace_back(static_cast<long>(m_dblManager->value(m_properties["SpecMin"])));
spectraRange.emplace_back(static_cast<long>(m_dblManager->value(m_properties["SpecMax"])));
std::vector<int> spectraRange;
spectraRange.emplace_back(static_cast<int>(m_dblManager->value(m_properties["SpecMin"])));
spectraRange.emplace_back(static_cast<int>(m_dblManager->value(m_properties["SpecMax"])));

std::vector<double> peakRange;
peakRange.emplace_back(m_dblManager->value(m_properties["PeakStart"]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void IETModel::setInputProperties(IAlgorithmRuntimeProps &properties, IETInputDa

void IETModel::setConversionProperties(IAlgorithmRuntimeProps &properties, IETConversionData const &conversionData,
std::string const &instrument) {
std::vector<long> detectorRange;
std::vector<int> detectorRange;

if (instrument == "IRIS" || instrument == "OSIRIS") {
Mantid::API::AlgorithmProperties::update("Efixed", conversionData.getEfixed(), properties);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ISISIndirectEnergyTransfer : public Algorithm {
declareProperty("CalibrationWorkspace", "");

declareProperty("Efixed", 0.0);
declareProperty("SpectraRange", std::vector<long>{0, 2});
declareProperty("SpectraRange", std::vector<int>{0, 2});
declareProperty("BackgroundRange", std::vector<double>{0.0, 0.0});
declareProperty("RebinString", "");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SymmetriseModel::SymmetriseModel()
m_eMin(), m_eMax(), m_isPositiveReflect(), m_spectraRange() {}

void SymmetriseModel::setupPreviewAlgorithm(MantidQt::API::BatchAlgorithmRunner *batchAlgoRunner,
std::vector<long> const &spectraRange) {
std::vector<int> const &spectraRange) {

if (!m_isPositiveReflect) {
reflectNegativeToPositive();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MANTIDQT_INELASTIC_DLL SymmetriseModel {
SymmetriseModel();
~SymmetriseModel() = default;
void setupPreviewAlgorithm(MantidQt::API::BatchAlgorithmRunner *batchAlgoRunner,
std::vector<long> const &spectraRange);
std::vector<int> const &spectraRange);
std::string setupSymmetriseAlgorithm(MantidQt::API::BatchAlgorithmRunner *batchAlgoRunner);
void reflectNegativeToPositive();
void setWorkspaceName(std::string const &workspaceName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ void SymmetrisePresenter::run() {
return;

if (m_isPreview) {
long spectrumNumber = static_cast<long>(m_view->getPreviewSpec());
std::vector<long> spectraRange(2, spectrumNumber);
int spectrumNumber = static_cast<int>(m_view->getPreviewSpec());
std::vector<int> spectraRange(2, spectrumNumber);

m_model->setupPreviewAlgorithm(m_batchAlgoRunner, spectraRange);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Symmetrise : public Algorithm {
declareProperty("OutputWorkspace", "OutputWorkspace");
declareProperty("OutputPropertiesTable", "OutputPropertiesTable");

declareProperty("SpectraRange", std::vector<long>{0, 2});
declareProperty("SpectraRange", std::vector<int>{0, 2});
declareProperty("XMin", 0.05);
declareProperty("XMax", 0.6);
};
Expand Down Expand Up @@ -80,7 +80,7 @@ class SymmetriseModelTest : public CxxTest::TestSuite {
m_model->setWorkspaceName(inputWS);
m_model->setIsPositiveReflect(true);

std::vector<long> spectraRange(2, 4);
std::vector<int> spectraRange(2, 4);
m_model->setupPreviewAlgorithm(&batch, spectraRange);
batch.executeBatch();

Expand All @@ -107,7 +107,7 @@ class SymmetriseModelTest : public CxxTest::TestSuite {
m_model->setWorkspaceName(inputWS);
m_model->setIsPositiveReflect(false);

std::vector<long> spectraRange(2, 4);
std::vector<int> spectraRange(2, 4);
m_model->setupPreviewAlgorithm(&batch, spectraRange);
batch.executeBatch();

Expand Down

0 comments on commit 645b183

Please sign in to comment.