Mantid
Loading...
Searching...
No Matches
SphericalAbsorption.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 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
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/Algorithm.h"
13#include "MantidAlgorithms/DllConfig.h"
15
16namespace Mantid {
17
18// forward declaration from other Mantid modules
19namespace API {
20class Sample;
21}
22
23namespace Kernel {
24class V3D;
25}
26
27namespace Geometry {
28class IObject;
29}
30
31namespace Algorithms {
66class MANTID_ALGORITHMS_DLL SphericalAbsorption final : public API::Algorithm {
67public:
71 const std::string category() const override { return "CorrectionFunctions\\AbsorptionCorrections"; }
73 const std::string name() const override { return "SphericalAbsorption"; }
75 const std::string summary() const override {
76 return "Calculates bin-by-bin or event correction factors for attenuation "
77 "due to absorption and scattering in a 'spherical' sample.";
78 }
79
81 int version() const override { return (1); }
82 const std::vector<std::string> seeAlso() const override { return {"AbsorptionCorrection"}; }
83
84protected:
88 std::vector<double> m_L1s,
90 std::vector<Kernel::V3D> m_elementPositions;
93
94private:
96 void init() override;
98 void exec() override;
99
100 void retrieveBaseProperties();
102 void calculateDistances(const Geometry::IDetector_const_sptr &detector, std::vector<double> &L2s) const;
103 inline double doIntegration(const double &lambda, const std::vector<double> &L2s) const;
104 inline double doIntegration(const double &lambda_i, const double &lambda_f, const std::vector<double> &L2s) const;
105
106 double m_refAtten;
108 int64_t n_lambda;
110 int64_t x_step;
111 int64_t m_emode;
114};
115
116} // namespace Algorithms
117} // namespace Mantid
const std::vector< double > * lambda
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
This class stores information about the sample used in particular run.
Definition: Sample.h:33
A spherical absorption correction algorithm.
double m_scattering
The scattering cross-section in 1/m.
API::MatrixWorkspace_sptr m_inputWS
A pointer to the input workspace.
void constructSample(API::Sample &sample)
const Geometry::IObject * m_sampleObject
Local cache of sample object.
double m_lambdaFixed
The wavelength corresponding to the fixed energy, if provided.
int64_t m_emode
The energy mode: 0 - elastic, 1 - direct, 2 - indirect.
Kernel::V3D m_beamDirection
The direction of the beam.
std::vector< Kernel::V3D > m_elementPositions
Cached element positions.
double doIntegration(const double &lambda, const std::vector< double > &L2s) const
void calculateDistances(const Geometry::IDetector_const_sptr &detector, std::vector< double > &L2s) const
std::vector< double > m_L1s
Cached L1 distances.
int version() const override
Algorithm's version.
int64_t n_lambda
The number of points in wavelength, the rest is.
const std::string category() const override
Algorithm's category for identification.
std::vector< double > m_elementVolumes
Cached element volumes.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
size_t m_numVolumeElements
The number of volume elements.
double doIntegration(const double &lambda_i, const double &lambda_f, const std::vector< double > &L2s) const
const std::string summary() const override
Summary of algorithms purpose.
double m_refAtten
The attenuation cross-section in 1/m at 1.8A.
const std::string name() const override
Algorithm's name.
double m_sampleVolume
The total volume of the sample.
IObject : Interface for geometry objects.
Definition: IObject.h:41
Class for 3D vectors.
Definition: V3D.h:34
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< const Mantid::Geometry::IDetector > IDetector_const_sptr
Shared pointer to IDetector (const version)
Definition: IDetector.h:102
Helper class which provides the Collimation Length for SANS instruments.