29 "The input workspace, which must contain all the spectra from the bank "
30 "of interest - no more and no less (so 128x128 or 192x192).");
32 "The name of the workspace in which to store the result.");
37 "Whether to sum rows (D_H) or columns (D_V).");
44 auto mustBePositive = std::make_shared<BoundedValidator<int>>();
45 mustBePositive->setLower(0);
47 "The first row to include in the summation when summing by "
48 "columns, or vice versa.");
50 "The last row to include in the summation when summing by "
51 "columns, or vice versa.");
58 const size_t numSpec = integratedWS->getNumberHistograms();
60 if (numSpec != 16384 && numSpec != 36864) {
61 g_log.
warning() <<
"The input workspace has " << numSpec <<
" spectra."
62 <<
"This is not 128*128 or 192*192 - did you make a mistake?\n";
66 const auto dim =
static_cast<int>(std::sqrt(
static_cast<double>(numSpec)));
73 if (
isEmpty(end) || end > dim - 1)
76 g_log.
error(
"H/V_Min must be less than H/V_Max");
77 throw std::out_of_range(
"H/V_Min must be less than H/V_Max");
85 auto &
X = outputWS->mutableX(0);
86 auto &
Y = outputWS->mutableY(0);
90 const bool horizontal = (
orientation ==
"D_H" ? 1 : 0);
93 for (
int i = 0; i < dim; ++i) {
98 for (
int j = start; j <= end; ++j) {
99 const int index = (horizontal ? (i + j * dim) : (i * dim + j));
100 Y[i] += integratedWS->y(
index)[0];
111 g_log.
debug() <<
"Integrating input workspace\n";
117 childAlg->setProperty<
double>(
"RangeLower",
getProperty(
"XMin"));
118 childAlg->setProperty<
double>(
"RangeUpper",
getProperty(
"XMax"));
119 childAlg->executeAsChildAlg();
120 return childAlg->getProperty(
"OutputWorkspace");
#define DECLARE_ALGORITHM(classname)
std::map< DeltaEMode::Type, std::string > index
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.
virtual std::shared_ptr< Algorithm > createChildAlgorithm(const std::string &name, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true, const int &version=-1)
Create a Child Algorithm.
void progress(double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
Sends ProgressNotification.
static bool isEmpty(const NumT toCheck)
checks that the value was not set by users, uses the value in empty double/int.
Helper class for reporting progress from algorithms.
A property class for workspaces.
API::MatrixWorkspace_sptr integrateWorkspace()
Call Integration as a Child Algorithm.
void init() override
Initialisation code.
void exec() override
Execution code.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void debug(const std::string &msg)
Logs at debug level.
void error(const std::string &msg)
Logs at error level.
void warning(const std::string &msg)
Logs at warning level.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
MANTID_GEOMETRY_DLL PolygonEdge::Orientation orientation(const PolygonEdge &focusEdge, const PolygonEdge &refEdge, double &t)
Calculate the orientation type of one edge wrt to another.
constexpr int EMPTY_INT() noexcept
Returns what we consider an "empty" integer within a property.
constexpr double EMPTY_DBL() noexcept
Returns what we consider an "empty" double within a property.
@ Input
An input workspace.
@ Output
An output workspace.