Commit eef901d3 authored by Lynch, Vickie's avatar Lynch, Vickie
Browse files

Refs #21752 size_t for peak number

parent 84f8ffa8
......@@ -473,6 +473,7 @@ void PredictPeaks::setStructureFactorCalculatorFromSample(
* @param hkl
* @param orientedUB
* @param goniometerMatrix
* @param seqNum
*/
void PredictPeaks::calculateQAndAddToOutput(const V3D &hkl,
const DblMatrix &orientedUB,
......
......@@ -345,7 +345,7 @@ void SaveHKL::exec() {
continue;
}
int run = p.getRunNumber();
int seqNum = p.getPeakNumber();
size_t seqNum = p.getPeakNumber();
int bank = 0;
std::string bankName = p.getBankName();
int nCols, nRows;
......
......@@ -261,7 +261,7 @@ void SaveIsawPeaks::exec() {
// =========================================
// Go in order of run numbers
int maxPeakNumb = 0;
size_t maxPeakNumb = 0;
size_t appendPeakNumb = 0;
runMap_t::iterator runMap_it;
for (runMap_it = runMap.begin(); runMap_it != runMap.end(); ++runMap_it) {
......
......@@ -151,7 +151,7 @@ public:
void setRow(int m_row);
void setCol(int m_col);
void setPeakNumber(size_t m_peakNumber) override;
int getPeakNumber() const override;
size_t getPeakNumber() const override;
virtual Mantid::Kernel::V3D getDetPos() const override;
double getL1() const override;
......@@ -246,7 +246,7 @@ private:
double m_orig_L;
// keep peak number
int m_peakNumber;
size_t m_peakNumber;
/// List of contributing detectors IDs
std::set<int> m_detIDs;
......
......@@ -219,7 +219,7 @@ Peak::Peak(const Geometry::IPeak &ipeak)
m_runNumber(ipeak.getRunNumber()),
m_monitorCount(ipeak.getMonitorCount()), m_row(ipeak.getRow()),
m_col(ipeak.getCol()), m_orig_H(0.), m_orig_K(0.), m_orig_L(0.),
m_peakNumber(0), m_peakShape(boost::make_shared<NoShape>()) {
m_peakNumber(ipeak.getPeakNumber()), m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
if (fabs(m_InverseGoniometerMatrix.Invert()) < 1e-8)
throw std::invalid_argument(
......@@ -883,7 +883,7 @@ int Peak::getCol() const { return m_col; }
// -------------------------------------------------------------------------------------
/**Returns the unique peak number
* Returns -1 if it could not find it. */
int Peak::getPeakNumber() const { return m_peakNumber; }
size_t Peak::getPeakNumber() const { return m_peakNumber; }
// -------------------------------------------------------------------------------------
/** For RectangularDetectors only, sets the row (y) of the pixel of the
......@@ -956,7 +956,7 @@ double Peak::getValueByColName(const std::string &name_in) const {
else if (name == "col")
return this->getCol();
else if (name == "peaknumber")
return this->getPeakNumber();
return double(this->getPeakNumber());
else
throw std::runtime_error(
"Peak::getValueByColName() unknown column or column is not a number: " +
......
......@@ -294,9 +294,6 @@ const void *PeakColumn::void_pointer(size_t index) const {
} else if (m_name == "RunNumber") {
value = peak.getRunNumber();
return boost::get<int>(&value);
} else if (m_name == "PeakNumber") {
value = peak.getPeakNumber();
return boost::get<int>(&value);
} else if (m_name == "DetID") {
value = peak.getDetectorID();
return boost::get<int>(&value);
......
......@@ -695,7 +695,7 @@ void PeaksWorkspace::saveNexus(::NeXus::File *file) const {
std::vector<double> dSpacing(np);
std::vector<double> TOF(np);
std::vector<int> runNumber(np);
std::vector<int> peakNumber(np);
std::vector<size_t> peakNumber(np);
std::vector<double> goniometerMatrix(9 * np);
std::vector<std::string> shapes(np);
......
......@@ -77,7 +77,7 @@ public:
virtual double getBinCount() const = 0;
virtual void setBinCount(double m_BinCount) = 0;
virtual int getPeakNumber() const = 0;
virtual size_t getPeakNumber() const = 0;
virtual void setPeakNumber(size_t m_PeakNumber) = 0;
virtual Mantid::Kernel::Matrix<double> getGoniometerMatrix() const = 0;
......
......@@ -65,7 +65,7 @@ public:
MOCK_CONST_METHOD0(getDetector, Geometry::IDetector_const_sptr());
MOCK_CONST_METHOD0(getInstrument, Geometry::Instrument_const_sptr());
MOCK_CONST_METHOD0(getRunNumber, int());
MOCK_CONST_METHOD0(getPeakNumber, int());
MOCK_CONST_METHOD0(getPeakNumber, size_t());
MOCK_METHOD1(setRunNumber, void(int m_RunNumber));
MOCK_METHOD1(setPeakNumber, void(size_t m_PeakNumber));
MOCK_CONST_METHOD0(getMonitorCount, double());
......
......@@ -198,7 +198,7 @@ QPeaksTableModel::QPeaksTableModel(
[](const IPeak &peak) { return QVariant(peak.getCol()); },
[](const IPeak &peak) { return QVariant(peak.getQLabFrame().norm()); },
[](const IPeak &peak) { return QVariant(peak.getQSampleFrame().norm()); },
[](const IPeak &peak) { return QVariant(peak.getPeakNumber()); },
[](const IPeak &peak) { return QVariant(int(peak.getPeakNumber())); },
};
// Mapping member functions of the Peak object to a column index with
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment