13#include "MantidMDAlgorithms/DllConfig.h"
17namespace MDAlgorithms {
28 return (0.5 * wavelength / sin(twotheta * 0.5 * M_PI / 180.));
40 return (2.0 * asin(0.5 * wavelength / dspace) * 180. / M_PI);
52 return (4. * M_PI * sin(twotheta * 0.5 * M_PI / 180.) / wavelength);
64 return (2.0 * asin(q * wavelength * 0.25 / M_PI) * 180. / M_PI);
75 return detpos.
angle(samplepos);
85 const std::string
name()
const override {
return "ConvertCWPDMDToSpectra"; }
88 const std::string
summary()
const override {
89 return "Convert constant wavelength (CW) powder diffraction (PD) data in "
91 " to a single-spectrum MatrixWorkspace, i.e., binning the "
93 " to single spectrum according to neutron's scattering angle, "
98 int version()
const override {
return (1); }
101 const std::string
category()
const override {
return "Diffraction\\ConstantWavelength;Diffraction\\Focussing"; }
105 void init()
override;
108 void exec()
override;
113 const std::string &targetunit,
114 const std::map<int, double> &map_runwavelength,
const double xmin,
115 const double xmax,
const double binsize,
bool dolinearinterpolation,
116 const std::vector<detid_t> &vec_excludeddets);
120 const std::map<int, double> &map_runwavelength,
double &xmin,
double &xmax);
124 const std::map<int, double> &map_runlambda,
const std::vector<double> &vecx, std::vector<double> &vecy,
125 const std::vector<detid_t> &vec_excludedet);
135 const double &infinitesimal);
140 bool isExcluded(
const std::vector<detid_t> &vec_excludedet,
const detid_t detid);
143 double m_infitesimal = 1.0E-10;
Base class from which all concrete algorithm classes should be derived.
double angle(const V3D &) const
Angle between this and another vector.
ConvertCWPDMDToSpectra : Convert one MDWorkspaces containing reactor-source powder diffractometer's d...
const std::string category() const override
Algorithm's category for identification.
const std::string summary() const override
Summary of algorithms purpose.
int version() const override
Algorithm's version.
const std::string name() const override
Algorithm's name.
void convertUnits(API::MatrixWorkspace_sptr matrixws, const std::string &targetunit, const double &wavelength)
Convert units from 2theta to d-spacing or Q.
std::shared_ptr< const IMDEventWorkspace > IMDEventWorkspace_const_sptr
Shared pointer to Mantid::API::IMDEventWorkspace (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
double calcualte2ThetaFromQ(const double &q, const double &wavelength)
Calculate detector's 2theta value from Q 2theta = 2*asin(lambda*Q/(4pi))
double calculateDspaceFrom2Theta(const double &twotheta, const double &wavelength)
Calculate d-space value from detector's position (2theta/theta) and wavelength.
double calculate2ThetaFromD(const double &dspace, const double &wavelength)
Calcualte detector's 2theta value from d-spacing value 2theta = 2*asin(lamba/2/d)
double calculateQFrom2Theta(const double &twotheta, const double &wavelength)
Calculate Q value from detector's positin (2theta/theta) and wavelength q = 2 k sin(theta) = (4 pi)/(...
double calculate2Theta(const Kernel::V3D &detpos, const Kernel::V3D &samplepos)
Calculate 2theta value of detector postion from sample position.
Helper class which provides the Collimation Length for SANS instruments.