Mantid
Loading...
Searching...
No Matches
He3TubeEfficiency.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2008 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#include "MantidKernel/V3D.h"
14
15namespace Mantid {
16
17// forward declarations
18namespace HistogramData {
19class Points;
20}
21namespace Geometry {
22class IDetector;
23class IObject;
24class ParameterMap;
25} // namespace Geometry
26
27namespace Algorithms {
49class MANTID_ALGORITHMS_DLL He3TubeEfficiency final : public API::Algorithm {
50public:
53
55 const std::string name() const override { return "He3TubeEfficiency"; }
57 const std::string summary() const override { return "He3 tube efficiency correction."; }
58
60 int version() const override { return 1; }
61 const std::vector<std::string> seeAlso() const override { return {"DetectorEfficiencyCor"}; }
63 const std::string category() const override { return "CorrectionFunctions\\EfficiencyCorrections"; }
64
65private:
66 // Implement abstract Algorithm methods
67 void init() override;
68 void exec() override;
69 void execEvent();
70
72 void computeEfficiencyCorrection(std::vector<double> &effCorrection, const HistogramData::Points &wavelength,
73 const double expConstant, const double scale) const;
75 void correctForEfficiency(std::size_t spectraIndex, const API::SpectrumInfo &spectrumInfo);
77 void getDetectorGeometry(const Geometry::IDetector &det, double &detRadius, Kernel::V3D &detAxis);
79 double distToSurface(const Kernel::V3D &start, const Geometry::IObject *shape) const;
81 double detectorEfficiency(const double alpha, const double scale_factor = 1.0) const;
83 void logErrors() const;
85 double getParameter(const std::string &wsPropName, std::size_t currentIndex, const std::string &detPropName,
86 const Geometry::IDetector &idet);
88 template <class T> void eventHelper(std::vector<T> &events, double expval);
90 double calculateExponential(std::size_t spectraIndex, const Geometry::IDetector &idet);
91
100 std::map<const Geometry::IObject *, std::pair<double, Kernel::V3D>> m_shapeCache;
104 std::vector<specnum_t> m_spectraSkipped;
106 std::unique_ptr<API::Progress> m_progress;
107};
108
109} // namespace Algorithms
110} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
Definition: SpectrumInfo.h:53
Corrects the input workspace for helium3 tube efficiency based on an exponential parameterization.
const std::string summary() const override
Summary of algorithms purpose.
std::map< const Geometry::IObject *, std::pair< double, Kernel::V3D > > m_shapeCache
A lookup of previously seen shape objects used to save calculation time as most detectors have the sa...
Kernel::V3D m_samplePos
Sample position.
const Geometry::ParameterMap * m_paraMap
Map that stores additional properties for detectors.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
API::MatrixWorkspace_const_sptr m_inputWS
The user selected (input) workspace.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
std::vector< specnum_t > m_spectraSkipped
The spectra numbers that were skipped.
int version() const override
Algorithm's version for identification overriding a virtual method.
API::MatrixWorkspace_sptr m_outputWS
The output workspace, maybe the same as the input one.
std::unique_ptr< API::Progress > m_progress
Algorithm progress keeper.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Interface class for detector objects.
Definition: IDetector.h:43
IObject : Interface for geometry objects.
Definition: IObject.h:41
Class for 3D vectors.
Definition: V3D.h:34
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.