Commit 4be4e5a6 authored by Nick Draper's avatar Nick Draper
Browse files

change specid_t to specnum_t is was a source of confusion

re #15450
parent 206fb6a3
......@@ -87,8 +87,8 @@ public:
/// Find the index of the given double value
virtual size_t indexOfValue(const double value) const = 0;
/// Get the spectrum index
virtual specid_t spectraNo(const std::size_t &index) const;
/// Get the spectrum number
virtual specnum_t spectraNo(const std::size_t &index) const;
/// Get the length of the axis
virtual std::size_t length() const = 0;
......
......@@ -24,7 +24,7 @@ public:
IEventList() {}
/// Constructor
IEventList(specid_t specNo) : ISpectrum(specNo) {}
IEventList(specnum_t specNo) : ISpectrum(specNo) {}
/// Return the current event type for the list
virtual Mantid::API::EventType getEventType() const = 0;
......
......@@ -135,7 +135,7 @@ public:
* spectra.
* @param specList :: A vector with spectra indices.
*/
virtual void setSpectra(const std::vector<specid_t> &specList) {
virtual void setSpectra(const std::vector<specnum_t> &specList) {
(void)specList;
}
......
......@@ -47,7 +47,7 @@ namespace API {
class DLLExport ISpectrum {
public:
ISpectrum();
ISpectrum(const specid_t specNo);
ISpectrum(const specnum_t specNo);
ISpectrum(const ISpectrum &other);
virtual ~ISpectrum();
......@@ -112,9 +112,9 @@ public:
void clearDetectorIDs();
// ---------------------------------------------------------
specid_t getSpectrumNo() const;
specnum_t getSpectrumNo() const;
void setSpectrumNo(specid_t num);
void setSpectrumNo(specnum_t num);
// ---------------------------------------------------------
virtual void lockData() const;
......@@ -126,7 +126,7 @@ public:
protected:
/// The spectrum number of this spectrum
specid_t m_specNo;
specnum_t m_specNo;
/// Set of the detector IDs associated with this spectrum
std::set<detid_t> detectorIDs;
......
......@@ -103,18 +103,18 @@ public:
/// Causes the nearest neighbours map to be rebuilt
void rebuildNearestNeighbours();
/// Query the NearestNeighbours object for a detector
std::map<specid_t, Mantid::Kernel::V3D>
std::map<specnum_t, Mantid::Kernel::V3D>
getNeighbours(const Geometry::IDetector *comp, const double radius = 0.0,
const bool ignoreMaskedDetectors = false) const;
/// Query the NearestNeighbours object for a given spectrum index using a
/// search radius
std::map<specid_t, Mantid::Kernel::V3D>
getNeighbours(specid_t spec, const double radius,
std::map<specnum_t, Mantid::Kernel::V3D>
getNeighbours(specnum_t spec, const double radius,
const bool ignoreMaskedDetectors = false) const;
/// Query the NearestNeighbours object for a given spectrum index using the
/// direct number of nearest neighbours
std::map<specid_t, Mantid::Kernel::V3D>
getNeighboursExact(specid_t spec, const int nNeighbours,
std::map<specnum_t, Mantid::Kernel::V3D>
getNeighboursExact(specnum_t spec, const int nNeighbours,
const bool ignoreMaskedDetectors = false) const;
//@}
......@@ -131,14 +131,14 @@ public:
getDetectorIDToWorkspaceIndexVector(std::vector<size_t> &out, detid_t &offset,
bool throwIfMultipleDets = false) const;
virtual void getSpectrumToWorkspaceIndexVector(std::vector<size_t> &out,
specid_t &offset) const;
void getIndicesFromSpectra(const std::vector<specid_t> &spectraList,
specnum_t &offset) const;
void getIndicesFromSpectra(const std::vector<specnum_t> &spectraList,
std::vector<size_t> &indexList) const;
size_t getIndexFromSpectrumNumber(const specid_t specNo) const;
size_t getIndexFromSpectrumNumber(const specnum_t specNo) const;
void getIndicesFromDetectorIDs(const std::vector<detid_t> &detIdList,
std::vector<size_t> &indexList) const;
void getSpectraFromDetectorIDs(const std::vector<detid_t> &detIdList,
std::vector<specid_t> &spectraList) const;
std::vector<specnum_t> &spectraList) const;
bool hasGroupedDetectors() const;
......
......@@ -61,7 +61,7 @@ public:
bool operator==(const Axis &) const override;
std::string label(const std::size_t &index) const override;
specid_t spectraNo(const std::size_t &index) const override;
specnum_t spectraNo(const std::size_t &index) const override;
// Get a map that contains the spectra index as the key and the index in the
// array as teh value
void getSpectraIndexMap(spec2index_map &) const;
......
......@@ -15,12 +15,12 @@ namespace Mantid {
#ifndef HAS_UNORDERED_MAP_H
/// Map with key = spectrum number, value = workspace index
typedef std::map<specid_t, size_t> spec2index_map;
typedef std::map<specnum_t, size_t> spec2index_map;
/// Map with key = detector ID, value = workspace index
typedef std::map<detid_t, size_t> detid2index_map;
#else
/// Map with key = spectrum number, value = workspace index
typedef std::tr1::unordered_map<specid_t, size_t> spec2index_map;
typedef std::tr1::unordered_map<specnum_t, size_t> spec2index_map;
/// Map with key = detector ID, value = workspace index
typedef std::tr1::unordered_map<detid_t, size_t> detid2index_map;
#endif
......
......@@ -50,34 +50,34 @@ class MatrixWorkspace;
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_API_DLL SpectrumDetectorMapping {
typedef std::unordered_map<specid_t, std::set<detid_t>> sdmap;
typedef std::unordered_map<specnum_t, std::set<detid_t>> sdmap;
public:
explicit SpectrumDetectorMapping(const MatrixWorkspace *const workspace,
bool useSpecNoIndex = true);
SpectrumDetectorMapping(
const std::vector<specid_t> &spectrumNumbers,
const std::vector<specnum_t> &spectrumNumbers,
const std::vector<detid_t> &detectorIDs,
const std::vector<detid_t> &ignoreDetIDs = std::vector<detid_t>());
SpectrumDetectorMapping(const specid_t *const spectrumNumbers,
SpectrumDetectorMapping(const specnum_t *const spectrumNumbers,
const detid_t *const detectorIDs,
size_t arrayLengths);
SpectrumDetectorMapping();
virtual ~SpectrumDetectorMapping();
std::set<specid_t> getSpectrumNumbers() const;
std::set<specnum_t> getSpectrumNumbers() const;
const std::set<detid_t> &
getDetectorIDsForSpectrumNo(const specid_t spectrumNo) const;
getDetectorIDsForSpectrumNo(const specnum_t spectrumNo) const;
const std::set<detid_t> &
getDetectorIDsForSpectrumIndex(const size_t index) const;
const sdmap &getMapping() const;
bool indexIsSpecNumber() const;
private:
void fillMapFromArray(const specid_t *const spectrumNumbers,
void fillMapFromArray(const specnum_t *const spectrumNumbers,
const detid_t *const detectorIDs,
const size_t arrayLengths);
void fillMapFromVector(const std::vector<specid_t> &spectrumNumbers,
void fillMapFromVector(const std::vector<specnum_t> &spectrumNumbers,
const std::vector<detid_t> &detectorIDs,
const std::vector<detid_t> &ignoreDetIDs);
......
......@@ -63,7 +63,7 @@ double Axis::getValue(const std::size_t &index,
* @return The spectrum number as an int
* @throw domain_error If this method is called on a numeric axis
*/
specid_t Axis::spectraNo(const std::size_t &index) const {
specnum_t Axis::spectraNo(const std::size_t &index) const {
UNUSED_ARG(index)
throw std::domain_error("Cannot call spectraNo() on a non-spectra axis.");
}
......
......@@ -13,7 +13,7 @@ ISpectrum::ISpectrum()
/** Constructor with spectrum number
* @param specNo :: spectrum # of the spectrum
*/
ISpectrum::ISpectrum(const specid_t specNo)
ISpectrum::ISpectrum(const specnum_t specNo)
: m_specNo(specNo), detectorIDs(), refX(), refDx(), m_hasDx(false) {}
//----------------------------------------------------------------------------------------------
......@@ -212,11 +212,11 @@ std::set<detid_t> &ISpectrum::getDetectorIDs() { return this->detectorIDs; }
// ---------------------------------------------------------
/// @return the spectrum number of this spectrum
specid_t ISpectrum::getSpectrumNo() const { return m_specNo; }
specnum_t ISpectrum::getSpectrumNo() const { return m_specNo; }
/** Sets the the spectrum number of this spectrum
* @param num :: the spectrum number of this spectrum */
void ISpectrum::setSpectrumNo(specid_t num) { m_specNo = num; }
void ISpectrum::setSpectrumNo(specnum_t num) { m_specNo = num; }
// ---------------------------------------------------------
/** Lock access to the data so that it does not get deleted while reading.
......
......@@ -224,7 +224,7 @@ void MatrixWorkspace::rebuildSpectraMapping(const bool includeMonitors) {
// The detector ID
const detid_t detId = *it;
// By default: Spectrum number = index + 1
const specid_t specNo = specid_t(index + 1);
const specnum_t specNo = specnum_t(index + 1);
if (index < this->getNumberHistograms()) {
ISpectrum *spec = getSpectrum(index);
......@@ -288,7 +288,7 @@ void MatrixWorkspace::rebuildNearestNeighbours() {
*be ignored. True to ignore detectors.
* @return map of DetectorID to distance for the nearest neighbours
*/
std::map<specid_t, V3D>
std::map<specnum_t, V3D>
MatrixWorkspace::getNeighbours(const Geometry::IDetector *comp,
const double radius,
const bool ignoreMaskedDetectors) const {
......@@ -296,7 +296,7 @@ MatrixWorkspace::getNeighbours(const Geometry::IDetector *comp,
buildNearestNeighbours(ignoreMaskedDetectors);
}
// Find the spectrum number
std::vector<specid_t> spectra;
std::vector<specnum_t> spectra;
this->getSpectraFromDetectorIDs(std::vector<detid_t>(1, comp->getID()),
spectra);
if (spectra.empty()) {
......@@ -305,7 +305,7 @@ MatrixWorkspace::getNeighbours(const Geometry::IDetector *comp,
"detector",
comp->getID());
}
std::map<specid_t, V3D> neighbours =
std::map<specnum_t, V3D> neighbours =
m_nearestNeighbours->neighboursInRadius(spectra[0], radius);
return neighbours;
}
......@@ -319,13 +319,13 @@ MatrixWorkspace::getNeighbours(const Geometry::IDetector *comp,
*be ignored. True to ignore detectors.
* @return map of DetectorID to distance for the nearest neighbours
*/
std::map<specid_t, V3D>
MatrixWorkspace::getNeighbours(specid_t spec, const double radius,
std::map<specnum_t, V3D>
MatrixWorkspace::getNeighbours(specnum_t spec, const double radius,
bool ignoreMaskedDetectors) const {
if (!m_nearestNeighbours) {
buildNearestNeighbours(ignoreMaskedDetectors);
}
std::map<specid_t, V3D> neighbours =
std::map<specnum_t, V3D> neighbours =
m_nearestNeighbours->neighboursInRadius(spec, radius);
return neighbours;
}
......@@ -339,8 +339,8 @@ MatrixWorkspace::getNeighbours(specid_t spec, const double radius,
*be ignored. True to ignore detectors.
* @return map of DetectorID to distance for the nearest neighbours
*/
std::map<specid_t, V3D>
MatrixWorkspace::getNeighboursExact(specid_t spec, const int nNeighbours,
std::map<specnum_t, V3D>
MatrixWorkspace::getNeighboursExact(specnum_t spec, const int nNeighbours,
bool ignoreMaskedDetectors) const {
if (!m_nearestNeighbours) {
SpectrumDetectorMapping spectraMap(this);
......@@ -348,7 +348,7 @@ MatrixWorkspace::getNeighboursExact(specid_t spec, const int nNeighbours,
nNeighbours, this->getInstrument(), spectraMap.getMapping(),
ignoreMaskedDetectors));
}
std::map<specid_t, V3D> neighbours = m_nearestNeighbours->neighbours(spec);
std::map<specnum_t, V3D> neighbours = m_nearestNeighbours->neighbours(spec);
return neighbours;
}
......@@ -383,7 +383,7 @@ spec2index_map MatrixWorkspace::getSpectrumToWorkspaceIndexMap() const {
*vector.
*/
void MatrixWorkspace::getSpectrumToWorkspaceIndexVector(
std::vector<size_t> &out, specid_t &offset) const {
std::vector<size_t> &out, specnum_t &offset) const {
SpectraAxis *ax = dynamic_cast<SpectraAxis *>(this->m_axes[1]);
if (!ax)
throw std::runtime_error("MatrixWorkspace::getSpectrumToWorkspaceIndexMap: "
......@@ -391,14 +391,14 @@ void MatrixWorkspace::getSpectrumToWorkspaceIndexVector(
"generate a map.");
// Find the min/max spectra IDs
specid_t min = std::numeric_limits<specid_t>::max(); // So that any number
specnum_t min = std::numeric_limits<specnum_t>::max(); // So that any number
// will be less than this
specid_t max = -std::numeric_limits<specid_t>::max(); // So that any number
specnum_t max = -std::numeric_limits<specnum_t>::max(); // So that any number
// will be greater than
// this
size_t length = ax->length();
for (size_t i = 0; i < length; i++) {
specid_t spec = ax->spectraNo(i);
specnum_t spec = ax->spectraNo(i);
if (spec < min)
min = spec;
if (spec > max)
......@@ -413,7 +413,7 @@ void MatrixWorkspace::getSpectrumToWorkspaceIndexVector(
// Make the vector
for (size_t i = 0; i < length; i++) {
specid_t spec = ax->spectraNo(i);
specnum_t spec = ax->spectraNo(i);
out[spec + offset] = i;
}
}
......@@ -545,7 +545,7 @@ void MatrixWorkspace::getDetectorIDToWorkspaceIndexVector(
*not a Workspace2D)
*/
void MatrixWorkspace::getIndicesFromSpectra(
const std::vector<specid_t> &spectraList,
const std::vector<specnum_t> &spectraList,
std::vector<size_t> &indexList) const {
// Clear the output index list
indexList.clear();
......@@ -571,7 +571,7 @@ void MatrixWorkspace::getIndicesFromSpectra(
* @throw runtime_error if not found.
*/
size_t
MatrixWorkspace::getIndexFromSpectrumNumber(const specid_t specNo) const {
MatrixWorkspace::getIndexFromSpectrumNumber(const specnum_t specNo) const {
for (size_t i = 0; i < this->getNumberHistograms(); ++i) {
if (this->getSpectrum(i)->getSpectrumNo() == specNo)
return i;
......@@ -624,14 +624,14 @@ void MatrixWorkspace::getIndicesFromDetectorIDs(
*/
void MatrixWorkspace::getSpectraFromDetectorIDs(
const std::vector<detid_t> &detIdList,
std::vector<specid_t> &spectraList) const {
std::vector<specnum_t> &spectraList) const {
spectraList.clear();
// Try every detector in the list
for (auto detId : detIdList) {
bool foundDet = false;
specid_t foundSpecNum = 0;
specnum_t foundSpecNum = 0;
// Go through every histogram
for (size_t i = 0; i < this->getNumberHistograms(); i++) {
......
......@@ -84,7 +84,7 @@ void SpectraAxis::setValue(const std::size_t &index, const double &value) {
/**
* Finds the index of the given value on the axis
* @param value A value on the axis. It is treated as a spectrum number and cast
* to specid_t on input
* to specnum_t on input
* @return The index closest to given value
* @throws std::out_of_range if the value is out of range of the axis
*/
......@@ -109,7 +109,7 @@ size_t SpectraAxis::indexOfValue(const double value) const {
* @return The spectrum number as an int
* @throw IndexError If the index requested is not in the range of this axis
*/
specid_t SpectraAxis::spectraNo(const std::size_t &index) const {
specnum_t SpectraAxis::spectraNo(const std::size_t &index) const {
if (index >= length()) {
throw Kernel::Exception::IndexError(index, length() - 1,
"SpectraAxis: Index out of range.");
......
......@@ -34,7 +34,7 @@ SpectrumDetectorMapping::SpectrumDetectorMapping(
* are not of equal length
*/
SpectrumDetectorMapping::SpectrumDetectorMapping(
const std::vector<specid_t> &spectrumNumbers,
const std::vector<specnum_t> &spectrumNumbers,
const std::vector<detid_t> &detectorIDs,
const std::vector<detid_t> &ignoreDetIDs)
: m_indexIsSpecNo(true) {
......@@ -51,7 +51,7 @@ SpectrumDetectorMapping::SpectrumDetectorMapping(
* @throws std::invalid_argument if a null array pointer is passed in
*/
SpectrumDetectorMapping::SpectrumDetectorMapping(
const specid_t *const spectrumNumbers, const detid_t *const detectorIDs,
const specnum_t *const spectrumNumbers, const detid_t *const detectorIDs,
size_t arrayLengths)
: m_indexIsSpecNo(true) {
if (spectrumNumbers == nullptr || detectorIDs == nullptr) {
......@@ -64,7 +64,7 @@ SpectrumDetectorMapping::SpectrumDetectorMapping(
/// Called by the c-array constructors to do the actual filling
void SpectrumDetectorMapping::fillMapFromArray(
const specid_t *const spectrumNumbers, const detid_t *const detectorIDs,
const specnum_t *const spectrumNumbers, const detid_t *const detectorIDs,
const size_t arrayLengths) {
for (size_t i = 0; i < arrayLengths; ++i) {
m_mapping[spectrumNumbers[i]].insert(detectorIDs[i]);
......@@ -73,7 +73,7 @@ void SpectrumDetectorMapping::fillMapFromArray(
/// Called by the vector constructors to do the actual filling
void SpectrumDetectorMapping::fillMapFromVector(
const std::vector<specid_t> &spectrumNumbers,
const std::vector<specnum_t> &spectrumNumbers,
const std::vector<detid_t> &detectorIDs,
const std::vector<detid_t> &ignoreDetIDs) {
std::set<detid_t> ignoreIDs(ignoreDetIDs.begin(), ignoreDetIDs.end());
......@@ -92,8 +92,8 @@ SpectrumDetectorMapping::SpectrumDetectorMapping()
SpectrumDetectorMapping::~SpectrumDetectorMapping() {}
/// @returns An ordered set of the unique spectrum numbers
std::set<specid_t> SpectrumDetectorMapping::getSpectrumNumbers() const {
std::set<specid_t> specs;
std::set<specnum_t> SpectrumDetectorMapping::getSpectrumNumbers() const {
std::set<specnum_t> specs;
auto itend = m_mapping.end();
for (auto it = m_mapping.begin(); it != itend; ++it) {
specs.insert(it->first);
......@@ -102,7 +102,7 @@ std::set<specid_t> SpectrumDetectorMapping::getSpectrumNumbers() const {
}
const std::set<detid_t> &SpectrumDetectorMapping::getDetectorIDsForSpectrumNo(
const specid_t spectrumNo) const {
const specnum_t spectrumNo) const {
if (!m_indexIsSpecNo)
throw std::runtime_error("Indicies are in spectrum index, not number.");
return m_mapping.at(spectrumNo);
......
......@@ -124,7 +124,7 @@ public:
const size_t nhist(10);
testWS.initialize(nhist, 1, 1);
for (size_t i = 0; i < testWS.getNumberHistograms(); i++) {
TS_ASSERT_EQUALS(testWS.getSpectrum(i)->getSpectrumNo(), specid_t(i + 1));
TS_ASSERT_EQUALS(testWS.getSpectrum(i)->getSpectrumNo(), specnum_t(i + 1));
TS_ASSERT(testWS.getSpectrum(i)->hasDetectorID(detid_t(i)));
}
}
......@@ -133,7 +133,7 @@ public:
WorkspaceTester testWS;
testWS.initialize(3, 1, 1);
specid_t specs[] = {1, 2, 2, 3};
specnum_t specs[] = {1, 2, 2, 3};
detid_t detids[] = {10, 99, 20, 30};
TS_ASSERT_THROWS_NOTHING(
testWS.updateSpectraUsing(SpectrumDetectorMapping(specs, detids, 4)));
......
......@@ -43,7 +43,7 @@ public:
}
void test_vector_constructor_unequal_lengths() {
TS_ASSERT_THROWS(SpectrumDetectorMapping(std::vector<specid_t>(2),
TS_ASSERT_THROWS(SpectrumDetectorMapping(std::vector<specnum_t>(2),
std::vector<detid_t>(1)),
std::invalid_argument);
}
......@@ -64,7 +64,7 @@ public:
void test_vector_constructor_uses_all_spectra_by_default() {
// Empty is fine for the input
std::vector<specid_t> specs;
std::vector<specnum_t> specs;
std::vector<detid_t> detids;
SpectrumDetectorMapping map(specs, detids);
TS_ASSERT(map.getMapping().empty());
......@@ -84,7 +84,7 @@ public:
void test_vector_constructor_ignores_detectors_in_ignore_list() {
const int ndets = 5;
std::vector<specid_t> specs(ndets, 0);
std::vector<specnum_t> specs(ndets, 0);
std::vector<detid_t> detids(ndets, 0);
for (int i = 0; i < ndets; ++i) {
specs[i] = i + 1;
......@@ -112,7 +112,7 @@ public:
}
void test_array_constructor_null_inputs() {
specid_t specs[2];
specnum_t specs[2];
detid_t detids[2];
TS_ASSERT_THROWS(SpectrumDetectorMapping(NULL, detids, 10),
std::invalid_argument);
......@@ -121,7 +121,7 @@ public:
}
void test_array_constructor() {
specid_t specs[] = {1, 2, 2, 3};
specnum_t specs[] = {1, 2, 2, 3};
detid_t detids[] = {10, 99, 20, 30};
SpectrumDetectorMapping map(specs, detids, 4);
......@@ -129,7 +129,7 @@ public:
}
void test_getSpectrumNumbers() {
specid_t specs[] = {5, 4, 4, 3};
specnum_t specs[] = {5, 4, 4, 3};
detid_t detids[] = {10, 99, 20, 30};
SpectrumDetectorMapping map(specs, detids, 4);
......
......@@ -71,7 +71,7 @@ private:
void processTableColumnNames();
void importPeaksFromTable(
std::map<specid_t, std::vector<std::pair<double, API::IFunction_sptr>>> &
std::map<specnum_t, std::vector<std::pair<double, API::IFunction_sptr>>> &
functionmap);
/// Import peak and background function parameters from vector
......@@ -80,7 +80,7 @@ private:
/// Generate peaks in output data workspaces
void generatePeaks(
const std::map<specid_t,
const std::map<specnum_t,
std::vector<std::pair<double, API::IFunction_sptr>>> &
functionmap,
API::MatrixWorkspace_sptr dataWS);
......@@ -117,11 +117,11 @@ private:
std::vector<double> m_vecBkgdParamValues;
/// Spectrum map from full spectra workspace to partial spectra workspace
std::map<specid_t, specid_t> m_SpectrumMap;
std::map<specnum_t, specnum_t> m_SpectrumMap;
/// Set of spectra (workspace indexes) in the original workspace that contain
/// peaks to generate
std::set<specid_t> m_spectraSet;
std::set<specnum_t> m_spectraSet;
/// Flag to use automatic background (???)
bool m_useAutoBkgd;
......
......@@ -83,12 +83,12 @@ private:
void init() override;
void exec() override;
void getGeometry(API::MatrixWorkspace_const_sptr WS, specid_t mon0Spec,
specid_t mon1Spec, double &monitor0Dist,
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,
specid_t specNum1,
specid_t specNum2) const;
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);
......
......@@ -120,7 +120,7 @@ private:
/// Sample position
Kernel::V3D samplePos;
/// The spectra numbers that were skipped
std::vector<specid_t> spectraSkipped;
std::vector<specnum_t> spectraSkipped;
/// Algorithm progress keeper
API::Progress *progress;
};
......
......@@ -12,7 +12,7 @@
namespace Mantid {
namespace Algorithms {
typedef std::map<specid_t, Mantid::Kernel::V3D> SpectraDistanceMap;
typedef std::map<specnum_t, Mantid::Kernel::V3D> SpectraDistanceMap;
/*
Filters spectra detector list by radius.
......@@ -41,7 +41,7 @@ public:
unfiltered.begin(), unfiltered.end(),
std::inserter(neighbSpectra, neighbSpectra.end()),
[cutoff](
const std::pair<specid_t, Mantid::Kernel::V3D> &spectraDistance) {
const std::pair<specnum_t, Mantid::Kernel::V3D> &spectraDistance) {
return spectraDistance.second.norm() <= cutoff;
});
return neighbSpectra;
......
......@@ -78,11 +78,11 @@ private:
void exec() override;
/// expand our search out to the next neighbours along
bool expandNet(std::map<specid_t, Mantid::Kernel::V3D> &nearest,
specid_t spec, const size_t &noNeighbours,
bool expandNet(std::map<specnum_t, Mantid::Kernel::V3D> &nearest,
specnum_t spec, const size_t &noNeighbours,
const Mantid::Geometry::BoundingBox &bbox);
/// sort by distance
void sortByDistance(std::map<specid_t, Mantid::Kernel::V3D> &nearest,
void sortByDistance(std::map<specnum_t, Mantid::Kernel::V3D> &nearest,
const size_t &noNeighbours);
/// create expanded bounding box for our purposes
void createBox(boost::shared_ptr<const Geometry::IDetector> det,
......@@ -91,9 +91,9 @@ private:
void growBox(double &min, double &max, const double &factor);
/// map of detectors in the instrument
std::map<specid_t, boost::shared_ptr<const Geometry::IDetector>> m_detectors;
std::map<specnum_t, boost::shared_ptr<const Geometry::IDetector>> m_detectors;
/// flag which detectors are included in a group already