Skip to content

Commit

Permalink
Refs #11674. Added overridable method for peak center
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wedel committed May 1, 2015
1 parent 4e177de commit f4fae77
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Expand Up @@ -260,6 +260,8 @@ class MANTID_SINQ_DLL PoldiSpectrumDomainFunction
protected:
virtual void init();

virtual double getPeakCenter(const Poldi2DHelper_sptr &poldi2DHelper) const;

void initializeParametersFromWorkspace(
const DataObjects::Workspace2D_const_sptr &workspace2D);
void initializeInstrumentParameters(
Expand Down
Expand Up @@ -63,7 +63,7 @@ void PoldiSpectrumDomainFunction::function1DSpectrum(
int domainSize = static_cast<int>(domain.size());

double fwhm = m_profileFunction->fwhm();
double centre = m_profileFunction->centre();
double centre = getPeakCenter(helper);

double dWidth = 2.0 * fwhm;
double dCalcMin = centre - dWidth;
Expand Down Expand Up @@ -119,7 +119,7 @@ void PoldiSpectrumDomainFunction::functionDeriv1DSpectrum(
size_t domainSize = domain.size();

double fwhm = m_profileFunction->fwhm();
double centre = m_profileFunction->centre();
double centre = getPeakCenter(helper);

double dWidth = 2.0 * fwhm;
double dCalcMin = centre - dWidth;
Expand Down Expand Up @@ -185,6 +185,13 @@ IPeakFunction_sptr PoldiSpectrumDomainFunction::getProfileFunction() const {
/// Does nothing.
void PoldiSpectrumDomainFunction::init() {}

/// Returns the centre parameter of the decorated profile function.
double PoldiSpectrumDomainFunction::getPeakCenter(
const Poldi2DHelper_sptr &poldi2DHelper) const {
UNUSED_ARG(poldi2DHelper)
return m_profileFunction->centre();
}

/**
* Extracts the time difference as well as instrument information
*
Expand Down

0 comments on commit f4fae77

Please sign in to comment.