Commit 40cbdb58 authored by Jose Borreguero's avatar Jose Borreguero
Browse files

Refs #30887 purge getDetectorID from affected algorithms and exports

parent 9789588a
......@@ -26,9 +26,9 @@ DECLARE_ALGORITHM(AddPeak)
using namespace Mantid::Kernel;
using namespace Mantid::API;
using Mantid::DataObjects::Peak_uptr;
using Mantid::DataObjects::PeaksWorkspace;
using Mantid::DataObjects::PeaksWorkspace_sptr;
using Mantid::DataObjects::Peak_uptr;
using Mantid::Geometry::IPeak_uptr;
/** Initialize the algorithm's properties.
......@@ -128,7 +128,7 @@ void AddPeak::exec() {
Qz *= knorm;
IPeak_uptr ipeak = peaksWS->createPeak(Mantid::Kernel::V3D(Qx, Qy, Qz), l2);
Peak_uptr peak(static_cast<DataObjects::Peak*>(ipeak.release()));
Peak_uptr peak(static_cast<DataObjects::Peak *>(ipeak.release()));
peak->setDetectorID(detID);
peak->setGoniometerMatrix(runWS->run().getGoniometer().getR());
peak->setBinCount(count);
......
......@@ -348,7 +348,7 @@ void FindSXPeaks::reducePeakList(const peakvector &pcv, Progress &progress) {
finalPeak.reduce();
try {
IPeak_uptr ipeak = m_peaks->createPeak(finalPeak.getQ());
Peak_uptr peak(static_cast<Peak*>(ipeak.release()));
Peak_uptr peak(static_cast<Peak *>(ipeak.release()));
if (peak) {
peak->setIntensity(finalPeak.getIntensity());
peak->setDetectorID(finalPeak.getDetectorId());
......
......@@ -28,14 +28,14 @@ using Mantid::API::Algorithm;
using Mantid::API::IPeaksWorkspace_sptr;
using Mantid::API::Progress;
using Mantid::DataObjects::Peak;
using Mantid::DataObjects::Peak_uptr;
using Mantid::DataObjects::PeaksWorkspace;
using Mantid::DataObjects::PeaksWorkspace_sptr;
using Mantid::DataObjects::Peak_uptr;
using Mantid::Geometry::IPeak_uptr;
using Mantid::Geometry::HKLFilter;
using Mantid::Geometry::HKLFilter_uptr;
using Mantid::Geometry::HKLGenerator;
using Mantid::Geometry::Instrument_const_sptr;
using Mantid::Geometry::IPeak_uptr;
using Mantid::Geometry::OrientedLattice;
using Mantid::Geometry::ReflectionCondition_sptr;
using Mantid::Kernel::DblMatrix;
......@@ -257,7 +257,7 @@ IPeaksWorkspace_sptr predictFractionalPeaks(
// it
continue;
}
Peak_uptr peak(static_cast<Peak*>(ipeak.release()));
Peak_uptr peak(static_cast<Peak *>(ipeak.release()));
peak->setGoniometerMatrix(gonioMatrix);
if (requirePeaksOnDetector && peak->getDetectorID() < 0)
continue;
......
......@@ -169,7 +169,8 @@ Peak::Peak(const Geometry::IPeak &ipeak)
m_finalEnergy(ipeak.getFinalEnergy()) {
const auto *peak = dynamic_cast<const Peak *>(&ipeak);
if (!peak)
throw std::invalid_argument("Cannot construct a Peak from this non-Peak object");
throw std::invalid_argument(
"Cannot construct a Peak from this non-Peak object");
setInstrument(peak->getInstrument());
detid_t id = peak->getDetectorID();
if (id >= 0)
......
......@@ -153,10 +153,9 @@ void PeakColumn<T>::print(size_t index, std::ostream &s) const {
s << peak.getRunNumber();
else if (m_name == "DetID") {
auto fullPeak = dynamic_cast<Peak *>(&peak);
if(fullPeak)
if (fullPeak)
s << fullPeak->getDetectorID();
}
else if (m_name == "BankName")
} else if (m_name == "BankName")
s << peak.getBankName();
else if (m_name == "QLab")
s << peak.getQLabFrame();
......@@ -317,7 +316,7 @@ template <class T> const void *PeakColumn<T>::void_pointer(size_t index) const {
value = peak.getPeakNumber();
return boost::get<int>(&value);
} else if (m_name == "DetID") {
auto fatPeak = dynamic_cast<const DataObjects::Peak&>(peak);
auto fatPeak = dynamic_cast<const DataObjects::Peak &>(peak);
value = fatPeak.getDetectorID();
return boost::get<int>(&value);
} else if (m_name == "BankName") {
......
......@@ -39,7 +39,7 @@ void addFakeEllipsoid(const V3D &peakHKL, const int &totalNPixels,
PeaksWorkspace_sptr &peaksWS) {
// Create the peak and add it to the peaks ws
IPeak_uptr ipeak = peaksWS->createPeakHKL(peakHKL);
Peak_uptr peak(dynamic_cast<Peak*>(ipeak.release()));
Peak_uptr peak(dynamic_cast<Peak *>(ipeak.release()));
peaksWS->addPeak(*peak);
const auto detectorId = peak->getDetectorID();
const auto tofExact = peak->getTOF();
......@@ -84,7 +84,7 @@ void addFakeEllipsoid(const V3D &peakHKL, const int &totalNPixels,
step_perp[ivect] += 0.02;
auto q = Q + eigvects[ivect] * step_perp[ivect];
IPeak_uptr ipk = peaksWS->createPeak(q);
Peak_uptr pk(dynamic_cast<Peak*>(ipk.release()));
Peak_uptr pk(dynamic_cast<Peak *>(ipk.release()));
detId = pk->getDetectorID();
} while (detId == detectorId);
}
......@@ -94,7 +94,7 @@ void addFakeEllipsoid(const V3D &peakHKL, const int &totalNPixels,
for (size_t ivect = 0; ivect < step_perp.size(); ivect++) {
auto q = Q + eigvects[ivect] * step_perp[ivect] * istep;
IPeak_uptr ipk = peaksWS->createPeak(q);
Peak_uptr pk(dynamic_cast<Peak*>(ipk.release()));
Peak_uptr pk(dynamic_cast<Peak *>(ipk.release()));
// add event
auto detId = pk->getDetectorID();
EventList &el = eventWS->getSpectrum(detId - totalNPixels);
......
......@@ -37,7 +37,7 @@ void addFakeEllipsoid(const V3D &peakHKL, const V3D &peakMNP,
PeaksWorkspace_sptr &peaksWS) {
// Create the peak and add it to the peaks ws
IPeak_uptr ipeak = peaksWS->createPeakHKL(peakHKL);
Peak_uptr peak(dynamic_cast<Peak*>(ipeak.release()));
Peak_uptr peak(dynamic_cast<Peak *>(ipeak.release()));
peak->setIntMNP(peakMNP);
peaksWS->addPeak(*peak);
const auto detectorId = peak->getDetectorID();
......@@ -83,7 +83,7 @@ void addFakeEllipsoid(const V3D &peakHKL, const V3D &peakMNP,
step_perp[ivect] += 0.02;
auto q = Q + eigvects[ivect] * step_perp[ivect];
IPeak_uptr ipk = peaksWS->createPeak(q);
Peak_uptr pk(dynamic_cast<Peak*>(ipk.release()));
Peak_uptr pk(dynamic_cast<Peak *>(ipk.release()));
detId = pk->getDetectorID();
} while (detId == detectorId);
}
......@@ -93,7 +93,7 @@ void addFakeEllipsoid(const V3D &peakHKL, const V3D &peakMNP,
for (size_t ivect = 0; ivect < step_perp.size(); ivect++) {
auto q = Q + eigvects[ivect] * step_perp[ivect] * istep;
IPeak_uptr ipk = peaksWS->createPeak(q);
Peak_uptr pk(dynamic_cast<Peak*>(ipk.release()));
Peak_uptr pk(dynamic_cast<Peak *>(ipk.release()));
// add event
auto detId = pk->getDetectorID();
EventList &el = eventWS->getSpectrum(detId - totalNPixels);
......
......@@ -165,7 +165,7 @@ void WorkspaceBuilder::createPeak(const HKLPeakDescriptor &descriptor) {
// Create the peak and add it to the peaks ws
auto ipeak = m_peaksWorkspace->createPeakHKL(hkl);
Peak_uptr peak(dynamic_cast<Peak*>(ipeak.release()));
Peak_uptr peak(dynamic_cast<Peak *>(ipeak.release()));
m_peaksWorkspace->addPeak(*peak);
// Get detector ID and TOF position of peak
......
......@@ -20,8 +20,8 @@
namespace MantidQt {
namespace MantidWidgets {
using Mantid::Geometry::IPeak;
using Mantid::DataObjects::Peak;
using Mantid::Geometry::IPeak;
/// Default size in screen pixels of the marker's symbol
const int PeakMarker2D::g_defaultMarkerSize = 5;
......@@ -131,8 +131,8 @@ void PeakMarker2D::setPeak(const IPeak &ipeak, int row) {
m_label = QString("%1 %2 %3")
.arg(QString::number(m_h, 'g', 2), QString::number(m_k, 'g', 2),
QString::number(m_l, 'g', 2));
auto peak = dynamic_cast<const Peak*>(&ipeak);
if(peak)
auto peak = dynamic_cast<const Peak *>(&ipeak);
if (peak)
m_detID = peak->getDetectorID();
m_row = row;
}
......
Supports Markdown
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