16using namespace Kernel;
18using namespace DataObjects;
25 "Name of the input workspace");
27 "Name of the output workspace");
28 auto isDouble = std::make_shared<BoundedValidator<double>>();
29 declareProperty(
"Offset", 0.0, isDouble,
"The amount to adjust the time bins. Usually in microseconds");
30 declareWorkspaceIndexSetProperties();
36 if (outputW != inputW) {
37 outputW = inputW->clone();
47 this->for_each<Indices::FromProperty>(
49 std::transform(dataX.begin(), dataX.end(), dataX.begin(), [offset](
double x) { return x + offset; });
#define DECLARE_ALGORITHM(classname)
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
A property class for workspaces.
Takes a workspace and adjusts all the time bin values by the same amount.
void exec() override
Executes the algorithm.
void addTof(const double offset) override
Add an offset to the TOF of each event in the list.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
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
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
static decltype(std::mem_fn((DataObjects::EventList &(DataObjects::EventWorkspace::*)(const std::size_t)) &DataObjects::EventWorkspace::getSpectrum)) eventList
static decltype(std::mem_fn((std::vector< double > &(API::MatrixWorkspace::*)(const std::size_t)) &API::MatrixWorkspace::dataX)) x
@ Input
An input workspace.
@ Output
An output workspace.