diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h b/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h index 61ea53ed5afc..89bfdf0571b3 100644 --- a/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h +++ b/Framework/SINQ/inc/MantidSINQ/PoldiPeakSearch.h @@ -55,7 +55,7 @@ class MANTID_SINQ_DLL PoldiPeakSearch : public API::Algorithm { MantidVec::const_iterator end) const; std::list - mapPeakPositionsToCorrelationData(std::list &peakPositions, + mapPeakPositionsToCorrelationData(const std::list &peakPositions, MantidVec::const_iterator baseDataStart, MantidVec::const_iterator originalDataStart) const; diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/MillerIndices.h b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/MillerIndices.h index 0a38fdf9f4ae..27efb12c5ff0 100644 --- a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/MillerIndices.h +++ b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/MillerIndices.h @@ -25,7 +25,7 @@ namespace Poldi { class MANTID_SINQ_DLL MillerIndices { public: MillerIndices(int h = 0, int k = 0, int l = 0); - MillerIndices(std::vector &hkl); + MillerIndices(const std::vector &hkl); MillerIndices(const Kernel::V3D &hkl); int h() const; diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiPeak.h b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiPeak.h index 6eab51105cfc..ccdc9b0b8d1d 100644 --- a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiPeak.h +++ b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiPeak.h @@ -30,7 +30,7 @@ class MANTID_SINQ_DLL PoldiPeak { public: enum FwhmRelation { AbsoluteQ, AbsoluteD, Relative }; - PoldiPeak_sptr clone() const; + PoldiPeak_sptr clonePeak() const; const MillerIndices &hkl() const; void setHKL(MillerIndices hkl); diff --git a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiPeakCollection.h b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiPeakCollection.h index 56c647504eda..e45bb127fc8b 100644 --- a/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiPeakCollection.h +++ b/Framework/SINQ/inc/MantidSINQ/PoldiUtilities/PoldiPeakCollection.h @@ -39,7 +39,7 @@ class MANTID_SINQ_DLL PoldiPeakCollection { virtual ~PoldiPeakCollection() = default; - PoldiPeakCollection_sptr clone(); + PoldiPeakCollection_sptr clonePeakCollection(); size_t peakCount() const; diff --git a/Framework/SINQ/src/PoldiFitPeaks2D.cpp b/Framework/SINQ/src/PoldiFitPeaks2D.cpp index ca5d6affb5d6..3315d0e6242a 100644 --- a/Framework/SINQ/src/PoldiFitPeaks2D.cpp +++ b/Framework/SINQ/src/PoldiFitPeaks2D.cpp @@ -194,7 +194,7 @@ PoldiFitPeaks2D::getIntegratedPeakCollection(const PoldiPeakCollection_sptr &raw * except cloning the collection, to make behavior consistent, since * integrating also results in a new peak collection. */ - return rawPeakCollection->clone(); + return rawPeakCollection->clonePeakCollection(); } /* If no profile function is specified, it's not possible to get integrated @@ -229,7 +229,7 @@ PoldiFitPeaks2D::getIntegratedPeakCollection(const PoldiPeakCollection_sptr &raw profileFunction->setHeight(peak->intensity()); profileFunction->setFwhm(peak->fwhm(PoldiPeak::AbsoluteD)); - PoldiPeak_sptr integratedPeak = peak->clone(); + PoldiPeak_sptr integratedPeak = peak->clonePeak(); integratedPeak->setIntensity(UncertainValue(profileFunction->intensity())); integratedPeakCollection->addPeak(integratedPeak); } @@ -267,7 +267,7 @@ PoldiFitPeaks2D::getNormalizedPeakCollection(const PoldiPeakCollection_sptr &pea PoldiPeak_sptr peak = peakCollection->peak(i); double calculatedIntensity = m_timeTransformer->calculatedTotalIntensity(peak->d()); - PoldiPeak_sptr normalizedPeak = peak->clone(); + PoldiPeak_sptr normalizedPeak = peak->clonePeak(); normalizedPeak->setIntensity(peak->intensity() / calculatedIntensity); normalizedPeakCollection->addPeak(normalizedPeak); } @@ -340,7 +340,7 @@ PoldiPeakCollection_sptr PoldiFitPeaks2D::getCountPeakCollection(const PoldiPeak PoldiPeak_sptr peak = peakCollection->peak(i); double calculatedIntensity = m_timeTransformer->calculatedTotalIntensity(peak->d()); - PoldiPeak_sptr countPeak = peak->clone(); + PoldiPeak_sptr countPeak = peak->clonePeak(); countPeak->setIntensity(peak->intensity() * calculatedIntensity); countPeakCollection->addPeak(countPeak); @@ -574,7 +574,7 @@ std::string PoldiFitPeaks2D::getRefinedStartingCell(const std::string &initialCe latticeFunction->setUnitCell(cell); // Remove errors from d-values - PoldiPeakCollection_sptr clone = peakCollection->clone(); + PoldiPeakCollection_sptr clone = peakCollection->clonePeakCollection(); for (size_t i = 0; i < clone->peakCount(); ++i) { PoldiPeak_sptr peak = clone->peak(i); diff --git a/Framework/SINQ/src/PoldiIndexKnownCompounds.cpp b/Framework/SINQ/src/PoldiIndexKnownCompounds.cpp index 70226868391d..2e56f5b2d6b2 100644 --- a/Framework/SINQ/src/PoldiIndexKnownCompounds.cpp +++ b/Framework/SINQ/src/PoldiIndexKnownCompounds.cpp @@ -657,7 +657,7 @@ PoldiIndexKnownCompounds::getIntensitySortedPeakCollection(const PoldiPeakCollec PoldiPeakCollection_sptr sortedPeaks = std::make_shared(peaks->intensityType()); for (const auto &peak : peakVector) { - sortedPeaks->addPeak(peak->clone()); + sortedPeaks->addPeak(peak->clonePeak()); } return sortedPeaks; diff --git a/Framework/SINQ/src/PoldiPeakSearch.cpp b/Framework/SINQ/src/PoldiPeakSearch.cpp index 541956b2bc8e..10dd23baa97f 100644 --- a/Framework/SINQ/src/PoldiPeakSearch.cpp +++ b/Framework/SINQ/src/PoldiPeakSearch.cpp @@ -122,7 +122,7 @@ std::list PoldiPeakSearch::findPeaks(MantidVec::const ++iter; } - return std::move(truncatedPeaks); + return truncatedPeaks; } /** Actual recursive peak search method @@ -180,7 +180,7 @@ std::list PoldiPeakSearch::findPeaksRecursive(MantidV *data. */ std::list -PoldiPeakSearch::mapPeakPositionsToCorrelationData(std::list &peakPositions, +PoldiPeakSearch::mapPeakPositionsToCorrelationData(const std::list &peakPositions, MantidVec::const_iterator baseDataStart, MantidVec::const_iterator originalDataStart) const { std::list transformedIndices; diff --git a/Framework/SINQ/src/PoldiUtilities/MillerIndices.cpp b/Framework/SINQ/src/PoldiUtilities/MillerIndices.cpp index 729aa182ba7e..6ee09d329af6 100644 --- a/Framework/SINQ/src/PoldiUtilities/MillerIndices.cpp +++ b/Framework/SINQ/src/PoldiUtilities/MillerIndices.cpp @@ -17,7 +17,7 @@ MillerIndices::MillerIndices(int h, int k, int l) populateVector(); } -MillerIndices::MillerIndices(std::vector &hkl) { +MillerIndices::MillerIndices(const std::vector &hkl) { if (hkl.size() != 3) { throw std::runtime_error("MillerIndices object can only be created with 3 indices"); } diff --git a/Framework/SINQ/src/PoldiUtilities/PoldiInstrumentAdapter.cpp b/Framework/SINQ/src/PoldiUtilities/PoldiInstrumentAdapter.cpp index ffad7a3a5359..787e2803cce9 100644 --- a/Framework/SINQ/src/PoldiUtilities/PoldiInstrumentAdapter.cpp +++ b/Framework/SINQ/src/PoldiUtilities/PoldiInstrumentAdapter.cpp @@ -232,7 +232,7 @@ double PoldiInstrumentAdapter::extractPropertyFromRun(const Run &runInformation, throw std::runtime_error("Cannot construct instrument without " + propertyName + "-property in log. Aborting."); } - Kernel::Property *property = runInformation.getProperty(propertyName); + const Kernel::Property *property = runInformation.getProperty(propertyName); AbstractDoubleValueExtractor_sptr extractor = getExtractorForProperty(property); diff --git a/Framework/SINQ/src/PoldiUtilities/PoldiPeak.cpp b/Framework/SINQ/src/PoldiUtilities/PoldiPeak.cpp index 7f59210e50ca..b00d57cdf7fa 100644 --- a/Framework/SINQ/src/PoldiUtilities/PoldiPeak.cpp +++ b/Framework/SINQ/src/PoldiUtilities/PoldiPeak.cpp @@ -12,7 +12,7 @@ namespace Mantid::Poldi { -PoldiPeak_sptr PoldiPeak::clone() const { return PoldiPeak_sptr(new PoldiPeak(*this)); } +PoldiPeak_sptr PoldiPeak::clonePeak() const { return PoldiPeak_sptr(new PoldiPeak(*this)); } const MillerIndices &PoldiPeak::hkl() const { return m_hkl; } diff --git a/Framework/SINQ/src/PoldiUtilities/PoldiPeakCollection.cpp b/Framework/SINQ/src/PoldiUtilities/PoldiPeakCollection.cpp index 116822f37fa9..191a3633d816 100644 --- a/Framework/SINQ/src/PoldiUtilities/PoldiPeakCollection.cpp +++ b/Framework/SINQ/src/PoldiUtilities/PoldiPeakCollection.cpp @@ -53,14 +53,14 @@ PoldiPeakCollection::PoldiPeakCollection(const CrystalStructure &crystalStructur setPeaks(hkls, dValues, structureFactors); } -PoldiPeakCollection_sptr PoldiPeakCollection::clone() { +PoldiPeakCollection_sptr PoldiPeakCollection::clonePeakCollection() { PoldiPeakCollection_sptr clone = std::make_shared(m_intensityType); clone->setProfileFunctionName(m_profileFunctionName); clone->setPointGroup(m_pointGroup); clone->setUnitCell(m_unitCell); for (const auto &peak : m_peaks) { - clone->addPeak(peak->clone()); + clone->addPeak(peak->clonePeak()); } return clone; diff --git a/Framework/SINQ/test/PoldiFitPeaks1D2Test.h b/Framework/SINQ/test/PoldiFitPeaks1D2Test.h index 335ec64cf277..9dfb74a25cf6 100644 --- a/Framework/SINQ/test/PoldiFitPeaks1D2Test.h +++ b/Framework/SINQ/test/PoldiFitPeaks1D2Test.h @@ -240,12 +240,12 @@ class PoldiFitPeaks1D2Test : public CxxTest::TestSuite { // Peaks with certain properties are rejected // 1. negative intensity - PoldiPeak_sptr negativeIntensity = m_testPeak->clone(); + PoldiPeak_sptr negativeIntensity = m_testPeak->clonePeak(); negativeIntensity->setIntensity(UncertainValue(-190.0)); TS_ASSERT(!poldiPeakFit.peakIsAcceptable(negativeIntensity)); // 2a. FWHM too large (rel. > 0.02) - PoldiPeak_sptr tooBroad = m_testPeak->clone(); + PoldiPeak_sptr tooBroad = m_testPeak->clonePeak(); tooBroad->setFwhm(UncertainValue(0.021), PoldiPeak::Relative); TS_ASSERT(!poldiPeakFit.peakIsAcceptable(tooBroad)); @@ -254,7 +254,7 @@ class PoldiFitPeaks1D2Test : public CxxTest::TestSuite { TS_ASSERT(poldiPeakFit.peakIsAcceptable(tooBroad)); // 3. FWHM too small (rel. < 0.001) - PoldiPeak_sptr tooNarrow = m_testPeak->clone(); + PoldiPeak_sptr tooNarrow = m_testPeak->clonePeak(); tooNarrow->setFwhm(UncertainValue(0.0009), PoldiPeak::Relative); TS_ASSERT(!poldiPeakFit.peakIsAcceptable(tooNarrow)); } diff --git a/Framework/SINQ/test/PoldiFitPeaks2DTest.h b/Framework/SINQ/test/PoldiFitPeaks2DTest.h index f0db7472f671..a8fcfff6a474 100644 --- a/Framework/SINQ/test/PoldiFitPeaks2DTest.h +++ b/Framework/SINQ/test/PoldiFitPeaks2DTest.h @@ -116,7 +116,7 @@ class PoldiFitPeaks2DTest : public CxxTest::TestSuite { // checking the actual integration result agains reference. PoldiPeakCollection_sptr integratedReference(new PoldiPeakCollection(PoldiPeakCollection::Integral)); for (size_t i = 0; i < testPeaks->peakCount(); ++i) { - PoldiPeak_sptr peak = testPeaks->peak(i)->clone(); + PoldiPeak_sptr peak = testPeaks->peak(i)->clonePeak(); double oldIntensity = peak->intensity(); double fwhm = peak->fwhm(PoldiPeak::AbsoluteD); diff --git a/Framework/SINQ/test/PoldiPeakCollectionTest.h b/Framework/SINQ/test/PoldiPeakCollectionTest.h index 9e8a50ea9485..113efe7cf8ca 100644 --- a/Framework/SINQ/test/PoldiPeakCollectionTest.h +++ b/Framework/SINQ/test/PoldiPeakCollectionTest.h @@ -274,7 +274,7 @@ class PoldiPeakCollectionTest : public CxxTest::TestSuite { peaks->addPeak(PoldiPeak::create(2.0)); peaks->addPeak(PoldiPeak::create(3.0)); - PoldiPeakCollection_sptr clone = peaks->clone(); + PoldiPeakCollection_sptr clone = peaks->clonePeakCollection(); // make sure those are different instances TS_ASSERT(clone != peaks); diff --git a/Framework/SINQ/test/PoldiPeakTest.h b/Framework/SINQ/test/PoldiPeakTest.h index bd06aac51c38..f5b6597acbdc 100644 --- a/Framework/SINQ/test/PoldiPeakTest.h +++ b/Framework/SINQ/test/PoldiPeakTest.h @@ -172,7 +172,7 @@ class PoldiPeakTest : public CxxTest::TestSuite { void testClone() { PoldiPeak_sptr peak = PoldiPeak::create(1.0, 200.00); - PoldiPeak_sptr clone = peak->clone(); + PoldiPeak_sptr clone = peak->clonePeak(); TS_ASSERT_EQUALS(peak->d(), clone->d()); TS_ASSERT_EQUALS(peak->fwhm(), clone->fwhm());