Mantid
Loading...
Searching...
No Matches
ConvertEmptyToTof.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
12#include "MantidAlgorithms/DllConfig.h"
14
15#include <utility> // std::pair
16
17namespace Mantid {
18namespace API {
19class SpectrumInfo;
20}
21namespace Algorithms {
22
29class MANTID_ALGORITHMS_DLL ConvertEmptyToTof final : public API::Algorithm, public API::DeprecatedAlgorithm {
30public:
31 const std::string name() const override;
32 int version() const override;
33 const std::string category() const override;
35 const std::string summary() const override { return "Converts the channel number to time of flight."; }
36
37private:
38 void init() override;
39 void exec() override;
40
41 void validateWorkspaceIndices(std::vector<int> &v);
42 void validateChannelIndices(std::vector<int> &v);
43
44 std::map<int, int> findElasticPeakPositions(const std::vector<int> &, const std::vector<int> &);
45
46 void estimateFWHM(const Mantid::HistogramData::HistogramY &, double &, double &, double &, double &, double &);
47
48 bool doFitGaussianPeak(int, double &, double &, double &, double, double);
49 std::pair<int, double> findAverageEppAndEpTof(const std::map<int, int> &);
50
51 double calculateTOF(double, double);
52 bool areEqual(double, double, double);
53 int roundUp(double);
54 std::vector<double> makeTofAxis(int, double, size_t, double);
55 void setTofInWS(const std::vector<double> &, const API::MatrixWorkspace_sptr &);
56
59 // Provide hint to compiler that this should be default initialized to nullptr
60 const API::SpectrumInfo *m_spectrumInfo = nullptr;
61};
62
63} // namespace Algorithms
64} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Class for marking algorithms as deprecated.
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
Definition: SpectrumInfo.h:53
API::MatrixWorkspace_sptr m_outputWS
const std::string summary() const override
Summary of algorithms purpose.
DataObjects::Workspace2D_sptr m_inputWS
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
Helper class which provides the Collimation Length for SANS instruments.