Mantid
Loading...
Searching...
No Matches
GetDetectorOffsets.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 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
10#include "MantidAPI/IFunction.h"
11#include "MantidAlgorithms/DllConfig.h"
13
14namespace Mantid {
15namespace Algorithms {
22class MANTID_ALGORITHMS_DLL GetDetectorOffsets final : public API::Algorithm {
23
24 enum class offset_mode : int { signed_offset, relative_offset, absolute_offset };
25
26public:
28 const std::string name() const override { return "GetDetectorOffsets"; }
30 const std::string summary() const override {
31 return "Creates an OffsetsWorkspace containing offsets for each detector. "
32 "You can then save these to a .cal file using SaveCalFile.";
33 }
34
36 int version() const override { return 1; }
37 const std::vector<std::string> seeAlso() const override { return {"AlignComponents"}; }
39 const std::string category() const override { return "Diffraction\\Calibration"; }
40
41private:
42 // Overridden Algorithm methods
43 void init() override;
44 std::map<std::string, std::string> validateInputs() override;
45 void exec() override;
47 double fitSpectra(const int64_t s);
50 API::IFunction_sptr createFunction(const double peakHeight, const double peakLoc);
53
56 double m_Xmin = DBL_MAX;
57 double m_Xmax = -DBL_MIN;
58 double m_maxOffset = 0.0;
59 double m_dreference = 0.0;
61 double m_dideal = 0.0;
63 double m_step = 0.0;
64 bool m_estimateFWHM = true;
65};
66} // namespace Algorithms
67} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Find the offsets for each detector.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
void retrieveProperties()
Read in all the input parameters.
API::MatrixWorkspace_sptr inputW
A pointer to the input workspace.
int version() const override
Algorithm's version for identification overriding a virtual method.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
const std::string summary() const override
Summary of algorithms purpose.
DataObjects::OffsetsWorkspace_sptr outputW
A pointer to the output workspace.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class
Definition: IFunction.h:732
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< OffsetsWorkspace > OffsetsWorkspace_sptr
shared pointer to the OffsetsWorkspace class
Helper class which provides the Collimation Length for SANS instruments.