Mantid
Loading...
Searching...
No Matches
MDNormSCD.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2014 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 DataObjects {
14class EventWorkspace;
15}
16namespace MDAlgorithms {
17
20class MANTID_MDALGORITHMS_DLL MDNormSCD : public SlicingAlgorithm {
21public:
22 MDNormSCD();
23
24 const std::string name() const override;
25 int version() const override;
26 const std::vector<std::string> seeAlso() const override {
27 return {"MDNormSCDPreprocessIncoherent", "MDNormDirectSC"};
28 }
29 const std::string category() const override;
30 const std::string summary() const override;
31
32private:
33 void init() override;
34 void exec() override;
35
36 void cacheInputs();
37 std::string inputEnergyMode() const;
38
40 void createNormalizationWS(const DataObjects::MDHistoWorkspace &dataWS);
41 std::vector<coord_t> getValuesFromOtherDimensions(bool &skipNormalization, uint16_t expInfoIndex = 0) const;
42 Kernel::Matrix<coord_t> findIntergratedDimensions(const std::vector<coord_t> &otherDimValues,
43 bool &skipNormalization);
44 void cacheDimensionXValues();
45 void calculateNormalization(const std::vector<coord_t> &otherValues, const Kernel::Matrix<coord_t> &affineTrans,
46 uint16_t expInfoIndex);
47 void calcIntegralsForIntersections(const std::vector<double> &xValues, const API::MatrixWorkspace &integrFlux,
48 size_t sp, std::vector<double> &yValues) const;
49 void calculateIntersections(std::vector<std::array<double, 4>> &intersections, const double theta, const double phi);
50
56 coord_t m_hmin, m_hmax, m_kmin, m_kmax, m_lmin, m_lmax;
58 bool m_hIntegrated, m_kIntegrated, m_lIntegrated;
62 double m_kiMin, m_kiMax;
64 size_t m_hIdx, m_kIdx, m_lIdx;
66 std::vector<double> m_hX, m_kX, m_lX;
72 std::string convention;
74 bool m_accumulate{false};
77};
78
79} // namespace MDAlgorithms
80} // namespace Mantid
Base MatrixWorkspace Abstract Class.
Numerical Matrix class.
Definition: Matrix.h:42
Class for 3D vectors.
Definition: V3D.h:34
MDNormSCD : Generate MD normalization for single crystal diffraction.
Definition: MDNormSCD.h:20
DataObjects::MDHistoWorkspace_sptr m_normWS
Normalization workspace.
Definition: MDNormSCD.h:52
bool m_hIntegrated
flag for integrated h,k,l dimensions
Definition: MDNormSCD.h:58
Mantid::Kernel::DblMatrix m_rubw
(2*PiRUBW)^-1
Definition: MDNormSCD.h:60
std::vector< double > m_hX
cached X values along dimensions h,k,l
Definition: MDNormSCD.h:66
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: MDNormSCD.h:26
uint16_t m_numExptInfos
number of experiment infos
Definition: MDNormSCD.h:76
size_t m_hIdx
index of h,k,l dimensions in the output workspaces
Definition: MDNormSCD.h:64
Kernel::V3D m_samplePos
Sample position.
Definition: MDNormSCD.h:68
API::IMDEventWorkspace_sptr m_inputWS
Input workspace.
Definition: MDNormSCD.h:54
Kernel::V3D m_beamDir
Beam direction.
Definition: MDNormSCD.h:70
std::string convention
ki-kf for Inelastic convention; kf-ki for Crystallography convention
Definition: MDNormSCD.h:72
Abstract Algorithm class that will be used by: BinMD and SliceMD and shares code for getting a slice ...
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< MDHistoWorkspace > MDHistoWorkspace_sptr
A shared pointer to a MDHistoWorkspace.
Helper class which provides the Collimation Length for SANS instruments.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...
Definition: MDTypes.h:27