diff --git a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD2.h b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD2.h index b8c77ee874e9..ff8e3d0fd815 100644 --- a/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD2.h +++ b/Code/Mantid/Framework/MDAlgorithms/inc/MantidMDAlgorithms/IntegratePeaksMD2.h @@ -4,9 +4,7 @@ #include "MantidAPI/Algorithm.h" #include "MantidAPI/IMDEventWorkspace.h" #include "MantidDataObjects/PeaksWorkspace.h" -#include "MantidKernel/System.h" #include "MantidMDEvents/MDEventWorkspace.h" -#include "MantidAPI/CompositeFunction.h" namespace Mantid { @@ -25,12 +23,12 @@ namespace MDAlgorithms ~IntegratePeaksMD2(); /// Algorithm's name for identification - virtual const std::string name() const { return "IntegratePeaksMD";}; + virtual const std::string name() const { return "IntegratePeaksMD";} ///Summary of algorithms purpose virtual const std::string summary() const {return "Integrate single-crystal peaks in reciprocal space, for MDEventWorkspaces.";} /// Algorithm's version for identification - virtual int version() const { return 2;}; + virtual int version() const { return 2;} /// Algorithm's category for identification virtual const std::string category() const { return "MDAlgorithms";} @@ -47,15 +45,14 @@ namespace MDAlgorithms Mantid::API::IMDEventWorkspace_sptr inWS; /// Calculate if this Q is on a detector - bool detectorQ(Mantid::Kernel::V3D QLabFrame, double PeakRadius); + bool detectorQ(const Kernel::V3D & QLabFrame, double PeakRadius); /// Instrument reference Geometry::Instrument_const_sptr inst; /// Check if peaks overlap - void checkOverlap(int i, - Mantid::DataObjects::PeaksWorkspace_sptr peakWS, int CoordinatesToUse, double radius); - + void checkOverlap(int i, DataObjects::PeaksWorkspace & peakWS, + int CoordinatesToUse, double radius); }; diff --git a/Code/Mantid/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp b/Code/Mantid/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp index f40cc783d206..98eafcadcd9b 100644 --- a/Code/Mantid/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp +++ b/Code/Mantid/Framework/MDAlgorithms/src/IntegratePeaksMD2.cpp @@ -533,8 +533,8 @@ namespace MDAlgorithms } } } - checkOverlap (i, peakWS, CoordinatesToUse, - 2.0 * std::max(PeakRadiusVector[i],BackgroundOuterRadiusVector[i])); + checkOverlap (i, *peakWS, CoordinatesToUse, + 2.0 * std::max(PeakRadiusVector[i],BackgroundOuterRadiusVector[i])); // Save it back in the peak object. if (signal != 0. || replaceIntensity) { @@ -583,7 +583,7 @@ namespace MDAlgorithms * @param QLabFrame: The Peak center. * @param r: Peak radius. */ - bool IntegratePeaksMD2::detectorQ(Mantid::Kernel::V3D QLabFrame, double r) + bool IntegratePeaksMD2::detectorQ(const V3D &QLabFrame, double r) { // Define a "hit" if > 75% of attempts make it to a detector const int nAngles(8); @@ -614,11 +614,11 @@ namespace MDAlgorithms } return static_cast(nhits)/(dAngles*dAngles) > 0.75; } - void IntegratePeaksMD2::checkOverlap(int i, - Mantid::DataObjects::PeaksWorkspace_sptr peakWS, int CoordinatesToUse, double radius) + void IntegratePeaksMD2::checkOverlap(int i, DataObjects::PeaksWorkspace &peakWS, + int CoordinatesToUse, double radius) { // Get a direct ref to that peak. - IPeak & p1 = peakWS->getPeak(i); + IPeak & p1 = peakWS.getPeak(i); V3D pos1; if (CoordinatesToUse == 1) //"Q (lab frame)" pos1 = p1.getQLabFrame(); @@ -626,10 +626,10 @@ namespace MDAlgorithms pos1 = p1.getQSampleFrame(); else if (CoordinatesToUse == 3) //"HKL" pos1 = p1.getHKL(); - for (int j=i+1; j < peakWS->getNumberPeaks(); ++j) + for (int j=i+1; j < peakWS.getNumberPeaks(); ++j) { // Get a direct ref to rest of peaks peak. - IPeak & p2 = peakWS->getPeak(j); + IPeak & p2 = peakWS.getPeak(j); V3D pos2; if (CoordinatesToUse == 1) //"Q (lab frame)" pos2 = p2.getQLabFrame();