-
Notifications
You must be signed in to change notification settings - Fork 122
/
CuboidGaugeVolumeAbsorption.cpp
43 lines (37 loc) · 1.63 KB
/
CuboidGaugeVolumeAbsorption.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAlgorithms/CuboidGaugeVolumeAbsorption.h"
namespace Mantid {
namespace Algorithms {
// Register the algorithm into the AlgorithmFactory
DECLARE_ALGORITHM(CuboidGaugeVolumeAbsorption)
using namespace Kernel;
using namespace Geometry;
using namespace API;
std::string CuboidGaugeVolumeAbsorption::sampleXML() {
// Returning an empty string signals to the base class that it should
// use the object already attached to the sample.
return std::string();
}
void CuboidGaugeVolumeAbsorption::initialiseCachedDistances() {
// Just call the superclass method within a try-catch to fail the algorithm
// gracefully
// if the sample object does not fully enclose the gauge volume requested
try {
FlatPlateAbsorption::initialiseCachedDistances();
} catch (Exception::InstrumentDefinitionError &) {
// Create and throw a new exception with a more specific message
throw Exception::InstrumentDefinitionError("This algorithm requires that "
"the sample fully encloses the "
"requested gauge volume.");
}
}
} // namespace Algorithms
} // namespace Mantid