Mantid
Loading...
Searching...
No Matches
DetectorEfficiencyCor.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"
14#include "MantidKernel/V3D.h"
15
16#include <list>
17
18namespace Mantid {
19namespace Algorithms {
70class MANTID_ALGORITHMS_DLL DetectorEfficiencyCor final : public API::Algorithm {
71public:
74 const std::string name() const override { return "DetectorEfficiencyCor"; }
76 const std::string summary() const override {
77 return "This algorithm adjusts the binned data in a workspace for detector "
78 "efficiency, calculated from the neutrons' kinetic energy, the gas "
79 "filled detector's geometry and gas pressure. The data are then "
80 "multiplied by :math:`k_i/k_f`";
81 }
82
84 int version() const override { return 1; }
85 const std::vector<std::string> seeAlso() const override { return {"He3TubeEfficiency", "DetectorEfficiencyCorUser"}; }
87 const std::string category() const override {
88 return "CorrectionFunctions\\EfficiencyCorrections;Inelastic\\Corrections";
89 }
90
91private:
93 void retrieveProperties();
95 void correctForEfficiency(int64_t spectraIn, const API::SpectrumInfo &spectrumInfo);
97 double calculateOneOverK(double loBinBound, double uppBinBound) const;
99 void getDetectorGeometry(const Geometry::IDetector &det, double &detRadius, Kernel::V3D &detAxis);
101 double distToSurface(const Kernel::V3D &start, const Geometry::IObject *shape) const;
103 double detectorEfficiency(const double alpha) const;
105 double chebevApprox(double a, double b, const double exspansionCoefs[], double x) const;
107 void logErrors(size_t totalNDetectors) const;
108
109private:
116
118 double m_Ei;
120 double m_ki;
121
124 std::map<const Geometry::IObject *, std::pair<double, Kernel::V3D>> m_shapeCache;
128 std::list<int64_t> m_spectraSkipped;
129
130 // Implement abstract Algorithm methods
131 void init() override;
132 void exec() override;
133};
134
135} // namespace Algorithms
136} // 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
Returns efficiency of cylindrical helium gas tube.
double m_ki
stores the wave number of incidient neutrons, calculated from the energy
std::list< int64_t > m_spectraSkipped
The spectra numbers that were skipped.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
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...
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 workspace
int version() const override
Algorithm's version for identification overriding a virtual method.
API::MatrixWorkspace_sptr m_outputWS
output workspace, maybe the same as the input one
double m_Ei
stores the user selected value for incidient energy of the neutrons
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
const std::string summary() const override
Summary of algorithms purpose.
const Geometry::ParameterMap * m_paraMap
points the map that stores additional properties for detectors in that map
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.