Mantid
Loading...
Searching...
No Matches
VesuvioResolution.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2013 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
12#include "MantidCurveFitting/DllConfig.h"
13
14namespace Mantid {
15namespace CurveFitting {
16namespace Algorithms {
17//---------------------------------------------------------------------------
18// Forward declarations
19//---------------------------------------------------------------------------
20struct DetectorParams;
21} // namespace Algorithms
22namespace Functions {
23
24//---------------------------------------------------------------------------
28 double dl1;
29 double dl2;
30 double dtof;
31 double dthe;
32 double dEnLorentz;
33 double dEnGauss;
34};
35
41class MANTID_CURVEFITTING_DLL VesuvioResolution : public API::ParamFunction, public API::IFunction1D {
42public:
45 static ResolutionParams getResolutionParameters(const API::MatrixWorkspace_const_sptr &ws, const size_t index);
46
49
53 std::string name() const override;
55 inline double resolutionFWHM() const { return m_resolutionSigma; }
57 inline double lorentzFWHM() const { return m_lorentzFWHM; }
59 void function1D(double *out, const double *xValues, const size_t nData) const override;
61 void setUpForFit() override;
63 void setMatrixWorkspace(std::shared_ptr<const API::MatrixWorkspace> workspace, size_t wsIndex, double startX,
64 double endX) override;
66 void cacheResolutionComponents(const Algorithms::DetectorParams &detpar, const ResolutionParams &respar);
68 void disableLogging() { m_log.setEnabled(false); }
70 void voigtApprox(std::vector<double> &voigt, const std::vector<double> &xValues, const double lorentzPos,
71 const double lorentzAmp, const double lorentzWidth, const double gaussWidth) const;
73 void voigtApprox(std::vector<double> &voigt, const std::vector<double> &xValues, const double lorentzPos,
74 const double lorentzAmp) const;
75
77
78private:
80 void declareAttributes() override;
82 void setAttribute(const std::string &name, const Attribute &value) override;
83
87 size_t m_wsIndex;
89 double m_mass;
91 std::shared_ptr<API::IPeakFunction> m_voigt;
97};
98
99} // namespace Functions
100} // namespace CurveFitting
101} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
This is a specialization of IFunction for functions of one real argument.
Definition: IFunction1D.h:43
Attribute is a non-fitting parameter.
Definition: IFunction.h:282
Implements the part of IFunction interface dealing with parameters.
Definition: ParamFunction.h:33
Calculate the resolution from a workspace of Vesuvio data using the mass & instrument definition.
size_t m_wsIndex
Current workspace index, required to access instrument parameters.
double lorentzFWHM() const
Access lorentz FWHM.
double resolutionFWHM() const
Access total resolution width.
std::shared_ptr< API::IPeakFunction > m_voigt
Voigt function.
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition: Logger.h:52
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
Helper class which provides the Collimation Length for SANS instruments.
Simple data structure to store nominal detector values It avoids some functions taking a huge number ...
Simple data structure to store resolution parameter values It avoids some functions taking a huge num...
double dl2
spread in sample-detector distance (m)
double dthe
spread in scattering angle (radians)
double dtof
spread in tof measurement (us)
double dl1
spread in source-sample distance (m)
double dEnLorentz
lorentz width in energy (meV)
double dEnGauss
gaussian width in energy (meV