Skip to content

Commit

Permalink
Revert some change. Refs #7506_calibrate_mem_leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
wdzhou committed Jul 29, 2013
1 parent 4cd8c6d commit 52bbaab
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 255 deletions.
24 changes: 6 additions & 18 deletions Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/FindPeaks.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ class PeakFittingRecord
/// Get chi-square
double getChiSquare() { return m_goodness; }
/// Get peak parameters
std::map<std::string, double>& getPeakParameters() { return m_peakParameterMap;}
std::map<std::string, double> getPeakParameters() { return m_peakParameterMap;}
/// Get background parameters
std::map<std::string, double>& getBackgroundParameters() { return m_bkgdParameterMap; }
std::map<std::string, double> getBackgroundParameters() { return m_bkgdParameterMap; }

private:
/// chi-square
Expand Down Expand Up @@ -117,7 +117,7 @@ class DLLExport FindPeaks : public API::Algorithm
void fitPeakInWindow(const API::MatrixWorkspace_sptr &input, const int spectrum, const double centre, const double xmin, const double xmax);

/// Fit peak by given/guessed FWHM
void fitPeakGuessFWHM(const API::MatrixWorkspace_sptr &input, const int spectrum, const double center_guess, const int FWHM_guess);
void fitPeak(const API::MatrixWorkspace_sptr &input, const int spectrum, const double center_guess, const int FWHM_guess);

/// Fit peak
void fitPeak(const API::MatrixWorkspace_sptr &input, const int spectrum, const int i_min, const int i_max, const int i_centre);
Expand All @@ -136,8 +136,7 @@ class DLLExport FindPeaks : public API::Algorithm
/// Add the fit record (failure) to output workspace
void addNonFitRecord(const size_t spectrum);

void updateFitResults(API::IFunction_sptr fitfunc, std::string fitstatus, double chi2, std::vector<double> &bestEffparams,
std::vector<double> &bestRawparams, double &mincost, const double expPeakPos, const double expPeakHeight);
void updateFitResults(API::IAlgorithm_sptr fitAlg, std::vector<double> &bestEffparams, std::vector<double> &bestRawparams, double &mincost, const double expPeakPos, const double expPeakHeight);

API::IFunction_sptr createFunction(const double height, const double centre, const double sigma, const double a0, const double a1, const double a2, const bool withPeak = true);
int getBackgroundOrder();
Expand All @@ -161,7 +160,7 @@ class DLLExport FindPeaks : public API::Algorithm
/// Fit peak with multiple iterations
PeakFittingRecord multiFitPeakBackground(API::MatrixWorkspace_sptr purepeakws, size_t purepeakindex,
API::MatrixWorkspace_sptr dataws, size_t datawsindex,
size_t iendx, API::IPeakFunction_sptr peak,
API::IPeakFunction_sptr peak,
double in_centre, double in_height, std::vector<double> in_fwhms,
double peakleftboundary, double peakrightboundary, double user_centre);

Expand All @@ -188,11 +187,6 @@ class DLLExport FindPeaks : public API::Algorithm
void processFitResult(PeakFittingRecord& r1, PeakFittingRecord& r2, API::IPeakFunction_sptr peak, API::IFunction_sptr bkgdfunc, size_t spectrum,
size_t imin, size_t imax, double windowsize);

bool fitFunction(const API::MatrixWorkspace_sptr ws, size_t wsindex, API::IFunction_sptr func,
int maxiteration, double startx, double endx, std::string minimizer,
std::string& fitstatus, double& chi2);


/// Get best result from a set of fitting result
int getBestResult(std::vector<double> vecRwp);

Expand All @@ -212,7 +206,7 @@ class DLLExport FindPeaks : public API::Algorithm
//Properties saved in the algo.
API::MatrixWorkspace_sptr m_dataWS; ///<workspace to check for peaks
int m_inputPeakFWHM; ///<holder for the requested peak FWHM
int m_wsIndex; ///<list of workspace indicies to check
int index; ///<list of workspace indicies to check
bool singleSpectrum; ///<flag for if only a single spectrum is present
bool m_highBackground; ///<flag for find relatively weak peak in high background
bool m_rawPeaksTable; ///<flag for whether the output is the raw peak parameters or effective (centre, width, height)
Expand All @@ -229,9 +223,6 @@ class DLLExport FindPeaks : public API::Algorithm
API::IFunction_sptr m_backgroundFunction;
API::IFunction_sptr m_peakAndBackgroundFunction;

// Temporary workspace for fitting
API::MatrixWorkspace_sptr m_tempWS;

int m_minGuessedPeakWidth;
int m_maxGuessedPeakWidth;
int m_stepGuessedPeakWidth;
Expand All @@ -251,9 +242,6 @@ class DLLExport FindPeaks : public API::Algorithm
/// Minimum peak height
double m_minHeight;

/// Peak function
API::IPeakFunction_sptr m_peakFunction;

};

} // namespace Algorithms
Expand Down

0 comments on commit 52bbaab

Please sign in to comment.