Mantid
Loading...
Searching...
No Matches
MDTransfModQ.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 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//
11//
12namespace Mantid {
13namespace MDAlgorithms {
14
27class MANTID_MDALGORITHMS_DLL MDTransfModQ : public MDTransfInterface {
28public:
31 const std::string transfID() const override; // {return "ModQ"; }
34 std::vector<std::string> getEmodes() const override;
35
36 bool calcGenericVariables(std::vector<coord_t> &Coord, size_t nd) override;
37 bool calcYDepCoordinates(std::vector<coord_t> &Coord, size_t i) override;
38 bool calcMatrixCoord(const double &deltaEOrK0, std::vector<coord_t> &Coord, double &signal,
39 double &ErrSq) const override;
40 // constructor;
42 /* clone method allowing to provide the copy of the particular class */
43 MDTransfInterface *clone() const override { return new MDTransfModQ(*this); }
44 //
45 void initialize(const MDWSDescription &ConvParams) override;
46
47 std::vector<double> getExtremumPoints(const double eMin, const double eMax, size_t det_num) const override;
48
49 // WARNING!!!! THESE METHODS ARE USED BEFORE INITIALIZE IS EXECUTED SO THEY
50 // CAN NOT RELY ON THE CONTENTS OF THE CLASS TO BE DEFINED (THEY ARE VIRTUAL
51 // STATIC METHODS)
56 unsigned int
57 getNMatrixDimensions(Kernel::DeltaEMode::Type mode,
61 std::vector<std::string>
62 outputUnitID(Kernel::DeltaEMode::Type dEmode,
65 std::vector<std::string>
66 getDefaultDimID(Kernel::DeltaEMode::Type dEmode,
70 const std::string
71 inputUnitID(Kernel::DeltaEMode::Type dEmode,
73 void setDisplayNormalization(Mantid::API::IMDWorkspace_sptr mdWorkspace,
74 Mantid::API::MatrixWorkspace_sptr underlyingWorkspace) const override;
75
76protected:
77 // directions to the detectors
78 double m_ex, m_ey, m_ez;
79 // the matrix which transforms the neutron momentums from laboratory to
80 // crystal coordinate system.
81 std::vector<double> m_RotMat;
82 // min-max values, some modified to work with squared values:
83 std::vector<double> m_DimMin, m_DimMax;
84 // pointer to the array of V3D unit vectors, directed from the sample to the
85 // positions, where preprocessed detectors are.
87
88 // number of dimensions, calculated from a matrix workspace, which is one in
89 // elastic and two in inelastic mode here.
90 unsigned int m_NMatrixDim;
91 // the variable which describes current conversion mode:
97 std::vector<coord_t> m_AddDimCoordinates;
98 //************* The variables below are relevant to inelastic modes only and
99 // will be used in inelastic cases:
100 // the wavevector of incident neutrons
101 double m_kFixed;
102 // the energy of the incident neutrons
103 double m_eFixed;
104 // pointer to detector specific input energy (eFixed) defined for indirect
105 // instruments; This one is relewant to indirect instruments only;
107 // pointer to the array which contains detectors masks. TODO: It is here
108 // untill Mantid masks spectra by 0 instead of NaNs, when switched to NaN-s --
109 // remove
111
112private:
114 inline bool calcMatrixCoordElastic(const double &k0, std::vector<coord_t> &Coord) const;
116 inline bool calcMatrixCoordInelastic(const double &deltaE, std::vector<coord_t> &Coord) const;
117};
118
119} // namespace MDAlgorithms
120} // namespace Mantid
Class for 3D vectors.
Definition V3D.h:34
Interface to set of sub-classes used by ConvertToMD algorithm and responsible for conversion of input...
Class responsible for conversion of input workspace data into proper number of output dimensions for ...
std::vector< double > m_RotMat
Kernel::V3D const * m_DetDirecton
std::vector< double > m_DimMax
Kernel::DeltaEMode::Type m_Emode
MDTransfInterface * clone() const override
std::vector< coord_t > m_AddDimCoordinates
the vector of the additional coordinates which define additional MD dimensions.
const std::string transfID() const override
the name, this ChildAlgorithm is known to users (will appear in selection list)
helper class describes the properties of target MD workspace, which should be obtained as the result ...
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< IMDWorkspace > IMDWorkspace_sptr
Shared pointer to the IMDWorkspace base class.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.
Type
Define the available energy transfer modes It is important to assign enums proper numbers,...
Definition DeltaEMode.h:29