Mantid
Loading...
Searching...
No Matches
SofQCommon.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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#include "MantidAlgorithms/DllConfig.h"
13// Routines used by all SofQW algorithms intended to provide united
14// user interface to all SofQ algorihtms.
15namespace Mantid {
16namespace Geometry {
17class ComponentInfo;
18}
19namespace Algorithms {
20
21struct MANTID_ALGORITHMS_DLL SofQCommon {
22
28 double m_efixed;
29
30 // Constructor
31 SofQCommon() : m_emode(0), m_efixedGiven(false), m_efixed(0.0) {}
32 // init the class parameters, defined above
33 void initCachedValues(const API::MatrixWorkspace &workspace, API::Algorithm const *hostAlgorithm);
34
36 double getEFixed(const Geometry::IDetector &det) const;
38 double getEFixed(const Geometry::ComponentInfo &componentInfo, const size_t componentIndex) const;
39
41 double q(const double deltaE, const double twoTheta, const Geometry::IDetector *det) const;
43 double q(const double deltaE, const double twoTheta, const double efixed) const;
44
46 std::pair<double, double> qBinHints(const API::MatrixWorkspace &ws, const double minE, const double maxE) const;
47
48private:
49 double directQ(const double deltaE, const double twoTheta) const;
50 double indirectQ(const double deltaE, const double twoTheta, const Geometry::IDetector *det) const;
51 static double indirectQFromEFixed(const double deltaE, const double twoTheta, const double efixed);
52 std::pair<double, double> qBinHintsDirect(const API::MatrixWorkspace &ws, const double minE, const double maxE) const;
53 std::pair<double, double> qBinHintsIndirect(const API::MatrixWorkspace &ws, const double minE,
54 const double maxE) const;
55};
56} // namespace Algorithms
57} // namespace Mantid
IPeaksWorkspace_sptr workspace
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
Base MatrixWorkspace Abstract Class.
ComponentInfo : Provides a component centric view on to the instrument.
Interface class for detector objects.
Definition IDetector.h:37
Helper class which provides the Collimation Length for SANS instruments.
bool m_efixedGiven
EFixed has been provided.
Definition SofQCommon.h:26