Commit c49657f7 authored by Nick Draper's avatar Nick Draper
Browse files

Many updates of specIndex, specInd, spIndex

re #15450
parent f7f9f03c
......@@ -85,8 +85,8 @@ private:
void convertToDistribution(API::MatrixWorkspace_sptr workspace);
void restoreDistributionState(API::MatrixWorkspace_sptr workspace);
void checkRange(double &startX, double &endX);
void getSpecInds(std::vector<int> &output, const int workspaceTotal);
double Mean(const API::MatrixWorkspace_const_sptr WS, const int specInd,
void getWsInds(std::vector<int> &output, const int workspaceTotal);
double Mean(const API::MatrixWorkspace_const_sptr WS, const int wsInd,
const double startX, const double endX, double &variance) const;
double LinearFit(API::MatrixWorkspace_sptr WS, int spectrum, double startX,
double endX);
......
......@@ -86,13 +86,13 @@ private:
void getGeometry(API::MatrixWorkspace_const_sptr WS, specnum_t mon0Spec,
specnum_t mon1Spec, double &monitor0Dist,
double &monitor1Dist) const;
std::vector<size_t> getMonitorSpecIndexs(API::MatrixWorkspace_const_sptr WS,
std::vector<size_t> getMonitorWsIndexs(API::MatrixWorkspace_const_sptr WS,
specnum_t specNum1,
specnum_t specNum2) const;
double timeToFly(double s, double E_KE) const;
double getPeakCentre(API::MatrixWorkspace_const_sptr WS,
const int64_t monitIn, const double peakTime);
void extractSpec(int64_t specInd, double start, double end);
void extractSpec(int64_t wsInd, double start, double end);
void getPeakEstimates(double &height, int64_t &centreInd,
double &background) const;
double findHalfLoc(MantidVec::size_type startInd, const double height,
......
......@@ -108,9 +108,9 @@ private:
/// over-reading
double m_hiFrac;
/// The index of the first spectrum to calculate
int m_minSpec;
int m_minWsIndex;
/// The index of the last spectrum to calculate
int m_maxSpec;
int m_maxWsIndex;
/// Start point for integration
double m_rangeLower;
/// End point for integration
......
......@@ -69,7 +69,7 @@ private:
API::MatrixWorkspace_sptr
setUpOutputWorkspace(const std::vector<double> &binParams) const;
// these are the steps that are run on each individual spectrum
void calculateNormalization(const size_t wavStart, const size_t specInd,
void calculateNormalization(const size_t wavStart, const size_t wsIndex,
API::MatrixWorkspace_const_sptr pixelAdj,
API::MatrixWorkspace_const_sptr wavePixelAdj,
double const *const binNorms,
......@@ -77,16 +77,16 @@ private:
const MantidVec::iterator norm,
const MantidVec::iterator normETo2) const;
void pixelWeight(API::MatrixWorkspace_const_sptr pixelAdj,
const size_t specIndex, double &weight, double &error) const;
const size_t wsIndex, double &weight, double &error) const;
void addWaveAdj(const double *c, const double *Dc, MantidVec::iterator bInOut,
MantidVec::iterator e2InOut) const;
void addWaveAdj(const double *c, const double *Dc, MantidVec::iterator bInOut,
MantidVec::iterator e2InOut, MantidVec::const_iterator,
MantidVec::const_iterator) const;
void normToMask(const size_t offSet, const size_t specIndex,
void normToMask(const size_t offSet, const size_t wsIndex,
const MantidVec::iterator theNorms,
const MantidVec::iterator errorSquared) const;
void convertWavetoQ(const size_t specInd, const bool doGravity,
void convertWavetoQ(const size_t wsInd, const bool doGravity,
const size_t offset, MantidVec::iterator Qs,
const double extraLength) const;
void getQBinPlus1(const MantidVec &OutQs, const double QToFind,
......
......@@ -48,46 +48,14 @@ public:
size_t waveLengthCutOff(API::MatrixWorkspace_const_sptr dataWS,
const double RCut, const double WCut,
const size_t specInd) const;
const size_t wsInd) const;
void outputParts(API::Algorithm *alg, API::MatrixWorkspace_sptr sumOfCounts,
API::MatrixWorkspace_sptr sumOfNormFactors);
private:
/// the experimental workspace with counts across the detector
/* API::MatrixWorkspace_const_sptr m_dataWS;
///The radius cut off, should be value of the property RadiusCut. A value of
zero here will disable the cut off and all wavelengths are used
double m_RCut;
///The wavelength cut off divided by the radius cut is used in the
calculation of the first wavelength to include, it's value is only used if
RadiusCut > 0
double m_WCutOver;
void initizeCutOffs(const double RCut, const double WCut);
API::MatrixWorkspace_sptr setUpOutputWorkspace(const std::vector<double> &
binParams) const;
//these are the steps that are run on each individual spectrum
size_t waveLengthCutOff(const size_t specInd) const;
void calculateNormalization(const size_t wavStart, const size_t specInd,
API::MatrixWorkspace_const_sptr pixelAdj, double const * const binNorms,
double const * const binNormEs, const MantidVec::iterator norm, const
MantidVec::iterator normETo2) const;
void pixelWeight(API::MatrixWorkspace_const_sptr pixelAdj, const size_t
specIndex, double & weight, double & error) const;
void addWaveAdj(const double * c, const double * Dc, MantidVec::iterator
bInOut, MantidVec::iterator e2InOut) const;
void normToMask(const size_t offSet, const size_t specIndex, const
MantidVec::iterator theNorms, const MantidVec::iterator errorSquared) const;
void convertWavetoQ(const size_t specInd, const bool doGravity, const size_t
offset, MantidVec::iterator Qs) const;
void getQBinPlus1(const MantidVec & OutQs, const double QToFind,
MantidVec::const_iterator & loc) const;
void normalize(const MantidVec & normSum, const MantidVec & normError2,
MantidVec & YOut, MantidVec & errors) const;*/
};
} // namespace Algorithms
......
......@@ -97,9 +97,9 @@ void CalculateFlatBackground::exec() {
double startX, endX;
this->checkRange(startX, endX);
std::vector<int> specInds = getProperty("WorkspaceIndexList");
std::vector<int> wsInds = getProperty("WorkspaceIndexList");
// check if the user passed an empty list, if so all of spec will be processed
this->getSpecInds(specInds, numHists);
this->getWsInds(wsInds, numHists);
// Are we removing the background?
const bool removeBackground =
......@@ -130,14 +130,14 @@ void CalculateFlatBackground::exec() {
// these are used to report information to the user, one progress update for
// each percent and a report on the size of the background found
double prg(0.2), backgroundTotal(0);
const double toFitsize(static_cast<double>(specInds.size()));
const double toFitsize(static_cast<double>(wsInds.size()));
const int progStep(static_cast<int>(ceil(toFitsize / 80.0)));
// Now loop over the required spectra
std::vector<int>::const_iterator specIt;
// local cache for global variable
bool skipMonitors(m_skipMonitors);
for (specIt = specInds.begin(); specIt != specInds.end(); ++specIt) {
for (specIt = wsInds.begin(); specIt != wsInds.end(); ++specIt) {
const int currentSpec = *specIt;
try {
if (skipMonitors) { // this will fail in Windows ReleaseWithDebug info
......@@ -211,7 +211,7 @@ void CalculateFlatBackground::exec() {
}
// make regular progress reports and check for canceling the algorithm
if (static_cast<int>(specInds.end() - specInds.begin()) % progStep == 0) {
if (static_cast<int>(wsInds.end() - wsInds.begin()) % progStep == 0) {
interruption_point();
prg += (progStep * 0.7 / toFitsize);
progress(prg);
......@@ -308,7 +308,7 @@ void CalculateFlatBackground::checkRange(double &startX, double &endX) {
* @param workspaceTotal :: required to be the total number of spectra in the
* workspace
*/
void CalculateFlatBackground::getSpecInds(std::vector<int> &output,
void CalculateFlatBackground::getWsInds(std::vector<int> &output,
const int workspaceTotal) {
if (output.size() > 0) {
return;
......@@ -323,7 +323,7 @@ void CalculateFlatBackground::getSpecInds(std::vector<int> &output,
* variance (error^2) of that
* number
* @param WS :: points to the input workspace
* @param specInd :: index of the spectrum to process
* @param wsInd :: index of the spectrum to process
* @param startX :: a X-value in the first bin that will be considered, must not
* be greater endX
* @param endX :: a X-value in the last bin that will be considered, must not
......@@ -337,11 +337,11 @@ void CalculateFlatBackground::getSpecInds(std::vector<int> &output,
* spectra
*/
double CalculateFlatBackground::Mean(const API::MatrixWorkspace_const_sptr WS,
const int specInd, const double startX,
const int wsInd, const double startX,
const double endX,
double &variance) const {
const MantidVec &XS = WS->readX(specInd), &YS = WS->readY(specInd);
const MantidVec &ES = WS->readE(specInd);
const MantidVec &XS = WS->readX(wsInd), &YS = WS->readY(wsInd);
const MantidVec &ES = WS->readE(wsInd);
// the function checkRange should already have checked that startX <= endX,
// but we still need to check values weren't out side the ranges
if (endX > XS.back() || startX < XS.front()) {
......
......@@ -136,8 +136,8 @@ void DetectorEfficiencyVariation::exec() {
*/
void DetectorEfficiencyVariation::retrieveProperties(
API::MatrixWorkspace_sptr &whiteBeam1,
API::MatrixWorkspace_sptr &whiteBeam2, double &variation, int &minSpec,
int &maxSpec) {
API::MatrixWorkspace_sptr &whiteBeam2, double &variation, int &startWsIndex,
int &endWsIndex) {
whiteBeam1 = getProperty("WhiteBeamBase");
whiteBeam2 = getProperty("WhiteBeamCompare");
if (whiteBeam1->getInstrument()->getName() !=
......@@ -145,8 +145,8 @@ void DetectorEfficiencyVariation::retrieveProperties(
throw std::invalid_argument("The two input white beam vanadium workspaces "
"must be from the same instrument");
}
int maxSpecIndex = static_cast<int>(whiteBeam1->getNumberHistograms()) - 1;
if (maxSpecIndex !=
int maxWsIndex = static_cast<int>(whiteBeam1->getNumberHistograms()) - 1;
if (maxWsIndex !=
static_cast<int>(whiteBeam2->getNumberHistograms()) -
1) { // we would get a crash later on if this were not true
throw std::invalid_argument("The input white beam vanadium workspaces must "
......@@ -155,24 +155,24 @@ void DetectorEfficiencyVariation::retrieveProperties(
variation = getProperty("Variation");
minSpec = getProperty("StartWorkspaceIndex");
if ((minSpec < 0) || (minSpec > maxSpecIndex)) {
startWsIndex = getProperty("StartWorkspaceIndex");
if ((startWsIndex < 0) || (startWsIndex > maxWsIndex)) {
g_log.warning("StartWorkspaceIndex out of range, changed to 0");
minSpec = 0;
startWsIndex = 0;
}
maxSpec = getProperty("EndWorkspaceIndex");
if (maxSpec == Mantid::EMPTY_INT())
maxSpec = maxSpecIndex;
if ((maxSpec < 0) || (maxSpec > maxSpecIndex)) {
endWsIndex = getProperty("EndWorkspaceIndex");
if (endWsIndex == Mantid::EMPTY_INT())
endWsIndex = maxWsIndex;
if ((endWsIndex < 0) || (endWsIndex > maxWsIndex)) {
g_log.warning(
"EndWorkspaceIndex out of range, changed to max Workspace number");
maxSpec = maxSpecIndex;
endWsIndex = maxWsIndex;
}
if ((maxSpec < minSpec)) {
if ((endWsIndex < startWsIndex)) {
g_log.warning(
"EndWorkspaceIndex can not be less than the StartWorkspaceIndex, "
"changed to max Workspace number");
maxSpec = maxSpecIndex;
endWsIndex = maxWsIndex;
}
}
......
......@@ -847,7 +847,7 @@ int GetDetOffsetsMultiPeaks::fitSpectra(
// throw if minD >= maxD
std::stringstream ess;
ess << "Stuff went wrong with wkspIndex=" << wi
<< " specIndex=" << inputW->getSpectrum(wi)->getSpectrumNo();
<< " specNum=" << inputW->getSpectrum(wi)->getSpectrumNo();
throw std::runtime_error(ess.str());
}
......
......@@ -108,7 +108,7 @@ void GetEi::exec() {
<< "%\n";
// get the histograms created by the monitors
std::vector<size_t> indexes = getMonitorSpecIndexs(inWS, mon1Spec, mon2Spec);
std::vector<size_t> indexes = getMonitorWsIndexs(inWS, mon1Spec, mon2Spec);
g_log.information()
<< "Looking for a peak in the first monitor spectrum, spectra index "
......@@ -207,7 +207,7 @@ void GetEi::getGeometry(API::MatrixWorkspace_const_sptr WS, specnum_t mon0Spec,
* @throw NotFoundError if one of the requested spectrum numbers was not found
* in the workspace
*/
std::vector<size_t> GetEi::getMonitorSpecIndexs(
std::vector<size_t> GetEi::getMonitorWsIndexs(
API::MatrixWorkspace_const_sptr WS, specnum_t specNum1,
specnum_t specNum2) const { // getting spectra numbers from detector IDs is
// hard because the map works the other way,
......@@ -223,7 +223,7 @@ std::vector<size_t> GetEi::getMonitorSpecIndexs(
// workspace, we can't continue from here
g_log.error() << "Couldn't find the first monitor spectrum, number "
<< specNum1 << std::endl;
throw Exception::NotFoundError("GetEi::getMonitorSpecIndexs()", specNum1);
throw Exception::NotFoundError("GetEi::getMonitorWsIndexs()", specNum1);
}
// nowe the second monitor
......@@ -233,7 +233,7 @@ std::vector<size_t> GetEi::getMonitorSpecIndexs(
// workspace, we can't continue from here
g_log.error() << "Couldn't find the second monitor spectrum, number "
<< specNum2 << std::endl;
throw Exception::NotFoundError("GetEi::getMonitorSpecIndexs()", specNum2);
throw Exception::NotFoundError("GetEi::getMonitorWsIndexs()", specNum2);
}
wsInds.push_back(specNumTemp[0]);
......@@ -307,17 +307,17 @@ double GetEi::getPeakCentre(API::MatrixWorkspace_const_sptr WS,
}
/** Calls CropWorkspace as a Child Algorithm and passes to it the InputWorkspace
* property
* @param specInd :: the index number of the histogram to extract
* @param wsInd :: the index number of the histogram to extract
* @param start :: the number of the first bin to include (starts counting bins
* at 0)
* @param end :: the number of the last bin to include (starts counting bins at
* 0)
* @throw out_of_range if start, end or specInd are set outside of the vaild
* @throw out_of_range if start, end or wsInd are set outside of the valid
* range for the workspace
* @throw runtime_error if the algorithm just falls over
* @throw invalid_argument if the input workspace does not have common binning
*/
void GetEi::extractSpec(int64_t specInd, double start, double end) {
void GetEi::extractSpec(int64_t wsInd, double start, double end) {
IAlgorithm_sptr childAlg = createChildAlgorithm(
"CropWorkspace", 100 * m_fracCompl, 100 * (m_fracCompl + CROP));
m_fracCompl += CROP;
......@@ -326,8 +326,8 @@ void GetEi::extractSpec(int64_t specInd, double start, double end) {
getProperty("InputWorkspace"));
childAlg->setProperty("XMin", start);
childAlg->setProperty("XMax", end);
childAlg->setProperty("StartWorkspaceIndex", specInd);
childAlg->setProperty("EndWorkspaceIndex", specInd);
childAlg->setProperty("StartWorkspaceIndex", wsInd);
childAlg->setProperty("EndWorkspaceIndex", wsInd);
childAlg->executeAsChildAlg();
m_tempWS = childAlg->getProperty("OutputWorkspace");
......
......@@ -344,7 +344,7 @@ double GetEi2::calculatePeakPosition(size_t ws_index, double t_min,
* @param end :: the number of the last bin to include (starts counting bins at
* 0)
* @return The cropped workspace
* @throw out_of_range if start, end or specInd are set outside of the vaild
* @throw out_of_range if start, end or ws_index are set outside of the valid
* range for the workspace
* @throw runtime_error if the algorithm just falls over
* @throw invalid_argument if the input workspace does not have common binning
......
......@@ -17,7 +17,7 @@ using namespace Geometry;
/// Default constructor
MedianDetectorTest::MedianDetectorTest()
: DetectorDiagnostic(), m_inputWS(), m_loFrac(0.1), m_hiFrac(1.5),
m_minSpec(0), m_maxSpec(EMPTY_INT()), m_rangeLower(0.0),
m_minWsIndex(0), m_maxWsIndex(EMPTY_INT()), m_rangeLower(0.0),
m_rangeUpper(0.0), m_solidAngle(false) {}
const std::string MedianDetectorTest::category() const { return "Diagnostics"; }
......@@ -96,11 +96,11 @@ void MedianDetectorTest::exec() {
// masking and will be used to record any
// required masking from this algorithm
MatrixWorkspace_sptr countsWS = integrateSpectra(
m_inputWS, m_minSpec, m_maxSpec, m_rangeLower, m_rangeUpper, true);
m_inputWS, m_minWsIndex, m_maxWsIndex, m_rangeLower, m_rangeUpper, true);
// 0. Correct for solid angle, if desired
if (m_solidAngle) {
MatrixWorkspace_sptr solidAngle = getSolidAngles(m_minSpec, m_maxSpec);
MatrixWorkspace_sptr solidAngle = getSolidAngles(m_minWsIndex, m_maxWsIndex);
if (solidAngle != nullptr) {
countsWS = countsWS / solidAngle;
}
......@@ -145,25 +145,25 @@ void MedianDetectorTest::exec() {
*/
void MedianDetectorTest::retrieveProperties() {
m_inputWS = getProperty("InputWorkspace");
int maxSpecIndex = static_cast<int>(m_inputWS->getNumberHistograms()) - 1;
int maxWsIndex = static_cast<int>(m_inputWS->getNumberHistograms()) - 1;
m_parents = getProperty("LevelsUp");
m_minSpec = getProperty("StartWorkspaceIndex");
if ((m_minSpec < 0) || (m_minSpec > maxSpecIndex)) {
m_minWsIndex = getProperty("StartWorkspaceIndex");
if ((m_minWsIndex < 0) || (m_minWsIndex > maxWsIndex)) {
g_log.warning("StartSpectrum out of range, changed to 0");
m_minSpec = 0;
m_minWsIndex = 0;
}
m_maxSpec = getProperty("EndWorkspaceIndex");
if (m_maxSpec == EMPTY_INT())
m_maxSpec = maxSpecIndex;
if ((m_maxSpec < 0) || (m_maxSpec > maxSpecIndex)) {
m_maxWsIndex = getProperty("EndWorkspaceIndex");
if (m_maxWsIndex == EMPTY_INT())
m_maxWsIndex = maxWsIndex;
if ((m_maxWsIndex < 0) || (m_maxWsIndex > maxWsIndex)) {
g_log.warning("EndSpectrum out of range, changed to max spectrum number");
m_maxSpec = maxSpecIndex;
m_maxWsIndex = maxWsIndex;
}
if ((m_maxSpec < m_minSpec)) {
if ((m_maxWsIndex < m_minWsIndex)) {
g_log.warning("EndSpectrum can not be less than the StartSpectrum, changed "
"to max spectrum number");
m_maxSpec = maxSpecIndex;
m_maxWsIndex = maxWsIndex;
}
m_loFrac = getProperty("LowThreshold");
......@@ -299,7 +299,7 @@ int MedianDetectorTest::doDetectorTests(
const double minSigma = getProperty("SignificanceTest");
// prepare to report progress
const int numSpec(m_maxSpec - m_minSpec);
const int numSpec(m_maxWsIndex - m_minWsIndex);
const int progStep = static_cast<int>(ceil(numSpec / 30.0));
int steps(0);
......
......@@ -520,21 +520,21 @@ void Q1D2::addWaveAdj(const double *c, const double *Dc,
}
/** Scaled to bin masking, to the normalization
* @param[in] offSet the inex number of the first bin in the input wavelengths
* @param[in] offSet the index number of the first bin in the input wavelengths
* that is actually being used
* @param[in] specIndex the spectrum to calculate
* @param[in] wsIndex the spectrum to calculate
* @param[in,out] theNorms normalization for each bin, this is multiplied by the
* proportion that is not masked and the normalization workspace
* @param[in,out] errorSquared the running total of the square of the
* uncertainty in the normalization
*/
void Q1D2::normToMask(const size_t offSet, const size_t specIndex,
void Q1D2::normToMask(const size_t offSet, const size_t wsIndex,
const MantidVec::iterator theNorms,
const MantidVec::iterator errorSquared) const {
// if any bins are masked it is normally a small proportion
if (m_dataWS->hasMaskedBins(specIndex)) {
if (m_dataWS->hasMaskedBins(wsIndex)) {
// Get a reference to the list of masked bins
const MatrixWorkspace::MaskList &mask = m_dataWS->maskedBins(specIndex);
const MatrixWorkspace::MaskList &mask = m_dataWS->maskedBins(wsIndex);
// Now iterate over the list, adjusting the weights for the affected bins
MatrixWorkspace::MaskList::const_iterator it;
for (it = mask.begin(); it != mask.end(); ++it) {
......@@ -556,7 +556,7 @@ void Q1D2::normToMask(const size_t offSet, const size_t specIndex,
/** Fills a vector with the Q values calculated from the wavelength bin centers
* from the input workspace and
* the workspace geometry as Q = 4*pi*sin(theta)/lambda
* @param[in] specInd the spectrum to calculate
* @param[in] wsInd the spectrum to calculate
* @param[in] doGravity if to include gravity in the calculation of Q
* @param[in] offset index number of the first input bin to use
* @param[in] extraLength for gravitational correction
......@@ -565,17 +565,17 @@ void Q1D2::normToMask(const size_t offSet, const size_t specIndex,
* @throw NotFoundError if the detector associated with the spectrum is not
* found in the instrument definition
*/
void Q1D2::convertWavetoQ(const size_t specInd, const bool doGravity,
void Q1D2::convertWavetoQ(const size_t wsInd, const bool doGravity,
const size_t offset, MantidVec::iterator Qs,
const double extraLength) const {
static const double FOUR_PI = 4.0 * M_PI;
IDetector_const_sptr det = m_dataWS->getDetector(specInd);
IDetector_const_sptr det = m_dataWS->getDetector(wsInd);
// wavelengths (lamda) to be converted to Q
auto waves = m_dataWS->readX(specInd).cbegin() + offset;
auto waves = m_dataWS->readX(wsInd).cbegin() + offset;
// going from bin boundaries to bin centered x-values the size goes down one
const MantidVec::const_iterator end = m_dataWS->readX(specInd).end() - 1;
const MantidVec::const_iterator end = m_dataWS->readX(wsInd).end() - 1;
if (doGravity) {
GravitySANSHelper grav(m_dataWS, det, extraLength);
for (; waves != end; ++Qs, ++waves) {
......
......@@ -144,12 +144,12 @@ void Qhelper::examineInput(API::MatrixWorkspace_const_sptr dataWS,
* @param RCut the radius cut off, should be value of the property RadiusCut
* (unit is mm)
* @param WCut this wavelength cut off, should be equal to the value WaveCut
* @param specInd spectrum that is being analysed
* @param wsInd spectrum that is being analysed
* @return index number of the first bin to include in the calculation
*/
size_t Qhelper::waveLengthCutOff(API::MatrixWorkspace_const_sptr dataWS,
const double RCut, const double WCut,
const size_t specInd) const {
const size_t wsInd) const {
double l_WCutOver = 0.0;
double l_RCut = 0.0; // locally we store RCut in units of meters
if (RCut > 0 && WCut > 0) {
......@@ -163,12 +163,12 @@ size_t Qhelper::waveLengthCutOff(API::MatrixWorkspace_const_sptr dataWS,
}
// get the distance of between this detector and the origin, which should be
// the along the beam center
const V3D posOnBank = dataWS->getDetector(specInd)->getPos();
const V3D posOnBank = dataWS->getDetector(wsInd)->getPos();
double R = (posOnBank.X() * posOnBank.X()) + (posOnBank.Y() * posOnBank.Y());
R = std::sqrt(R);
const double WMin = l_WCutOver * (l_RCut - R);
const MantidVec &Xs = dataWS->readX(specInd);
const MantidVec &Xs = dataWS->readX(wsInd);
return std::lower_bound(Xs.begin(), Xs.end(), WMin) - Xs.begin();
}
......
......@@ -98,7 +98,7 @@ void SumSpectra::exec() {
m_maxSpec = m_numberOfSpectra - 1;
}
// Something for m_maxSpec was given but it is out of range?
// Something for m_maxWsIndex was given but it is out of range?
if (!isEmpty(m_maxSpec) &&
(m_maxSpec > m_numberOfSpectra - 1 || m_maxSpec < m_minSpec)) {
g_log.warning("EndWorkspaceIndex out of range! Set to max Workspace Index");
......@@ -239,7 +239,7 @@ void SumSpectra::doWorkspace2D(MatrixWorkspace_const_sptr localworkspace,
numZeros = 0;
// Loop over spectra
// for (int i = m_minSpec; i <= m_maxSpec; ++i)
// for (int i = m_minWsIndex; i <= m_maxWsIndex; ++i)
for (auto it = this->m_indices.begin(); it != this->m_indices.end(); ++it) {
int i = *it;
// Don't go outside the range.
......@@ -353,7 +353,7 @@ void SumSpectra::doRebinnedOutput(MatrixWorkspace_sptr outputWorkspace,
numZeros = 0;
// Loop over spectra
// for (int i = m_minSpec; i <= m_maxSpec; ++i)
// for (int i = m_minWsIndex; i <= m_maxWsIndex; ++i)
for (auto it = m_indices.begin(); it != m_indices.end(); ++it) {
int i = *it;
// Don't go outside the range.
......@@ -450,7 +450,7 @@ void SumSpectra::execEvent(EventWorkspace_const_sptr localworkspace,
size_t numSpectra(0);
size_t numMasked(0);
size_t numZeros(0);
// for (int i = m_minSpec; i <= m_maxSpec; ++i)
// for (int i = m_minWsIndex; i <= m_maxWsIndex; ++i)
for (auto it = indices.begin(); it != indices.end(); ++it) {
int i = *it;
// Don't go outside the range.
......
......@@ -111,7 +111,7 @@ private:
/// Create a minimizer string based on template string provided
std::string getMinimizerString(const std::string &wsName,
const std::string &specIndex);
const std::string &wsIndex);
/// Base name of output workspace
std::string m_baseName;
......
......@@ -587,16 +587,16 @@ PlotPeakByLogValue::makeNames() const {
* Formats the minimizer string for a given spectrum from a given workspace.
*
* @param wsName Name of workspace being fitted
* @param specIndex Index of spectrum being fitted
* @param wsIndex Index of spectrum being fitted
* @return Formatted minimizer string
*/
std::string
PlotPeakByLogValue::getMinimizerString(const std::string &wsName,
const std::string &specIndex) {
const std::string &wsIndex) {
std::string format = getPropertyValue("Minimizer");
std::string wsBaseName = wsName + "_" + specIndex;
std::string wsBaseName = wsName + "_" + wsIndex;
boost::replace_all(format, "$wsname", wsName);
boost::replace_all(format, "$wsindex", specIndex);
boost::replace_all(format, "$wsindex", wsIndex);
boost::replace_all(format, "$basename", wsBaseName);
boost::replace_all(format, "$outputname", m_baseName);
......
......@@ -161,7 +161,7 @@ private:
double m_FracCompl;
/// stores lists of spectra indexes to group, although we never do an index
/// search on it
storage_map m_GroupSpecInds;
storage_map m_GroupWsInds;
// Implement abstract Algorithm methods
void init() override;
......
......@@ -140,7 +140,7 @@ private:
/// Prepare a vector of SpectraBlock structures to simplify loading
size_t
prepareSpectraBlocks(std::map<int64_t, std::string> &monitors,
const std::map<int64_t, specnum_t> &specInd2specNum_map,
const std::map<int64_t, specnum_t> &wsInd2specNum_map,
const DataBlock &LoadBlock);
/// Run LoadInstrument as a ChildAlgorithm
void runLoadInstrument(DataObjects::Workspace2D_sptr &);
......@@ -202,8 +202,8 @@ private:
/// if true, a spectra list or range of spectra is supplied
bool m_load_selected_spectra;
/// map of spectra Index to spectra Number (spectraID)
std::map<int64_t, specnum_t> m_specInd2specNum_map;
/// map of workspace Index to spectra Number (spectraID)
std::