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
30class MANTID_MDALGORITHMS_DLL MDTransfModQ : public MDTransfInterface {
31public:
34 const std::string transfID() const override; // {return "ModQ"; }
37 std::vector<std::string> getEmodes() const override;
38
39 bool calcGenericVariables(std::vector<coord_t> &Coord, size_t nd) override;
40 bool calcYDepCoordinates(std::vector<coord_t> &Coord, size_t i) override;
41 bool calcMatrixCoord(const double &deltaEOrK0, std::vector<coord_t> &Coord, double &signal,
42 double &ErrSq) const override;
43 // constructor;
45 /* clone method allowing to provide the copy of the particular class */
46 MDTransfInterface *clone() const override { return new MDTransfModQ(*this); }
47 //
48 void initialize(const MDWSDescription &ConvParams) override;
49
50 std::vector<double> getExtremumPoints(const double eMin, const double eMax, size_t det_num) const override;
51
52 // WARNING!!!! THESE METHODS ARE USED BEFORE INITIALIZE IS EXECUTED SO THEY
53 // CAN NOT RELY ON THE CONTENTS OF THE CLASS TO BE DEFINED (THEY ARE VIRTUAL
54 // STATIC METHODS)
59 unsigned int
60 getNMatrixDimensions(Kernel::DeltaEMode::Type mode,
64 std::vector<std::string>
65 outputUnitID(Kernel::DeltaEMode::Type dEmode,
68 std::vector<std::string>
69 getDefaultDimID(Kernel::DeltaEMode::Type dEmode,
73 const std::string
74 inputUnitID(Kernel::DeltaEMode::Type dEmode,
76 void setDisplayNormalization(Mantid::API::IMDWorkspace_sptr mdWorkspace,
77 Mantid::API::MatrixWorkspace_sptr underlyingWorkspace) const override;
78
79protected:
80 // directions to the detectors
81 double m_ex, m_ey, m_ez;
82 // the matrix which transforms the neutron momentums from laboratory to
83 // crystal coordinate system.
84 std::vector<double> m_RotMat;
85 // min-max values, some modified to work with squared values:
86 std::vector<double> m_DimMin, m_DimMax;
87 // pointer to the array of V3D unit vectors, directed from the sample to the
88 // positions, where preprocessed detectors are.
90
91 // number of dimensions, calculated from a matrix workspace, which is one in
92 // elastic and two in inelastic mode here.
93 unsigned int m_NMatrixDim;
94 // the variable which describes current conversion mode:
100 std::vector<coord_t> m_AddDimCoordinates;
101 //************* The variables below are relevant to inelastic modes only and
102 // will be used in inelastic cases:
103 // the wavevector of incident neutrons
104 double m_kFixed;
105 // the energy of the incident neutrons
106 double m_eFixed;
107 // pointer to detector specific input energy (eFixed) defined for indirect
108 // instruments; This one is relewant to indirect instruments only;
110 // pointer to the array which contains detectors masks. TODO: It is here
111 // untill Mantid masks spectra by 0 instead of NaNs, when switched to NaN-s --
112 // remove
114
115private:
117 inline bool calcMatrixCoordElastic(const double &k0, std::vector<coord_t> &Coord) const;
119 inline bool calcMatrixCoordInelastic(const double &deltaE, std::vector<coord_t> &Coord) const;
120};
121
122} // namespace MDAlgorithms
123} // 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 ...
Definition: MDTransfModQ.h:30
std::vector< double > m_RotMat
Definition: MDTransfModQ.h:84
Kernel::V3D const * m_DetDirecton
Definition: MDTransfModQ.h:89
std::vector< double > m_DimMax
Definition: MDTransfModQ.h:86
Kernel::DeltaEMode::Type m_Emode
Definition: MDTransfModQ.h:95
MDTransfInterface * clone() const override
Definition: MDTransfModQ.h:46
std::vector< coord_t > m_AddDimCoordinates
the vector of the additional coordinates which define additional MD dimensions.
Definition: MDTransfModQ.h:100
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.
Definition: IMDWorkspace.h:146
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