/** 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; }
void PawleyFunction::setPeakPositions(std::string centreName, double zeroShift, const UnitCell &cell) const { for (size_t i = 0; i < m_hkls.size(); ++i) { double centre = getTransformedCenter(cell.d(m_hkls[i])); m_peakProfileComposite->getFunction(i) ->setParameter(centreName, centre + zeroShift); } }