Mantid
Loading...
Searching...
No Matches
ConvertToYSpace.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2013 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 "MantidCurveFitting/DllConfig.h"
14
15namespace Mantid {
16class SpectrumDefinition;
17
18namespace Kernel {
19class V3D;
20}
21
22namespace Geometry {
23class ComponentInfo;
24class ParameterMap;
25} // namespace Geometry
26
27namespace CurveFitting {
28namespace Algorithms {
29
33 double l1;
34 double l2;
36 double theta;
37 double t0;
38 double efixed;
39};
40
46class MANTID_CURVEFITTING_DLL ConvertToYSpace final : public API::Algorithm {
47public:
50
51 const std::string name() const override;
53 const std::string summary() const override {
54 return "Converts workspace in units of TOF to Y-space as defined in "
55 "Compton scattering field";
56 }
57
58 int version() const override;
59 const std::string category() const override;
60
63 static DetectorParams getDetectorParameters(const API::MatrixWorkspace_const_sptr &ws, const size_t index);
65 static double getComponentParameter(const Geometry::IComponent &det, const Geometry::ParameterMap &pmap,
66 const std::string &name);
68 static double getComponentParameter(const Geometry::ComponentInfo &componentInfo,
69 const SpectrumDefinition &spectrumDefinition, const std::string &name);
71 static void calculateY(double &yspace, double &qspace, double &ei, const double mass, const double tsec,
72 const double k1, const double v1, const DetectorParams &detpar);
73
74private:
75 void init() override;
76 void exec() override;
77
79 bool convert(const size_t index);
81 void retrieveInputs();
83 void createOutputWorkspace();
85 void cacheInstrumentGeometry();
86
90 double m_mass;
92 double m_l1;
95
99};
100
101} // namespace Algorithms
102} // namespace CurveFitting
103} // namespace Mantid
std::string name
Definition Run.cpp:60
std::map< DeltaEMode::Type, std::string > index
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
Takes a workspace with X axis in TOF and converts it to Y-space where the transformation is defined b...
API::MatrixWorkspace_sptr m_outputWS
Output workspace.
const std::string summary() const override
Summary of algorithms purpose.
API::MatrixWorkspace_sptr m_inputWS
Input workspace.
ComponentInfo : Provides a component centric view on to the instrument.
base class for Geometric IComponent
Definition IComponent.h:53
Parameter map iterator typedef.
Class for 3D vectors.
Definition V3D.h:35
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.
Generate a tableworkspace to store the calibration results.
Simple data structure to store nominal detector values It avoids some functions taking a huge number ...
double theta
scattering angle in radians
double l1
source-sample distance in metres
double l2
sample-detector distance in metres