Skip to content

Commit

Permalink
Some minor modification. Refs #5306.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Jul 6, 2012
1 parent 3ad9021 commit cb2d163
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "MantidAPI/IFunction1D.h"
#include "MantidAPI/IFunctionMW.h"
#include "MantidAPI/IPeakFunction.h"
#include "MantidCurveFitting/ThermoNeutronBackToBackExpPV.h"

namespace Mantid
{
Expand Down Expand Up @@ -49,7 +50,11 @@ namespace CurveFitting
virtual std::string name() const;

// Functions to input parameters
void setPeak(double d, double height);
void addPeaks(std::vector<std::vector<int> > peakhkls, std::vector<double> peakheights);
void setPeakHeights(std::vector<double> inheights);
CurveFitting::ThermoNeutronBackToBackExpPV_sptr getPeak(size_t peakindex);

void calPeaksParameters();

void calPeaks(double* out, const double* xValues, const size_t nData);

Expand All @@ -70,6 +75,8 @@ namespace CurveFitting

void calPeakParametersForD(double dh, double& alpha, double& beta, double &Tof_h, double &sigma_g2, double &gamma_l, std::map<std::string, double>& parmap) const;
void adPeakPositionD(double dh);
double calCubicDSpace(double a, int h, int k, int l) const;
void addPeak(double d, double height);

double mL1;
double mL2;
Expand All @@ -79,14 +86,19 @@ namespace CurveFitting
mutable double Sig0, Sig1, Sig2, Gam0, Gam1, Gam2;
mutable double Dtt1, Dtt2, Dtt1t, Dtt2t, Zero, Zerot;

std::vector<double> dvalues;
std::vector<double> heights;
mutable std::vector<std::map<std::string, double> > mPeakParameters; // It is in strict order with dvalues;
mutable std::vector<double> dvalues;
mutable std::vector<double> heights;
std::vector<std::vector<int> > mPeakHKLs;

API::IPeakFunction* mPeak;
//std::vector<API::IPeakFunction* > mPeaks;
std::vector<ThermoNeutronBackToBackExpPV_sptr> mPeaks;

mutable std::vector<std::map<std::string, double> > mPeakParameters; // It is in strict order with dvalues;

};

typedef boost::shared_ptr<LeBailFunction> LeBailFunction_sptr;


} // namespace CurveFitting
} // namespace Mantid
Expand Down
4 changes: 1 addition & 3 deletions Code/Mantid/Framework/CurveFitting/src/LeBailFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ namespace CurveFitting
mL1 = 1.0;
mL2 = 0.0;

g_log.warning() << "LeBailFunction.function1D(): Need a good algorithm to calculate a proper range for each peak. " << std::endl;

return;
}

Expand Down Expand Up @@ -225,7 +223,7 @@ namespace CurveFitting
mPeaks[id]->setParameter("Sigma2", sigma2);
mPeaks[id]->setParameter("Gamma", gamma);

// c) FIXME Implement "Calculate individual peak range"
// c) Calculate individual peak range
double fwhm = mPeaks[id]->fwhm();
double tof_low = tof_h - DEFAULTPEAKWIDTHFACTOR*fwhm;
double tof_upper = tof_h + DEFAULTPEAKWIDTHFACTOR*fwhm;
Expand Down

0 comments on commit cb2d163

Please sign in to comment.