36 "Workspace of Peaks with UB loaded");
40 "Workspace with the Results");
48 throw std::invalid_argument(
" Invalid peaks workspace ");
51 if (Peaks->getNumberPeaks() < 1) {
52 g_log.
error(
"The peaks workspace has NO peaks");
53 throw std::invalid_argument(
"The peaks workspace has NO peaks");
56 if (!Peaks->sample().hasOrientedLattice()) {
57 g_log.
error(
"The peaks workspace does not have an oriented lattice");
58 throw std::invalid_argument(
"The peaks workspace does not have an oriented lattice");
66 Res->setTitle(
"HKL int offsets for " + Peaks->getName());
68 Res->addColumn(
"double",
"H offset from int");
69 Res->addColumn(
"double",
"K offset from int");
70 Res->addColumn(
"double",
"L offset from int");
71 Res->addColumn(
"double",
"Max offset from int");
73 Res->addColumn(
"int",
"bank");
74 Res->addColumn(
"int",
"RunNumber");
76 for (
int i = 0; i < Peaks->getNumberPeaks(); i++) {
78 Peak peak = Peaks->getPeak(i);
81 for (
int j = 0; j < 3; j++) {
82 double offset = hkl[j] - floor(hkl[j]);
85 Res->Double(i, j) = offset;
89 Res->Double(i, 3) = maxOffset;
92 size_t k = bankName.find_last_not_of(
"0123456789");
94 if (k < bankName.length())
95 bank = boost::lexical_cast<int>(bankName.substr(k + 1));
96 Res->Int(i, 4) = bank;
#define DECLARE_ALGORITHM(classname)
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
ITableWorkspace is an implementation of Workspace in which the data are organised in columns of same ...
A property class for workspaces.
void exec() override
Virtual method - must be overridden by concrete algorithm.
int getRunNumber() const override
Return the run number this peak was measured at.
Structure describing a single-crystal peak.
std::string getBankName() const
Find the name of the bank that is the parent of the detector.
Mantid::Kernel::V3D getQSampleFrame() const override
Return the Q change (of the lattice, k_i - k_f) for this peak.
The class PeaksWorkspace stores information about a set of SCD peaks.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void error(const std::string &msg)
Logs at error level.
T Invert()
LU inversion routine.
Manage the lifetime of a class intended to be a singleton.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< TableWorkspace > TableWorkspace_sptr
shared pointer to Mantid::DataObjects::TableWorkspace
std::shared_ptr< PeaksWorkspace > PeaksWorkspace_sptr
Typedef for a shared pointer to a peaks workspace.
Describes the direction (within an algorithm) of a Property.
@ Input
An input workspace.
@ Output
An output workspace.