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"
15#include "MantidKernel/V3D.h"
16
17namespace Mantid {
18
19namespace API {
20class Sample;
21}
22namespace Geometry {
23class IDetector;
24class IObject;
25} // namespace Geometry
26
27namespace Algorithms {
34class MANTID_ALGORITHMS_DLL PaalmanPingsAbsorptionCorrection final : public API::Algorithm {
35public:
39 const std::string name() const override { return "PaalmanPingsAbsorptionCorrection"; }
41 const std::string category() const override { return "CorrectionFunctions\\AbsorptionCorrections"; }
43 const std::string summary() const override {
44 return "Calculates the attenuation due to absorption "
45 "and single scattering in a generic sample shape for all "
46 "Paalmin-pings terms.";
47 }
48
49 const std::vector<std::string> seeAlso() const override {
50 return {"SetSampleMaterial", "AbsorptionCorrection", "ApplyPaalmanPingsCorrection",
51 "PaalmanPingsMonteCarloAbsorption"};
52 }
53
55 int version() const override { return (1); }
56
57private:
59 void init() override;
60 std::map<std::string, std::string> validateInputs() override;
62 void exec() override;
63
64 void retrieveBaseProperties();
65 void constructSample(API::Sample &sample);
66 void calculateDistances(const Geometry::IDetector &detector, std::vector<double> &sample_L2s,
67 std::vector<double> &sample_container_L2s, std::vector<double> &container_L2s,
68 std::vector<double> &container_sample_L2s) const;
69 void doIntegration(double &integral, double &crossIntegral, const double linearCoefAbs,
70 const double linearCoefTotScatt, const std::vector<double> &elementVolumes,
71 const std::vector<double> &L1s, const std::vector<double> &L2s, const double linearCoefAbs2,
72 const double linearCoefTotScatt2, const std::vector<double> &L1s2, const std::vector<double> &L2s2,
73 const size_t startIndex, const size_t endIndex) const;
76 void initialiseCachedDistances();
77 Geometry::Raster rasterize(const Geometry::IObject *object);
78
83 std::vector<double> m_sampleL1s,
87 std::vector<Kernel::V3D> m_sampleElementPositions;
90 std::vector<double> m_containerL1s,
94 std::vector<Kernel::V3D> m_containerElementPositions;
103 int64_t m_num_lambda;
105 int64_t m_xStep;
106
108 std::shared_ptr<const Geometry::IObject> constructGaugeVolume();
111};
112
113} // namespace Algorithms
114} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
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:42
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.
Holds the information used for doing numerical integrations of object in the beam.
Definition Rasterize.h:21