Skip to content

Commit

Permalink
Iterate peaks through lebailfunction. Refs #7847.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Sep 10, 2013
1 parent 24ff832 commit 4bc6fec
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions Code/Mantid/Framework/CurveFitting/src/LeBailFit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1239,22 +1239,38 @@ namespace CurveFitting
peakWS->addColumn("str", "FitStatus");

// Add each peak in LeBailFunction to peak/table workspace
for (size_t ipk = 0; ipk < m_inputPeakInfoVec.size(); ++ipk)
for (size_t ipk = 0; ipk < m_lebailFunction->getNumberOfPeaks(); ++ipk)
{
// Miller index

// Miller index and peak parameters
IPowderDiffPeakFunction_sptr peak = m_lebailFunction->getPeak(ipk);

int h, k, l;
peak->getMillerIndex(h, k, l);
double tof_h = peak->centre();
double height = peak->height();
double alpha = peak->getPeakParameter("Alpha");
double beta = peak->getPeakParameter("Beta");
double sigma2 = peak->getPeakParameter("Sigma2");
double gamma = peak->getPeakParameter("Gamma");
double fwhm = peak->fwhm();

#if 0
m_lebailFunction->getPeak(i)

vector<int>& hkl = m_inputPeakInfoVec[ipk].first;
int h = hkl[0];
int k = hkl[1];
int l = hkl[2];


double tof_h = m_lebailFunction->getPeakParameter(hkl, "TOF_h");
double height = m_lebailFunction->getPeakParameter(hkl, "Height");
double alpha = m_lebailFunction->getPeakParameter(hkl, "Alpha");
double beta = m_lebailFunction->getPeakParameter(hkl, "Beta");
double sigma2 = m_lebailFunction->getPeakParameter(hkl, "Sigma2");
double gamma = m_lebailFunction->getPeakParameter(hkl, "Gamma");
double fwhm = m_lebailFunction->getPeakParameter(hkl, "FWHM");
#endif

// New row
API::TableRow newrow = peakWS->appendRow();
Expand Down

0 comments on commit 4bc6fec

Please sign in to comment.