21using namespace Kernel;
28 auto wsValidator = std::make_shared<CompositeValidator>();
33 "The name of the input workspace.");
35 "The name with which to store the output workspace in the [[Analysis "
40 auto mustBePositive = std::make_shared<BoundedValidator<int>>();
41 mustBePositive->setLower(0);
43 "The lowest workspace index of the specta that will be integrated");
48 "The highest workspace index of the spectra that will be integrated");
50 "If true then partial bins from the beginning and end of the "
51 "input range are also included in the integration.");
52 declareProperty(
"IncludeMonitors",
true,
"Whether to include monitor spectra in the sum (default: yes)");
65 const bool keepMonitors =
getProperty(
"IncludeMonitors");
66 const bool incPartBins =
getProperty(
"IncludePartialBins");
76 integrateAlg->setProperty<
double>(
"RangeLower", m_MinRange);
77 integrateAlg->setProperty<
double>(
"RangeUpper", m_MaxRange);
78 integrateAlg->setProperty<
int>(
"StartWorkspaceIndex", m_MinSpec);
79 integrateAlg->setProperty<
int>(
"EndWorkspaceIndex", m_MaxSpec);
80 integrateAlg->setProperty<
bool>(
"IncludePartialBins", incPartBins);
81 integrateAlg->executeAsChildAlg();
82 progress.report(
"Normalising to unity");
89 sumAlg->setProperty<
bool>(
"IncludeMonitors", keepMonitors);
90 sumAlg->executeAsChildAlg();
91 progress.report(
"Normalising to unity");
97 progress.report(
"Normalising to unity");
#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.
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.
A validator which provides a TENTATIVE check that a workspace contains common bins in each spectrum.
A validator which checks that a workspace contains histogram data (the default) or point data as requ...
Helper class for reporting progress from algorithms.
A property class for workspaces.
void init() override
Initialisation method.
void exec() override
Executes the algorithm.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
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.