Mantid
Loading...
Searching...
No Matches
CuboidGaugeVolumeAbsorption.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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//----------------------------------------------------------------------
8// Includes
9//----------------------------------------------------------------------
11
12namespace Mantid::Algorithms {
13
14// Register the algorithm into the AlgorithmFactory
15DECLARE_ALGORITHM(CuboidGaugeVolumeAbsorption)
16
17using namespace Kernel;
18using namespace Geometry;
19using namespace API;
20
22 // Returning an empty string signals to the base class that it should
23 // use the object already attached to the sample.
24 return std::string();
25}
26
28 // Just call the superclass method within a try-catch to fail the algorithm
29 // gracefully
30 // if the sample object does not fully enclose the gauge volume requested
31 try {
34 // Create and throw a new exception with a more specific message
35 throw Exception::InstrumentDefinitionError("This algorithm requires that "
36 "the sample fully encloses the "
37 "requested gauge volume.");
38 }
39}
40
41} // namespace Mantid::Algorithms
#define DECLARE_ALGORITHM(classname)
Definition: Algorithm.h:576
void initialiseCachedDistances() override
Calculate the distances for L1 and element size for each element in the sample.
std::string sampleXML() override
Returns the XML string describing the sample, which can be used by the ShapeFactory.
void initialiseCachedDistances() override
Calculate the distances for L1 and element size for each element in the sample.
Exception for errors associated with the instrument definition.
Definition: Exception.h:220