Mantid
Loading...
Searching...
No Matches
PaalmanPingsAbsorptionCorrection.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2020 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
16namespace Mantid {
17
18namespace API {
19class Sample;
20}
21namespace Geometry {
22class IDetector;
23class IObject;
24} // namespace Geometry
25
26namespace Algorithms {
33class MANTID_ALGORITHMS_DLL PaalmanPingsAbsorptionCorrection final : public API::Algorithm {
34public:
38 const std::string name() const override { return "PaalmanPingsAbsorptionCorrection"; }
40 const std::string category() const override { return "CorrectionFunctions\\AbsorptionCorrections"; }
42 const std::string summary() const override {
43 return "Calculates the attenuation due to absorption "
44 "and single scattering in a generic sample shape for all "
45 "Paalmin-pings terms.";
46 }
47
48 const std::vector<std::string> seeAlso() const override {
49 return {"SetSampleMaterial", "AbsorptionCorrection", "ApplyPaalmanPingsCorrection",
50 "PaalmanPingsMonteCarloAbsorption"};
51 }
52
54 int version() const override { return (1); }
55
56private:
58 void init() override;
59 std::map<std::string, std::string> validateInputs() override;
61 void exec() override;
62
63 void retrieveBaseProperties();
64 void constructSample(API::Sample &sample);
65 void calculateDistances(const Geometry::IDetector &detector, std::vector<double> &sample_L2s,
66 std::vector<double> &sample_container_L2s, std::vector<double> &container_L2s,
67 std::vector<double> &container_sample_L2s) const;
68 void doIntegration(double &integral, double &crossIntegral, const double linearCoefAbs,
69 const double linearCoefTotScatt, const std::vector<double> &elementVolumes,
70 const std::vector<double> &L1s, const std::vector<double> &L2s, const double linearCoefAbs2,
71 const double linearCoefTotScatt2, const std::vector<double> &L1s2, const std::vector<double> &L2s2,
72 const size_t startIndex, const size_t endIndex) const;
75 void initialiseCachedDistances();
76
81 std::vector<double> m_sampleL1s,
85 std::vector<Kernel::V3D> m_sampleElementPositions;
88 std::vector<double> m_containerL1s,
92 std::vector<Kernel::V3D> m_containerElementPositions;
101 int64_t m_num_lambda;
103 int64_t m_xStep;
104
106 std::shared_ptr<const Geometry::IObject> constructGaugeVolume();
109};
110
111} // namespace Algorithms
112} // namespace Mantid
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
PaalmanPingsAbsorptionCorrection : calculate paalman-pings absorption terms.
API::MatrixWorkspace_sptr m_inputWS
A pointer to the input workspace.
std::vector< double > m_sampleL1s
Cached sample L1 distances.
double m_containerLinearCoefTotScatt
The total scattering cross-section in 1/m for the container.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
std::vector< double > m_containerL1s
Cached container L1 distances.
size_t m_numContainerVolumeElements
The number of container volume elements.
std::vector< double > m_sample_containerL1s
Cached L1 distances through container hitting sample.
std::vector< Kernel::V3D > m_sampleElementPositions
Cached sample element positions.
const Geometry::IObject * m_sampleObject
Local cache of sample object.
int64_t m_num_lambda
The number of points in wavelength, the rest is.
size_t m_numSampleVolumeElements
The number of sample volume elements.
const Geometry::IObject * m_containerObject
Local cache of container object.
std::vector< Kernel::V3D > m_containerElementPositions
Cached container element positions.
double m_cubeSideContainer
The length of the side of an element cube in m.
double m_cubeSideSample
The length of the side of an element cube in m.
const std::string category() const override
Algorithm's category for identification.
std::vector< double > m_containerElementVolumes
Cached container element volumes.
const std::string summary() const override
Algorithm's summary.
std::vector< double > m_container_sampleL1s
Cached L1 distances through sample hitting container.
double m_ampleLinearCoefTotScatt
The total scattering cross-section in 1/m for the sample.
std::vector< double > m_sampleElementVolumes
Cached sample element volumes.
const std::string name() const override
Algorithm's name.
Interface class for detector objects.
Definition: IDetector.h:43
IObject : Interface for geometry objects.
Definition: IObject.h:41
A material is defined as being composed of a given element, defined as a PhysicalConstants::NeutronAt...
Definition: Material.h:50
Class for 3D vectors.
Definition: V3D.h:34
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.