17using namespace Kernel;
32 "InputWorkspace",
"",
Direction::Input, std::make_shared<WorkspaceUnitValidator>(
"TOF")),
33 "The input workspace. Must hold 'raw' (unweighted) events.");
37 "The output table workspace.");
41 "A workspace holding pixels to be masked.");
45 "The maximum value of X for which an "
46 "event will be counted. Must be greater "
51 "The units in which XMin and XMax is being given.");
84 if (monitorWorkspace) {
87 sumEvents->setProperty(
"LogName",
"scan_index");
88 sumEvents->executeAsChildAlg();
90 Workspace_sptr outputWS = sumEvents->getProperty(
"OutputWorkspace");
91 auto table = std::dynamic_pointer_cast<ITableWorkspace>(outputWS);
94 if (table->rowCount() > 1 && table->Int(0, 0) == 0) {
109 return std::dynamic_pointer_cast<DataObjects::EventWorkspace>(inputWS->monitorWorkspace());
114 clone->setProperty(
"InputWorkspace", inputWS);
115 clone->executeAsChildAlg();
118 return std::static_pointer_cast<DataObjects::EventWorkspace>(temp);
129 maskingAlg->executeAsChildAlg();
141 if (rangeUnit !=
"TOF") {
145 convertUnits->setProperty(
"Target", rangeUnit);
147 convertUnits->executeAsChildAlg();
153 filter->setProperty(
"XMin", xmin);
154 filter->setProperty(
"XMax", xmax);
155 filter->executeAsChildAlg();
#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.
static bool isEmpty(const NumT toCheck)
checks that the value was not set by users, uses the value in empty double/int.
A property class for workspaces.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
void exec() override
Virtual method - must be overridden by concrete algorithm.
DataObjects::EventWorkspace_sptr cloneInputWorkspace(const API::Workspace_sptr &inputWS)
int version() const override
Algorithm's version for identification.
const std::string category() const override
Algorithm's category for identification.
const std::string name() const override
Algorithm's name for identification.
void init() override
Virtual method - must be overridden by concrete algorithm.
void runFilterByXValue(const API::MatrixWorkspace_sptr &inputWS, const double xmin, const double xmax)
Runs FilterByXValue as a child algorithm on the given workspace.
DataObjects::EventWorkspace_sptr getMonitorWorkspace(const API::MatrixWorkspace_sptr &inputWS)
Tries to get hold of the workspace that holds the monitor data inside the input workspace.
void runMaskDetectors(const API::MatrixWorkspace_sptr &inputWS, const API::MatrixWorkspace_sptr &maskWS)
Runs MaskDetectors as a child algorithm on the input workspace.
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
constexpr double EMPTY_DBL() noexcept
Returns what we consider an "empty" double within a property.
@ Input
An input workspace.
@ Output
An output workspace.