From e73f3e91ec5e189583e080583edf6386f9d20ac1 Mon Sep 17 00:00:00 2001 From: Michael Reuter <reuterma@ornl.gov> Date: Mon, 23 Jul 2012 17:05:41 -0400 Subject: [PATCH] Refs #5453 and #5605. Changing to hopefully clearer parameter names. --- .../src/DgsConvertToEnergyTransfer.cpp | 36 +++++++++---------- .../WorkflowAlgorithms/src/DgsReduction.cpp | 16 ++++----- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp index 7190d26d737..39ba71582b0 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsConvertToEnergyTransfer.cpp @@ -77,10 +77,10 @@ namespace WorkflowAlgorithms "An input workspace."); auto mustBePositive = boost::make_shared<BoundedValidator<double> >(); mustBePositive->setLower(0.0); - this->declareProperty("IncidentEnergy", EMPTY_DBL(), mustBePositive, - "Set the value of the incident energy in meV."); - this->declareProperty("FixedIncidentEnergy", false, - "Declare the value of the incident energy to be fixed (will not be calculated)."); + this->declareProperty("IncidentEnergyGuess", EMPTY_DBL(), mustBePositive, + "Set the value of the incident energy guess in meV."); + this->declareProperty("UseIncidentEnergyGuess", false, + "Use the incident energy guess as the actual value (will not be calculated)."); this->declareProperty(new ArrayProperty<double>("EnergyTransferRange", boost::make_shared<RebinParamsValidator>(true)), "A comma separated list of first bin boundary, width, last bin boundary.\n" @@ -151,11 +151,11 @@ namespace WorkflowAlgorithms // Calculate the initial energy and time zero const std::string facility = ConfigService::Instance().getFacility().name(); g_log.notice() << "Processing for " << facility << std::endl; - const double eiGuess = this->getProperty("IncidentEnergy"); - const bool fixedEi = this->getProperty("FixedIncidentEnergy"); + const double eiGuess = this->getProperty("IncidentEnergyGuess"); + const bool useEiGuess = this->getProperty("UseIncidentEnergyGuess"); const std::vector<double> etBinning = this->getProperty("EnergyTransferRange"); - double initialEnergy = 0.0; + double incidentEnergy = 0.0; double monPeak = 0.0; specid_t eiMon1Spec = 0; specid_t eiMon2Spec = 0; @@ -168,25 +168,25 @@ namespace WorkflowAlgorithms double tZero = 0.0; if ("CNCS" == instName || "HYSPEC" == instName) { - initialEnergy = eiGuess; + incidentEnergy = eiGuess; if ("HYSPEC" == instName) { - double powVal = initialEnergy / 27.0; + double powVal = incidentEnergy / 27.0; tZero = 25.0 + 85.0 / (1.0 + std::pow(powVal, 4)); } // Do CNCS else { - double powVal = 1.0 + initialEnergy; + double powVal = 1.0 + incidentEnergy; tZero = (0.1982 * std::pow(powVal, -0.84098)) * 1000.0; } } // Do ARCS and SEQUOIA else { - if (fixedEi) + if (useEiGuess) { - initialEnergy = eiGuess; + incidentEnergy = eiGuess; } else { @@ -241,13 +241,13 @@ namespace WorkflowAlgorithms try { getei->execute(); - initialEnergy = getei->getProperty("IncidentEnergy"); + incidentEnergy = getei->getProperty("IncidentEnergy"); tZero = getei->getProperty("Tzero"); } catch (...) { g_log.error() << "GetEi failed, using guess as initial energy and T0 = 0" << std::endl; - initialEnergy = eiGuess; + incidentEnergy = eiGuess; } } } @@ -278,7 +278,7 @@ namespace WorkflowAlgorithms monPeak = getei->getProperty("FirstMonitorPeak"); const specid_t monIndex = getei->getProperty("FirstMonitorIndex"); // Why did the old way get it from the log? - initialEnergy = getei->getProperty("IncidentEnergy"); + incidentEnergy = getei->getProperty("IncidentEnergy"); IAlgorithm_sptr cbo = this->createSubAlgorithm("ChangeBinOffset"); cbo->setAlwaysStoreInADS(true); @@ -339,7 +339,7 @@ namespace WorkflowAlgorithms cnvun->setProperty("OutputWorkspace", outWsName); cnvun->setProperty("Target", "DeltaE"); cnvun->setProperty("EMode", "Direct"); - cnvun->setProperty("EFixed", initialEnergy); + cnvun->setProperty("EFixed", incidentEnergy); cnvun->execute(); if (etBinning.empty()) @@ -359,7 +359,7 @@ namespace WorkflowAlgorithms cnvun->setProperty("OutputWorkspace", outWsName); cnvun->setProperty("Target", "TOF"); cnvun->setProperty("EMode", "Direct"); - cnvun->setProperty("EFixed", initialEnergy); + cnvun->setProperty("EFixed", incidentEnergy); cnvun->execute(); // Make result workspace a distribution @@ -447,7 +447,7 @@ namespace WorkflowAlgorithms cnvun->setProperty("OutputWorkspace", outWsName); cnvun->setProperty("Target", "DeltaE"); cnvun->setProperty("EMode", "Direct"); - cnvun->setProperty("EFixed", initialEnergy); + cnvun->setProperty("EFixed", incidentEnergy); cnvun->execute(); // Rebin if necessary diff --git a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp index 12427e02944..e229518fba2 100644 --- a/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp +++ b/Code/Mantid/Framework/WorkflowAlgorithms/src/DgsReduction.cpp @@ -78,10 +78,10 @@ namespace WorkflowAlgorithms //declareProperty("SampleData", "", "Run numbers, files or workspaces of the data sets to be reduced"); auto mustBePositive = boost::make_shared<BoundedValidator<double> >(); mustBePositive->setLower(0.0); - declareProperty("IncidentEnergy", EMPTY_DBL(), mustBePositive, - "Set the value of the incident energy in meV."); - declareProperty("FixedIncidentEnergy", false, - "Declare the value of the incident energy to be fixed (will not be calculated)."); + declareProperty("IncidentEnergyGuess", EMPTY_DBL(), mustBePositive, + "Set the value of the incident energy guess in meV."); + declareProperty("UseIncidentEnergyGuess", false, + "Use the incident energy guess as the actual value (will not be calculated)."); declareProperty(new ArrayProperty<double>("EnergyTransferRange", boost::make_shared<RebinParamsValidator>(true)), "A comma separated list of first bin boundary, width, last bin boundary.\n" @@ -322,8 +322,8 @@ namespace WorkflowAlgorithms Workspace_sptr inputWS = this->loadInputData(reductionManager); // Setup for the convert to energy transfer workflow algorithm - const double incidentEnergy = this->getProperty("IncidentEnergy"); - const bool fixedEi = this->getProperty("FixedIncidentEnergy"); + const double incidentEnergyGuess = this->getProperty("IncidentEnergyGuess"); + const bool useEiGuess = this->getProperty("UseIncidentEnergyGuess"); const std::vector<double> etBinning = this->getProperty("EnergyTransferRange"); const bool sofphieIsDistribution = this->getProperty("SofPhiEIsDistribution"); const std::string incidentBeamNormType = this->getProperty("IncidentBeamNormalisation"); @@ -335,8 +335,8 @@ namespace WorkflowAlgorithms IAlgorithm_sptr etConv = this->createSubAlgorithm("DgsConvertToEnergyTransfer"); etConv->setProperty("InputWorkspace", inputWS); - etConv->setProperty("IncidentEnergy", incidentEnergy); - etConv->setProperty("FixedIncidentEnergy", fixedEi); + etConv->setProperty("IncidentEnergyGuess", incidentEnergyGuess); + etConv->setProperty("UseIncidentEnergyGuess", useEiGuess); etConv->setProperty("EnergyTransferRange", etBinning); etConv->setProperty("SofPhiEIsDistribution", sofphieIsDistribution); etConv->setProperty("IncidentBeamNormalisation", incidentBeamNormType); -- GitLab