Skip to content

Commit

Permalink
Use UnitCell. Refs #6020.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Dec 28, 2012
1 parent 678aa5a commit 3449ba7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ namespace CurveFitting
const MantidVec &rawY, const MantidVec& rawE);

/// Calculate d-space value from peak's miller index for thermal neutron
double calculateDspaceValue(std::vector<int> hkl, double lattice);
// double calculateDspaceValue(std::vector<int> hkl, double lattice);

/// Calcualte value n for thermal neutron peak profile
void calculateThermalNeutronSpecial(IFunction_sptr mFunction, vector<double> vec_d, vector<double>& vec_n);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include "MantidCurveFitting/BoundaryConstraint.h"
#include "MantidCurveFitting/Gaussian.h"

#include "MantidGeometry/Crystal/UnitCell.h"

#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/split.hpp>

Expand Down Expand Up @@ -1106,7 +1108,6 @@ namespace CurveFitting


/** Calculate thermal neutron's d-spacing
*/
double RefinePowderInstrumentParameters::calculateDspaceValue(std::vector<int> hkl, double lattice)
{
// FIXME It only works for the assumption that the lattice is cubical
Expand All @@ -1118,6 +1119,7 @@ namespace CurveFitting
return d;
}
*/

/** Calcualte value n for thermal neutron peak profile
*/
Expand Down Expand Up @@ -1183,6 +1185,8 @@ namespace CurveFitting
std::map<std::vector<int>, CurveFitting::BackToBackExponential_sptr>::iterator peakiter;
std::vector<std::pair<double, std::pair<double, double> > > peakcenters; // d_h [TOF_h, CHI2]

Geometry::UnitCell unitcell(lattice, lattice, lattice, 90.0, 90.0, 90.0);

for (peakiter = mPeaks.begin(); peakiter != mPeaks.end(); ++peakiter)
{
vector<int> hkl = peakiter->first;
Expand All @@ -1197,7 +1201,10 @@ namespace CurveFitting
continue;
}

/* Replaced by UnitCell
double dh = calculateDspaceValue(hkl, lattice);
*/
double dh = unitcell.d(hkl[0], hkl[1], hkl[2]);
double center = peak->centre();
double height = peak->height();
double chi2;
Expand Down

0 comments on commit 3449ba7

Please sign in to comment.