Commit 59614c19 authored by Samuel Jackson's avatar Samuel Jackson
Browse files

Refs #20441 Add new helper methods to IPeak

parent 33e58f04
......@@ -126,11 +126,13 @@ public:
double getInitialEnergy() const override;
double getFinalEnergy() const override;
double getEnergy() const override;
void setInitialEnergy(double m_initialEnergy) override;
void setFinalEnergy(double m_finalEnergy) override;
double getIntensity() const override;
double getSigmaIntensity() const override;
double getIntensityOverSigma() const override;
void setIntensity(double m_intensity) override;
void setSigmaIntensity(double m_sigmaIntensity) override;
......
......@@ -713,6 +713,12 @@ double Peak::getFinalEnergy() const { return m_finalEnergy; }
/** Get the initial (incident) neutron energy */
double Peak::getInitialEnergy() const { return m_initialEnergy; }
/** Get the difference between the initial and final neutron energy */
double Peak::getEnergy() const
{
return getInitialEnergy() - getFinalEnergy();
}
//----------------------------------------------------------------------------------------------
/** Get the H index of the peak */
double Peak::getH() const { return m_H; }
......@@ -791,6 +797,12 @@ double Peak::getIntensity() const { return m_intensity; }
/** Return the error on the integrated peak intensity */
double Peak::getSigmaIntensity() const { return m_sigmaIntensity; }
/** Return the peak intensity divided by the error in the intensity */
double Peak::getIntensityOverSigma() const
{
return m_intensity / m_sigmaIntensity;
}
/** Set the integrated peak intensity
* @param m_intensity :: intensity value */
void Peak::setIntensity(double m_intensity) { this->m_intensity = m_intensity; }
......
......@@ -63,12 +63,13 @@ public:
virtual double getInitialEnergy() const = 0;
virtual double getFinalEnergy() const = 0;
virtual double getEnergy() const = 0;
virtual void setInitialEnergy(double m_InitialEnergy) = 0;
virtual void setFinalEnergy(double m_FinalEnergy) = 0;
virtual double getIntensity() const = 0;
virtual double getSigmaIntensity() const = 0;
virtual double getIntensityOverSigma() const = 0;
virtual void setIntensity(double m_Intensity) = 0;
virtual void setSigmaIntensity(double m_SigmaIntensity) = 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment