Mantid
Loading...
Searching...
No Matches
CalculateTransmission.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 "MantidAlgorithms/DllConfig.h"
11
12namespace Mantid {
13namespace Algorithms {
50class MANTID_ALGORITHMS_DLL CalculateTransmission : public API::ParallelAlgorithm {
51public:
53 const std::string name() const override { return "CalculateTransmission"; }
56 const std::string summary() const override {
57 return "Calculates the transmission correction, as a function of "
58 "wavelength, for a SANS instrument.";
59 }
60
62 int version() const override { return (1); }
63 const std::vector<std::string> seeAlso() const override {
64 return {"CalculateTransmissionBeamSpreader", "ApplyTransmissionCorrection"};
65 }
67 const std::string category() const override { return "SANS;CorrectionFunctions\\TransmissionCorrections"; }
68
69private:
72 mutable double m_done{0.0};
73
75 void init() override;
77 void exec() override;
78
80 API::MatrixWorkspace_sptr extractSpectra(const API::MatrixWorkspace_sptr &ws, const std::vector<size_t> &indices);
83 API::MatrixWorkspace_sptr fit(const API::MatrixWorkspace_sptr &raw, const std::vector<double> &rebinParams,
84 const std::string &fitMethod);
86 API::MatrixWorkspace_sptr fitData(const API::MatrixWorkspace_sptr &WS, double &grad, double &offset);
88 API::MatrixWorkspace_sptr fitPolynomial(const API::MatrixWorkspace_sptr &WS, int order,
89 std::vector<double> &coeficients);
91 API::MatrixWorkspace_sptr rebin(const std::vector<double> &binParams, const API::MatrixWorkspace_sptr &ws);
94 void logIfNotMonitor(const API::MatrixWorkspace_sptr &sampleWS, const API::MatrixWorkspace_sptr &directWS,
95 size_t index);
96};
97
98} // namespace Algorithms
99} // namespace Mantid
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
Base class for algorithms that can run in parallel on all MPI ranks but not in a distributed fashion.
Calculates the transmission correction, as a function of wavelength, for a SANS instrument.
const std::string name() const override
Algorithm's name.
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version.
const std::string summary() const override
Summary of algorithms purpose Summary of algorithms purpose.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
void MANTID_KERNEL_DLL rebin(const std::vector< double > &xold, const std::vector< double > &yold, const std::vector< double > &eold, const std::vector< double > &xnew, std::vector< double > &ynew, std::vector< double > &enew, bool distribution, bool addition=false)
Rebins data according to a new output X array.
Helper class which provides the Collimation Length for SANS instruments.