34#include <Poco/DateTime.h>
35#include <Poco/DateTimeFormat.h>
36#include <Poco/DateTimeFormatter.h>
37#include <Poco/DateTimeParser.h>
38#include <Poco/DirectoryIterator.h>
41#include <boost/date_time/posix_time/posix_time.hpp>
42#include <boost/exception/diagnostic_information.hpp>
43#include <boost/exception_ptr.hpp>
44#include <boost/regex.hpp>
54void eraseSubStr(std::string &str,
const std::string &toErase) {
56 size_t pos = str.find(toErase);
57 if (pos != std::string::npos) {
59 str.erase(pos, toErase.length());
63std::string parseTime(std::string &str) {
65 eraseSubStr(str,
"#");
66 eraseSubStr(str,
"start");
67 eraseSubStr(str,
"stopped");
68 eraseSubStr(str,
"at");
70 std::find_if(str.begin(), str.end(), [](
char ch) { return !std::isspace<char>(ch, std::locale::classic()); });
71 str.erase(str.begin(), it);
72 using namespace boost::posix_time;
75 auto time = time_from_string(str);
76 return to_iso_extended_string(time);
77 }
catch (std::exception &) {
80 bool ok = Poco::DateTimeParser::tryParse(str, dt, tzd);
82 auto time = Poco::DateTimeFormatter::format(dt,
"%Y-%m-%dT%H:%M:%S");
85 std::string result(
"");
126 std::vector<std::string> exts(1,
".d_dat");
127 declareProperty(std::make_unique<MultipleFileProperty>(
"Filenames", exts),
128 "Select one or more DNS SCD .d_dat files to load."
129 "Files must be measured at the same conditions.");
132 "An output MDEventWorkspace.");
136 "An output normalization MDEventWorkspace.");
138 const std::vector<std::string> normOptions = {
"monitor",
"time"};
139 declareProperty(
"Normalization",
"monitor", std::make_shared<StringListValidator>(normOptions),
140 "Algorithm will create a separate normalization workspace. "
141 "Choose whether it should contain monitor counts or time.");
143 const std::vector<std::string> wsOptions = {
"raw",
"HKL"};
144 declareProperty(
"LoadAs",
"HKL", std::make_shared<StringListValidator>(wsOptions),
145 "Choose whether the algorithm should load raw data"
146 "or convert to H,K,L,dE space");
148 auto mustBePositive = std::make_shared<BoundedValidator<double>>();
149 mustBePositive->setLower(0.0);
150 auto reasonableAngle = std::make_shared<BoundedValidator<double>>();
151 reasonableAngle->setLower(5.0);
152 reasonableAngle->setUpper(175.0);
153 auto mustBe3D = std::make_shared<ArrayLengthValidator<double>>(3);
154 auto mustBe2D = std::make_shared<ArrayLengthValidator<double>>(2);
155 std::vector<double> u0(3, 0), v0(3, 0);
161 "Lattice parameter a in Angstrom");
163 "Lattice parameter b in Angstrom");
165 "Lattice parameter c in Angstrom");
168 "Angle between b and c in degrees");
170 "Angle between a and c in degrees");
173 "Angle between a and b in degrees");
177 "Angle in degrees between (HKL1) and the beam axis"
178 "if the goniometer is at zero.");
180 "Indices of the vector in reciprocal space in the horizontal plane at "
181 "angle Omegaoffset, "
182 "if the goniometer is at zero.");
185 "Indices of a second vector in reciprocal space in the horizontal plane "
186 "not parallel to HKL1");
188 std::vector<double> ttl(2, 0);
191 "Range (min, max) of scattering angles (2theta, in degrees) to consider. "
192 "Everything out of this range will be cut.");
196 "A table workspace to load a list of raw sample rotation angles. "
197 "Huber angles given in the data files will be ignored.");
201 "A workspace name to save a list of raw sample rotation angles.");
203 auto mustBeIntPositive = std::make_shared<BoundedValidator<int>>();
204 mustBeIntPositive->setLower(0);
207 "Elastic channel number. Only for TOF data.");
209 auto mustBeNegative = std::make_shared<BoundedValidator<double>>();
210 mustBeNegative->setUpper(0.0);
213 "Minimal energy transfer to consider. Should be <=0. Only for TOF data.");
227 std::vector<ExpData> old(
m_data);
228 for (
size_t i = 1; i < huber.
size(); ++i) {
229 for (
auto &ds : old) {
240 std::vector<double> huber;
241 huber.reserve(
m_data.size());
242 std::transform(
m_data.cbegin(),
m_data.cend(), std::back_inserter(huber), [](
const auto &ds) { return ds.huber; });
244 std::sort(huber.begin(), huber.end());
245 huber.erase(unique(huber.begin(), huber.end()), huber.end());
248 huberWS->addColumn(
"double",
"Huber(degrees)");
249 for (
size_t i = 0; i < huber.size(); i++) {
250 huberWS->appendRow();
251 huberWS->cell<
double>(i, 0) = huber[i];
260 if (!multiFileProp) {
261 throw std::logic_error(
"Filenames property must have MultipleFileProperty type.");
264 if (filenames.empty())
265 throw std::invalid_argument(
"Must specify at least one filename.");
268 std::string normtype =
getProperty(
"Normalization");
269 if (normtype ==
"monitor") {
280 API::Run &run = expinfo->mutableRun();
281 for (
const auto &fname : filenames) {
282 std::map<std::string, std::string> str_metadata;
283 std::map<std::string, double> num_metadata;
285 read_data(fname, str_metadata, num_metadata);
287 std::string time(str_metadata[
"stop_time"]);
289 g_log.
warning() <<
"stop_time is empty! File save time will be used instead." << std::endl;
290 time = str_metadata[
"file_save_time"];
292 updateProperties<std::string>(run, str_metadata, time);
293 updateProperties<double>(run, num_metadata, time);
296 g_log.
warning() <<
". This file will be ignored. " << std::endl;
297 g_log.
debug() << boost::current_exception_diagnostic_information() << std::endl;
302 throw std::runtime_error(
"No valid DNS files have been provided. Nothing to load.");
305 auto ch_n =
m_data.front().nchannels;
306 bool same_channel_number =
307 std::all_of(
m_data.cbegin(),
m_data.cend(), [ch_n](
const ExpData &
d) { return (d.nchannels == ch_n); });
308 if (!same_channel_number)
309 throw std::runtime_error(
"Error: cannot merge data with different TOF channel numbers.");
312 if (load_as ==
"raw")
316 m_OutWS->addExperimentInfo(expinfo);
321 g_log.
notice() <<
"Huber angles will be loaded from " << huberWS->getName() << std::endl;
328 double wavelength = wlprop->
minValue() * 10.0;
332 if (load_as ==
"raw") {
338 std::string saveHuberTableWS =
getProperty(
"SaveHuberTo");
339 if (!saveHuberTableWS.empty()) {
347 boost::split(columns, str, boost::is_any_of(
m_columnSep), boost::token_compress_on);
348 return static_cast<int>(columns.size());
355 auto it = metadata.begin();
356 while (it != metadata.end()) {
358 std::string
name(it->first);
361 boost::regex reg(
"([-_a-zA-Z]+)\\[(.*)]");
363 if (boost::regex_search(
name, match, reg) && match.size() > 2) {
364 std::string new_name(match.str(1));
365 units.assign(match.str(2));
371 throw std::invalid_argument(
"Log '" +
name +
"' already exists but the values are a different type.");
378 timeSeries->
addValue(time, it->second);
387 std::vector<std::string> vec_ID(4);
391 vec_ID[3] =
"DeltaE";
393 std::vector<std::string> dimensionNames(4);
394 dimensionNames[0] =
"H";
395 dimensionNames[1] =
"K";
396 dimensionNames[2] =
"L";
397 dimensionNames[3] =
"DeltaE";
401 double a, b, c, alpha, beta, gamma;
412 auto loadAlg = AlgorithmManager::Instance().create(
"LoadEmptyInstrument");
413 loadAlg->setChild(
true);
414 loadAlg->setLogging(
false);
415 loadAlg->initialize();
416 loadAlg->setProperty(
"InstrumentName",
"DNS");
417 loadAlg->setProperty(
"OutputWorkspace",
"__DNS_Inst");
420 const auto &instrument = instWS->getInstrument();
421 const auto &samplePosition = instrument->getSample()->getPos();
422 const auto &sourcePosition = instrument->getSource()->getPos();
423 const auto beamVector = samplePosition - sourcePosition;
424 const auto l1 = beamVector.norm();
427 auto tof1 = 1e+06 * l1 / velocity;
428 g_log.
debug() <<
"TOF1 = " << tof1 << std::endl;
435 double qmax = 4.0 * M_PI / wavelength;
436 std::vector<double> extentMins = {-qmax * a, -qmax * b, -qmax * c, dEmin};
437 std::vector<double> extentMaxs = {qmax * a, qmax * b, qmax * c, Ei};
445 for (
size_t i = 0; i <
m_nDims; ++i) {
446 std::string
id = vec_ID[i];
447 std::string
name = dimensionNames[i];
449 id,
name, frame,
static_cast<coord_t>(extentMins[i]),
static_cast<coord_t>(extentMaxs[i]), 5)));
453 m_OutWS->setCoordinateSystem(coordinateSystem);
461 omega_offset *= -1.0 *
deg2rad;
463 rotm[0][0] = std::cos(omega_offset);
465 rotm[0][2] = std::sin(omega_offset);
469 rotm[2][0] = -std::sin(omega_offset);
471 rotm[2][2] = std::cos(omega_offset);
482 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<4>, 4>>(
m_OutWS);
490 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<4>, 4>>(normWS);
494 std::vector<double> tth_limits =
getProperty(
"TwoThetaLimits");
495 double theta_min = tth_limits[0] *
deg2rad / 2.0;
496 double theta_max = tth_limits[1] *
deg2rad / 2.0;
503 uint16_t expInfoIndex = 0;
506 double ki = 2.0 * M_PI / ds.wavelength;
507 for (
size_t i = 0; i < ds.detID.size(); i++) {
508 const auto &detector = instWS->getDetector(i);
509 const auto &detectorPosition = detector->getPos();
510 const auto detectorVector = detectorPosition - samplePosition;
511 const auto l2 = detectorVector.norm();
512 auto tof2_elastic = 1e+06 *
l2 / velocity;
514 auto echannel_geom =
static_cast<int>(std::ceil(tof2_elastic / ds.chwidth));
516 int ch_diff = echannel_geom - echannel_user;
517 if ((echannel_user > 0) && (ch_diff < 0)) {
518 std::rotate(ds.signal[i].begin(), ds.signal[i].begin() - ch_diff, ds.signal[i].end());
519 }
else if ((echannel_user > 0) && (ch_diff > 0)) {
520 std::rotate(ds.signal[i].rbegin(), ds.signal[i].rbegin() + ch_diff, ds.signal[i].rend());
523 double theta = 0.5 * (ds.detID[i] * 5.0 - ds.deterota) *
deg2rad;
524 auto nchannels =
static_cast<int64_t
>(ds.signal[i].size());
525 if ((theta > theta_min) && (theta < theta_max)) {
527 for (int64_t channel = 0; channel < nchannels; channel++) {
529 double signal = ds.signal[i][channel];
531 double tof2 =
static_cast<double>(channel) * ds.chwidth + 0.5 * ds.chwidth;
534 double v2 = 1e+06 *
l2 / tof2;
540 double tlab = std::atan2(ki - kf * cos(2.0 * theta), kf * sin(2.0 * theta));
541 double omega = (ds.huber - ds.deterota) *
deg2rad - tlab;
542 V3D uphi(-cos(omega), 0, -sin(omega));
543 double qabs = 0.5 * std::sqrt(ki * ki + kf * kf - 2.0 * ki * kf * cos(2.0 * theta)) / M_PI;
544 V3D hphi = uphi * qabs;
545 V3D hkl = ub_inv * hphi;
546 std::vector<Mantid::coord_t> millerindex(4);
547 millerindex[0] =
static_cast<float>(hkl.
X());
548 millerindex[1] =
static_cast<float>(hkl.
Y());
549 millerindex[2] =
static_cast<float>(hkl.
Z());
550 millerindex[3] =
static_cast<float>(dE);
552 inserter.insertMDEvent(
static_cast<float>(signal),
static_cast<float>(
error *
error),
553 static_cast<uint16_t
>(expInfoIndex), 0, detid, millerindex.data());
555 norm_inserter.insertMDEvent(
static_cast<float>(norm_signal),
static_cast<float>(norm_error * norm_error),
556 static_cast<uint16_t
>(expInfoIndex), 0, detid, millerindex.data());
574 std::vector<std::string> vec_ID(3);
579 std::vector<std::string> dimensionNames(3);
580 dimensionNames[0] =
"Scattering Angle";
581 dimensionNames[1] =
"Omega";
582 dimensionNames[2] =
"TOF";
587 auto loadAlg = AlgorithmManager::Instance().create(
"LoadEmptyInstrument");
588 loadAlg->setChild(
true);
589 loadAlg->setLogging(
false);
590 loadAlg->initialize();
591 loadAlg->setProperty(
"InstrumentName",
"DNS");
592 loadAlg->setProperty(
"OutputWorkspace",
"__DNS_Inst");
595 const auto &instrument = instWS->getInstrument();
596 const auto &samplePosition = instrument->getSample()->getPos();
597 const auto &sourcePosition = instrument->getSource()->getPos();
598 const auto beamVector = samplePosition - sourcePosition;
599 const auto l1 = beamVector.norm();
602 auto tof1 = 1e+06 * l1 / velocity;
603 g_log.
debug() <<
"TOF1 = " << tof1 << std::endl;
610 std::vector<double> tth_limits =
getProperty(
"TwoThetaLimits");
611 double theta_min = tth_limits[0] / 2.0;
612 double theta_max = tth_limits[1] / 2.0;
614 std::vector<double> extentMins = {theta_min, 0.0, tof1};
615 std::vector<double> extentMaxs = {theta_max, 360.0,
m_tof_max};
625 for (
size_t i = 0; i < 3; ++i) {
626 std::string
id = vec_ID[i];
627 std::string
name = dimensionNames[i];
629 name,
id, frame,
static_cast<coord_t>(extentMins[i]),
static_cast<coord_t>(extentMaxs[i]), 5)));
633 m_OutWS->setCoordinateSystem(coordinateSystem);
637 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<3>, 3>>(
m_OutWS);
645 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<3>, 3>>(normWS);
653 uint16_t expInfoIndex = 0;
656 for (
size_t i = 0; i < ds.detID.size(); i++) {
657 const auto &detector = instWS->getDetector(i);
658 const auto &detectorPosition = detector->getPos();
659 const auto detectorVector = detectorPosition - samplePosition;
660 const auto l2 = detectorVector.norm();
661 auto tof2_elastic = 1e+06 *
l2 / velocity;
663 auto echannel_geom =
static_cast<int>(std::ceil(tof2_elastic / ds.chwidth));
665 int ch_diff = echannel_geom - echannel_user;
666 if ((echannel_user > 0) && (ch_diff < 0)) {
667 std::rotate(ds.signal[i].begin(), ds.signal[i].begin() - ch_diff, ds.signal[i].end());
668 }
else if ((echannel_user > 0) && (ch_diff > 0)) {
669 std::rotate(ds.signal[i].rbegin(), ds.signal[i].rbegin() + ch_diff, ds.signal[i].rend());
673 double theta = 0.5 * (ds.detID[i] * 5.0 - ds.deterota);
674 auto nchannels =
static_cast<int64_t
>(ds.signal[i].size());
675 if ((theta > theta_min) && (theta < theta_max)) {
677 for (int64_t channel = 0; channel < nchannels; channel++) {
679 double signal = ds.signal[i][channel];
681 double tof2(tof2_elastic);
683 tof2 =
static_cast<double>(channel) * ds.chwidth + 0.5 * ds.chwidth;
685 double omega = (ds.huber - ds.deterota);
687 std::vector<Mantid::coord_t> datapoint(3);
688 datapoint[0] =
static_cast<float>(theta);
689 datapoint[1] =
static_cast<float>(omega);
690 datapoint[2] =
static_cast<float>(tof1 + tof2);
692 inserter.insertMDEvent(
static_cast<float>(signal),
static_cast<float>(
error *
error),
693 static_cast<uint16_t
>(expInfoIndex), 0, detid, datapoint.data());
695 norm_inserter.insertMDEvent(
static_cast<float>(norm_signal),
static_cast<float>(norm_error * norm_error),
696 static_cast<uint16_t
>(expInfoIndex), 0, detid, datapoint.data());
708 std::map<std::string, double> &num_metadata) {
709 std::ifstream file(fname);
711 std::string::size_type
n;
713 boost::regex reg1(
"^#\\s+(\\w+):(.*)");
714 boost::regex reg2(
"^#\\s+((\\w+\\s)+)\\s+(-?\\d+(,\\d+)*(\\.\\d+(e\\d+)?)?)");
717 n = line.find(
"DNS");
718 if (
n == std::string::npos) {
719 throw std::invalid_argument(
"Not a DNS file");
722 Poco::File pfile(fname);
723 Poco::DateTime lastModified = pfile.getLastModified();
724 std::string wtime(Poco::DateTimeFormatter::format(lastModified,
"%Y-%m-%dT%H:%M:%S"));
725 str_metadata.insert(std::make_pair(
"file_save_time", wtime));
729 str_metadata.insert(std::make_pair(
"run_number", p.getBaseName()));
732 while (getline(file, line)) {
733 n = line.find(
"Lambda");
734 if (
n != std::string::npos) {
735 boost::regex re(
"[\\s]+");
737 boost::sregex_token_iterator it(s.begin(), s.end(), re, -1);
738 boost::sregex_token_iterator reg_end;
740 std::string s2 = line.substr(2);
741 boost::sregex_token_iterator it2(s2.begin(), s2.end(), re, -1);
742 for (; (it != reg_end) && (it2 != reg_end); ++it) {
743 std::string token(it->str());
744 if (token.find_first_not_of(
' ') == std::string::npos) {
748 if (token ==
"Mono") {
749 str_metadata.insert(std::make_pair(token, it2->str()));
751 num_metadata.insert(std::make_pair(token, std::stod(it2->str())));
757 n = line.find(
"start");
758 if (
n != std::string::npos) {
759 str_metadata.insert(std::make_pair(
"start_time", parseTime(line)));
761 str_metadata.insert(std::make_pair(
"stop_time", parseTime(line)));
764 if (boost::regex_search(line, match, reg1) && match.size() > 2) {
765 str_metadata.insert(std::make_pair(match.str(1), match.str(2)));
767 if (boost::regex_search(line, match, reg2) && match.size() > 2) {
769 s.erase(std::find_if_not(s.rbegin(), s.rend(), ::isspace).base(), s.end());
770 num_metadata.insert(std::make_pair(s, std::stod(match.str(3))));
772 n = line.find(
"DATA");
773 if (
n != std::string::npos) {
778 std::map<std::string, double>::const_iterator
m = num_metadata.lower_bound(
"TOF");
779 g_log.
debug() <<
"TOF Channels number: " <<
m->second << std::endl;
780 std::map<std::string, double>::const_iterator w = num_metadata.lower_bound(
"Time");
781 g_log.
debug() <<
"Channel width: " << w->second << std::endl;
784 ds.
deterota = num_metadata[
"DeteRota"];
785 ds.
huber = num_metadata[
"Huber"];
786 ds.
wavelength = 10.0 * num_metadata[
"Lambda[nm]"];
789 ds.
nchannels =
static_cast<size_t>(std::ceil(
m->second));
794 std::list<std::string> columns;
795 while (getline(file, line)) {
799 ds.
detID.emplace_back(std::stoi(columns.front()));
801 std::vector<double> signal;
802 std::transform(columns.begin(), columns.end(), std::back_inserter(signal),
803 [](
const std::string &s) { return std::stod(s); });
804 ds.
signal.emplace_back(signal);
#define PARALLEL_START_INTERRUPT_REGION
Begins a block to skip processing is the algorithm has been interupted Note the end of the block if n...
#define PARALLEL_CRITICAL(name)
#define PARALLEL_END_INTERRUPT_REGION
Ends a block to skip processing is the algorithm has been interupted Note the start of the block if n...
#define PARALLEL_FOR_IF(condition)
Empty definitions - to enable set your complier to enable openMP.
#define PARALLEL_CHECK_INTERRUPT_REGION
Adds a check after a Parallel region to see if it was interupted.
#define DECLARE_FILELOADER_ALGORITHM(classname)
DECLARE_FILELOADER_ALGORITHM should be used in place of the standard DECLARE_ALGORITHM macro when wri...
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
Kernel::Property * getPointerToProperty(const std::string &name) const override
Get a property by name.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
ColumnVector gives access to the column elements without alowing its resizing.
size_t size()
Size of the vector.
bool hasProperty(const std::string &name) const
Does the property exist on the object.
Kernel::Property * getLogData(const std::string &name) const
Access a single log entry.
Kernel::Property * getProperty(const std::string &name) const
Returns the named property as a pointer.
void addProperty(Kernel::Property *prop, bool overwrite=false)
Add data to the object in the form of a property.
A property to allow a user to specify multiple files to load.
This class stores information regarding an experimental run as a series of log entries.
A property class for workspaces.
static API::IMDEventWorkspace_sptr CreateMDWorkspace(size_t nd, const std::string &eventType="MDLeanEvent", const Mantid::API::MDNormalization &preferredNormalization=Mantid::API::MDNormalization::VolumeNormalization, const Mantid::API::MDNormalization &preferredNormalizationHisto=Mantid::API::MDNormalization::VolumeNormalization)
Create a MDEventWorkspace of the given type.
MDEventInserter : Helper class that provides a generic interface for adding events to an MDWorkspace ...
Templated class for the multi-dimensional event workspace.
GeneralFrame : Any MDFrame that isn't related to momemtum transfer.
Class to implement UB matrix.
void setUB(const Kernel::DblMatrix &newUB)
Sets the UB matrix and recalculates lattice parameters.
const Kernel::DblMatrix & setUFromVectors(const Kernel::V3D &u, const Kernel::V3D &v)
Set the U rotation matrix, to provide the transformation, which translate an arbitrary vector V expre...
const Kernel::DblMatrix & getUB() const
Get the UB matrix.
Support for a property that holds an array of values.
BoundedValidator is a validator that requires the values to be between upper or lower bounds,...
Defines a wrapper around an open file.
static bool isAscii(const std::string &filename, const size_t nbytes=256)
Returns true if the file is considered ascii.
const std::string & extension() const
Access the file extension.
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 notice(const std::string &msg)
Logs at notice level.
void warning(const std::string &msg)
Logs at warning level.
T Invert()
LU inversion routine.
The concrete, templated class for properties.
virtual void setUnits(const std::string &unit)
Sets the units of the property, as a string.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
A specialised Property class for holding a series of time-value pairs.
TYPE minValue() const
Returns the minimum value found in the series.
void addValue(const Types::Core::DateAndTime &time, const TYPE &value)
Add a value to the map using a DateAndTime object.
A base-class for the a class that is able to return unit labels in different representations.
static const UnitLabel RLU
Reciprocal lattice units.
constexpr double X() const noexcept
Get x.
constexpr double Y() const noexcept
Get y.
constexpr double Z() const noexcept
Get z.
LoadDNSSCD : Load a list of DNS .d_dat files into a MDEventWorkspace.
double m_normfactor
factor to multiply the error^2 for normalization
void exec() override
Run the algorithm.
size_t m_nDims
number of workspace dimensions
void loadHuber(const API::ITableWorkspace_sptr &tws)
Read Huber angles from a given table workspace.
std::string m_normtype
type of normalization;
void fillOutputWorkspaceRaw(double wavelength)
Fill output workspace with raw data theta, omega, tof space.
std::string m_columnSep
The column separator.
Mantid::API::IMDEventWorkspace_sptr m_OutWS
Output IMDEventWorkspace.
API::ITableWorkspace_sptr saveHuber()
Save Huber angles to a given table workspace.
void read_data(const std::string &fname, std::map< std::string, std::string > &str_metadata, std::map< std::string, double > &num_metadata)
void updateProperties(API::Run &run, std::map< std::string, T > &metadata, std::string time)
int splitIntoColumns(std::list< std::string > &columns, std::string &str)
void fillOutputWorkspace(double wavelength)
Fill output workspace with data converted to H, K, L, dE space.
void init() override
Initialise the properties.
std::vector< ExpData > m_data
int confidence(Kernel::FileDescriptor &descriptor) const override
Returns a confidence value that this algorithm can load a file.
const std::string name() const override
Algorithm's name for identification.
double m_tof_max
maximal TOF (for extends)
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< ExperimentInfo > ExperimentInfo_sptr
Shared pointer to ExperimentInfo.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
constexpr double deg2rad
Defines units/enum for Crystal work.
std::shared_ptr< MDHistoDimension > MDHistoDimension_sptr
Shared pointer to a MDHistoDimension.
std::vector< T > flattenVector(const std::vector< std::vector< T > > &v)
A convenience function to "flatten" the given vector of vectors into a single vector.
SpecialCoordinateSystem
Special coordinate systems for Q3D.
MDUnitFactory_uptr MANTID_KERNEL_DLL makeMDUnitFactoryChain()
Convience method. Pre-constructed builder chain.
std::enable_if< std::is_pointer< Arg >::value, bool >::type threadSafe(Arg workspace)
Thread-safety check Checks the workspace to ensure it is suitable for multithreaded access.
static constexpr double NeutronMass
Mass of the neutron in kg.
static constexpr double h
Planck constant in J*s.
static constexpr double meV
1 meV in Joules.
static constexpr double h_bar
Planck constant in J*s, divided by 2 PI.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...
int32_t detid_t
Typedef for a detector ID.
double signal_t
Typedef for the signal recorded in a MDBox, etc.
@ Input
An input workspace.
@ Output
An output workspace.
structure for experimental data
std::vector< std::vector< double > > signal