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
76 void updateRotMat(const std::vector<double> &newMat) override { m_RotMat = newMat; }
77
78protected:
79 // directions to the detectors
80 double m_ex, m_ey, m_ez;
81 // the matrix which transforms the neutron momentums from laboratory to
82 // crystal coordinate system.
83 std::vector<double> m_RotMat;
84 // min-max values, some modified to work with squared values:
85 std::vector<double> m_DimMin, m_DimMax;
86 // pointer to the array of V3D unit vectors, directed from the sample to the
87 // positions, where preprocessed detectors are.
89
90 // number of dimensions, calculated from a matrix workspace, which is one in
91 // elastic and two in inelastic mode here.
92 unsigned int m_NMatrixDim;
93 // the variable which describes current conversion mode:
99 std::vector<coord_t> m_AddDimCoordinates;
100 //************* The variables below are relevant to inelastic modes only and
101 // will be used in inelastic cases:
102 // the wavevector of incident neutrons
103 double m_kFixed;
104 // the energy of the incident neutrons
105 double m_eFixed;
106 // pointer to detector specific input energy (eFixed) defined for indirect
107 // instruments; This one is relewant to indirect instruments only;
109 // pointer to the array which contains detectors masks. TODO: It is here
110 // untill Mantid masks spectra by 0 instead of NaNs, when switched to NaN-s --
111 // remove
113
114private:
116 inline bool calcMatrixCoordElastic(const double &k0, std::vector<coord_t> &Coord) const;
118 inline bool calcMatrixCoordInelastic(const double &deltaE, std::vector<coord_t> &Coord) const;
119};
120
121} // namespace MDAlgorithms
122} // 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)
void updateRotMat(const std::vector< double > &newMat) override
Updates the internal rotation matrix for classes which support this.
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