15#include "MantidAlgorithms/DllConfig.h"
22namespace HistogramData {
58 const std::string
name()
const override {
return "GetEi"; }
60 const std::string
summary()
const override {
61 return "Calculates the kinetic energy of neutrons leaving the source based "
62 "on the time it takes for them to travel between two monitors.";
66 int version()
const override {
return 2; }
67 const std::vector<std::string>
seeAlso()
const override {
return {
"GetAllEi",
"GetEiMonDet",
"GetEiT0atSNS"}; }
69 const std::string
category()
const override {
return "Inelastic\\Ei"; }
73 double calculateEi(
const double initial_guess);
76 double getDistanceFromSource(
const size_t ws_index,
const API::SpectrumInfo &spectrumInfo)
const;
78 double calculatePeakPosition(
const size_t ws_index,
const double t_min,
const double t_max);
83 std::vector<double> &peak_x, std::vector<double> &peak_y,
84 std::vector<double> &peak_e)
const;
91 void integrate(
double &integral_val,
double &integral_err,
const HistogramData::HistogramX &x,
92 const HistogramData::HistogramY &s,
const HistogramData::HistogramE &e,
const double xmin,
93 const double xmax)
const;
95 void storeEi(
const double ei)
const;
Base class from which all concrete algorithm classes should be derived.
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
Requires an estimate for the initial neutron energy which it uses to search for monitor peaks and fro...
const std::string summary() const override
Summary of algorithms purpose.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
double m_tof_window
The percentage deviation from the estimated peak time that defines the peak region.
const double m_bkgd_frac
The fraction of the peakwidth to use in calculating background points.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
double m_t_to_mev
Conversion factor between time and energy.
int version() const override
Algorithm's version for identification overriding a virtual method.
API::MatrixWorkspace_sptr m_input_ws
The input workspace.
const double m_peak_signif
Number of std deviations to consider a peak.
std::pair< int, double > m_peak1_pos
The calculated position of the first peak.
bool m_fixedei
True if the Ei should be fixed at the guess energy.
const double m_peak_deriv
Number of std deviations to consider a peak for the derivative.
const double m_binwidth_frac
The fraction of the peak width for the new bins.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
void MANTID_KERNEL_DLL rebin(const std::vector< double > &xold, const std::vector< double > &yold, const std::vector< double > &eold, const std::vector< double > &xnew, std::vector< double > &ynew, std::vector< double > &enew, bool distribution, bool addition=false)
Rebins data according to a new output X array.
Helper class which provides the Collimation Length for SANS instruments.