21using namespace Kernel;
22using namespace Geometry;
28 auto moreThanZero = std::make_shared<BoundedValidator<double>>();
29 moreThanZero->setLower(0.001);
30 declareProperty(
"ElementSize", 1.0, moreThanZero,
"The size of one side of an integration element cube in mm");
51 if (
m_inputWS->run().hasProperty(
"GaugeVolume")) {
57 if (raster.l1.size() == 0)
58 throw std::runtime_error(
"Failed to rasterize shape");
61 m_L1s = std::move(raster.l1);
67 g_log.
information(
"Calculating scattering within the gauge volume defined on "
68 "the input workspace");
71 std::shared_ptr<const Geometry::IObject> volume =
#define DECLARE_ALGORITHM(classname)
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
A base class for absorption correction algorithms.
std::vector< double > m_elementVolumes
Cached element volumes.
Kernel::V3D m_beamDirection
The direction of the beam.
double m_sampleVolume
The total volume of the sample.
API::MatrixWorkspace_sptr m_inputWS
A pointer to the input workspace.
const Geometry::IObject * m_sampleObject
Local cache of sample object.
size_t m_numVolumeElements
The number of volume elements.
std::vector< Kernel::V3D > m_elementPositions
Cached element positions.
std::vector< double > m_L1s
Cached L1 distances.
std::string sampleXML() override
Returns the XML string describing the sample, which can be used by the ShapeFactory.
void defineProperties() override
A virtual function in which additional properties of an algorithm should be declared.
void retrieveProperties() override
Fetch the properties and set the appropriate member variables.
std::shared_ptr< const Geometry::IObject > constructGaugeVolume()
Create the gague volume for the correction.
double m_cubeSide
The length of the side of an element cube in m.
void initialiseCachedDistances() override
Calculate the distances for L1 and element size for each element in the sample.
AnyShapeAbsorption()
(Empty) Constructor
virtual IObject * clone() const =0
Class originally intended to be used with the DataHandling 'LoadInstrument' algorithm.
std::shared_ptr< CSGObject > createShape(Poco::XML::Element *pElem)
Creates a geometric object from a DOM-element-node pointing to an element whose child nodes contain t...
void information(const std::string &msg)
Logs at information level.
MANTID_GEOMETRY_DLL Raster calculate(const Kernel::V3D &beamDirection, const IObject &shape, const double cubeSizeInMetre)