Mantid
Loading...
Searching...
No Matches
PreprocessDetectorsToMD.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 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
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/Algorithm.h"
14#include "MantidMDAlgorithms/DllConfig.h"
15
16namespace Mantid {
17namespace MDAlgorithms {
24class MANTID_MDALGORITHMS_DLL PreprocessDetectorsToMD : public API::Algorithm {
25public:
27 virtual ~PreprocessDetectorsToMD() = default;
28
30 const std::string name() const override { return "PreprocessDetectorsToMD"; };
32 const std::string summary() const override {
33 return "Its a helper algorithm, used to make common part of transformation "
34 "from real to reciprocal space. "
35 "It is used by :ref:`algm-ConvertToMD` and "
36 ":ref:`algm-ConvertToMDMinMaxLocal` algorithms to save time spent "
37 "on this transformation "
38 "when the algorithm used multiple times for multiple measurements "
39 "on the same instrument.";
40 }
41
43 int version() const override { return 1; };
45 const std::string category() const override { return "MDAlgorithms\\Utility"; }
46
47private:
48 void init() override;
49 void exec() override;
56
57protected: // for testing
58 void processDetectorsPositions(const API::MatrixWorkspace_const_sptr &inputWS,
60 void buildFakeDetectorsPositions(const API::MatrixWorkspace_const_sptr &inputWS,
62 void updateMasksState(const API::MatrixWorkspace_const_sptr &inputWS, DataObjects::TableWorkspace_sptr &targWS);
63 // build a table workspace corresponding to the input matrix workspace
64 std::shared_ptr<DataObjects::TableWorkspace> createTableWorkspace(const API::MatrixWorkspace_const_sptr &inputWS);
65 bool isDetInfoLost(const Mantid::API::MatrixWorkspace_const_sptr &inWS2D) const;
66 // helper function to get efixed if it is there or not;
67 double getEi(const API::MatrixWorkspace_const_sptr &inputWS) const;
68};
69
70} // namespace MDAlgorithms
71} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
This is helper algorithm used to preprocess detector's positions namely to perform generic part of th...
int version() const override
Algorithm's version for identification.
const std::string summary() const override
Summary of algorithms purpose.
const std::string category() const override
Algorithm's category for identification.
bool m_getIsMasked
the variable specifies if one needs to return the state of detector mask e.g if the detector is maske...
bool m_getEFixed
the variable specifies if one needs to calculate efixed for detectors (make sense for indirect instru...
const std::string name() const override
Algorithm's name for identification.
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< TableWorkspace > TableWorkspace_sptr
shared pointer to Mantid::DataObjects::TableWorkspace
Helper class which provides the Collimation Length for SANS instruments.