/** Creates PoldiPeak-objects from peak position iterators * * In this method, PoldiPeak objects are created from the raw peak position *data and the original x-data. Estimates for peak height and FWHM * provided along with the position. * * @param baseListStart :: Starting iterator of the vector which the peak *positions refer to. * @param peakPositions :: List with peakPositions. * @param xData :: Vector with x-values of the correlation spectrum. * @return Vector with PoldiPeak objects constructed from the raw peak position *data. */ std::vector<PoldiPeak_sptr> PoldiPeakSearch::getPeaks(const MantidVec::const_iterator &baseListStart, const MantidVec::const_iterator &baseListEnd, std::list<MantidVec::const_iterator> peakPositions, const MantidVec &xData, const Unit_sptr &unit) const { std::vector<PoldiPeak_sptr> peakData; peakData.reserve(peakPositions.size()); for (std::list<MantidVec::const_iterator>::const_iterator peak = peakPositions.begin(); peak != peakPositions.end(); ++peak) { size_t index = std::distance(baseListStart, *peak); double xDataD = getTransformedCenter(xData[index], unit); double fwhmEstimate = getFWHMEstimate(baseListStart, baseListEnd, *peak, xData); UncertainValue fwhm(fwhmEstimate / xData[index]); PoldiPeak_sptr newPeak = PoldiPeak::create( MillerIndices(), UncertainValue(xDataD), UncertainValue(**peak), fwhm); peakData.push_back(newPeak); } return peakData; }
/** Creates PoldiPeak-objects from peak position iterators * * In this method, PoldiPeak objects are created from the raw peak position data and the original x-data. Estimates for peak height and FWHM * provided along with the position. * * @param baseListStart :: Starting iterator of the vector which the peak positions refer to. * @param peakPositions :: List with peakPositions. * @param xData :: Vector with x-values of the correlation spectrum. * @return Vector with PoldiPeak objects constructed from the raw peak position data. */ std::vector<PoldiPeak_sptr> PoldiPeakSearch::getPeaks(MantidVec::const_iterator baseListStart, std::list<MantidVec::const_iterator> peakPositions, const MantidVec &xData) const { std::vector<PoldiPeak_sptr> peakData; peakData.reserve(peakPositions.size()); for(std::list<MantidVec::const_iterator>::const_iterator peak = peakPositions.begin(); peak != peakPositions.end(); ++peak) { size_t index = std::distance(baseListStart, *peak); PoldiPeak_sptr newPeak = PoldiPeak::create(UncertainValue(xData[index]), UncertainValue(**peak)); double fwhmEstimate = getFWHMEstimate(baseListStart, *peak, xData); newPeak->setFwhm(UncertainValue(fwhmEstimate)); peakData.push_back(newPeak); } return peakData; }