33#include <Poco/DateTime.h>
34#include <Poco/DateTimeFormat.h>
35#include <Poco/DateTimeFormatter.h>
36#include <Poco/DateTimeParser.h>
37#include <Poco/DirectoryIterator.h>
40#include <boost/date_time/posix_time/posix_time.hpp>
41#include <boost/exception/diagnostic_information.hpp>
42#include <boost/exception_ptr.hpp>
43#include <boost/regex.hpp>
53void eraseSubStr(std::string &str,
const std::string &toErase) {
55 size_t pos = str.find(toErase);
56 if (pos != std::string::npos) {
58 str.erase(pos, toErase.length());
62std::string parseTime(std::string &str) {
64 eraseSubStr(str,
"#");
65 eraseSubStr(str,
"start");
66 eraseSubStr(str,
"stopped");
67 eraseSubStr(str,
"at");
69 std::find_if(str.begin(), str.end(), [](
char ch) { return !std::isspace<char>(ch, std::locale::classic()); });
70 str.erase(str.begin(), it);
71 using namespace boost::posix_time;
74 auto time = time_from_string(str);
75 return to_iso_extended_string(time);
76 }
catch (std::exception &) {
79 bool ok = Poco::DateTimeParser::tryParse(str, dt, tzd);
81 auto time = Poco::DateTimeFormatter::format(dt,
"%Y-%m-%dT%H:%M:%S");
84 std::string result(
"");
125 std::vector<std::string> exts(1,
".d_dat");
126 declareProperty(std::make_unique<MultipleFileProperty>(
"Filenames", exts),
127 "Select one or more DNS SCD .d_dat files to load."
128 "Files must be measured at the same conditions.");
131 "An output MDEventWorkspace.");
135 "An output normalization MDEventWorkspace.");
137 const std::vector<std::string> normOptions = {
"monitor",
"time"};
138 declareProperty(
"Normalization",
"monitor", std::make_shared<StringListValidator>(normOptions),
139 "Algorithm will create a separate normalization workspace. "
140 "Choose whether it should contain monitor counts or time.");
142 const std::vector<std::string> wsOptions = {
"raw",
"HKL"};
143 declareProperty(
"LoadAs",
"HKL", std::make_shared<StringListValidator>(wsOptions),
144 "Choose whether the algorithm should load raw data"
145 "or convert to H,K,L,dE space");
147 auto mustBePositive = std::make_shared<BoundedValidator<double>>();
148 mustBePositive->setLower(0.0);
149 auto reasonableAngle = std::make_shared<BoundedValidator<double>>();
150 reasonableAngle->setLower(5.0);
151 reasonableAngle->setUpper(175.0);
153 auto mustBe3D = std::make_shared<ArrayLengthValidator<double> >(3);
154 auto mustBe2D = std::make_shared<ArrayLengthValidator<double> >(2);
156 std::vector<double> u0(3, 0), v0(3, 0);
162 "Lattice parameter a in Angstrom");
164 "Lattice parameter b in Angstrom");
166 "Lattice parameter c in Angstrom");
169 "Angle between b and c in degrees");
171 "Angle between a and c in degrees");
174 "Angle between a and b in degrees");
178 "Angle in degrees between (HKL1) and the beam axis"
179 "if the goniometer is at zero.");
181 "Indices of the vector in reciprocal space in the horizontal plane at "
182 "angle Omegaoffset, "
183 "if the goniometer is at zero.");
186 "Indices of a second vector in reciprocal space in the horizontal plane "
187 "not parallel to HKL1");
189 std::vector<double> ttl(2, 0);
192 "Range (min, max) of scattering angles (2theta, in degrees) to consider. "
193 "Everything out of this range will be cut.");
197 "A table workspace to load a list of raw sample rotation angles. "
198 "Huber angles given in the data files will be ignored.");
202 "A workspace name to save a list of raw sample rotation angles.");
204 auto mustBeIntPositive = std::make_shared<BoundedValidator<int>>();
205 mustBeIntPositive->setLower(0);
208 "Elastic channel number. Only for TOF data.");
210 auto mustBeNegative = std::make_shared<BoundedValidator<double>>();
211 mustBeNegative->setUpper(0.0);
214 "Minimal energy transfer to consider. Should be <=0. Only for TOF data.");
228 std::vector<ExpData> old(
m_data);
229 for (
size_t i = 1; i < huber.
size(); ++i) {
230 for (
auto &ds : old) {
241 std::vector<double> huber;
242 huber.reserve(
m_data.size());
243 std::transform(
m_data.cbegin(),
m_data.cend(), std::back_inserter(huber), [](
const auto &ds) { return ds.huber; });
245 std::sort(huber.begin(), huber.end());
246 huber.erase(unique(huber.begin(), huber.end()), huber.end());
249 huberWS->addColumn(
"double",
"Huber(degrees)");
250 for (
size_t i = 0; i < huber.size(); i++) {
251 huberWS->appendRow();
252 huberWS->cell<
double>(i, 0) = huber[i];
261 if (!multiFileProp) {
262 throw std::logic_error(
"Filenames property must have MultipleFileProperty type.");
265 if (filenames.empty())
266 throw std::invalid_argument(
"Must specify at least one filename.");
269 std::string normtype =
getProperty(
"Normalization");
270 if (normtype ==
"monitor") {
281 API::Run &run = expinfo->mutableRun();
282 for (
auto fname : filenames) {
283 std::map<std::string, std::string> str_metadata;
284 std::map<std::string, double> num_metadata;
286 read_data(fname, str_metadata, num_metadata);
288 std::string time(str_metadata[
"stop_time"]);
290 g_log.
warning() <<
"stop_time is empty! File save time will be used instead." << std::endl;
291 time = str_metadata[
"file_save_time"];
293 updateProperties<std::string>(run, str_metadata, time);
294 updateProperties<double>(run, num_metadata, time);
297 g_log.
warning() <<
". This file will be ignored. " << std::endl;
298 g_log.
debug() << boost::current_exception_diagnostic_information() << std::endl;
303 throw std::runtime_error(
"No valid DNS files have been provided. Nothing to load.");
306 auto ch_n =
m_data.front().nchannels;
307 bool same_channel_number =
308 std::all_of(
m_data.cbegin(),
m_data.cend(), [ch_n](
const ExpData &
d) { return (d.nchannels == ch_n); });
309 if (!same_channel_number)
310 throw std::runtime_error(
"Error: cannot merge data with different TOF channel numbers.");
313 if (load_as ==
"raw")
317 m_OutWS->addExperimentInfo(expinfo);
322 g_log.
notice() <<
"Huber angles will be loaded from " << huberWS->getName() << std::endl;
329 double wavelength = wlprop->
minValue() * 10.0;
333 if (load_as ==
"raw") {
339 std::string saveHuberTableWS =
getProperty(
"SaveHuberTo");
340 if (!saveHuberTableWS.empty()) {
348 boost::split(columns, str, boost::is_any_of(
m_columnSep), boost::token_compress_on);
349 return static_cast<int>(columns.size());
356 auto it = metadata.begin();
357 while (it != metadata.end()) {
359 std::string
name(it->first);
362 boost::regex reg(
"([-_a-zA-Z]+)\\[(.*)]");
364 if (boost::regex_search(
name, match, reg) && match.size() > 2) {
365 std::string new_name(match.str(1));
366 units.assign(match.str(2));
372 throw std::invalid_argument(
"Log '" +
name +
"' already exists but the values are a different type.");
379 timeSeries->
addValue(time, it->second);
388 std::vector<std::string> vec_ID(4);
392 vec_ID[3] =
"DeltaE";
394 std::vector<std::string> dimensionNames(4);
395 dimensionNames[0] =
"H";
396 dimensionNames[1] =
"K";
397 dimensionNames[2] =
"L";
398 dimensionNames[3] =
"DeltaE";
402 double a, b, c, alpha, beta, gamma;
414 loadAlg->setChild(
true);
415 loadAlg->setLogging(
false);
416 loadAlg->initialize();
417 loadAlg->setProperty(
"InstrumentName",
"DNS");
418 loadAlg->setProperty(
"OutputWorkspace",
"__DNS_Inst");
421 const auto &instrument = instWS->getInstrument();
422 const auto &samplePosition = instrument->getSample()->getPos();
423 const auto &sourcePosition = instrument->getSource()->getPos();
424 const auto beamVector = samplePosition - sourcePosition;
425 const auto l1 = beamVector.norm();
428 auto tof1 = 1e+06 * l1 / velocity;
429 g_log.
debug() <<
"TOF1 = " << tof1 << std::endl;
436 double qmax = 4.0 * M_PI / wavelength;
437 std::vector<double> extentMins = {-qmax * a, -qmax * b, -qmax * c, dEmin};
438 std::vector<double> extentMaxs = {qmax * a, qmax * b, qmax * c, Ei};
446 for (
size_t i = 0; i <
m_nDims; ++i) {
447 std::string
id = vec_ID[i];
448 std::string
name = dimensionNames[i];
450 id,
name, frame,
static_cast<coord_t>(extentMins[i]),
static_cast<coord_t>(extentMaxs[i]), 5)));
454 m_OutWS->setCoordinateSystem(coordinateSystem);
462 omega_offset *= -1.0 *
deg2rad;
464 rotm[0][0] = std::cos(omega_offset);
466 rotm[0][2] = std::sin(omega_offset);
470 rotm[2][0] = -std::sin(omega_offset);
472 rotm[2][2] = std::cos(omega_offset);
483 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<4>, 4>>(
m_OutWS);
491 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<4>, 4>>(normWS);
495 std::vector<double> tth_limits =
getProperty(
"TwoThetaLimits");
496 double theta_min = tth_limits[0] *
deg2rad / 2.0;
497 double theta_max = tth_limits[1] *
deg2rad / 2.0;
504 uint16_t expInfoIndex = 0;
507 double ki = 2.0 * M_PI / ds.wavelength;
508 for (
size_t i = 0; i < ds.detID.size(); i++) {
509 const auto &detector = instWS->getDetector(i);
510 const auto &detectorPosition = detector->getPos();
511 const auto detectorVector = detectorPosition - samplePosition;
512 const auto l2 = detectorVector.norm();
513 auto tof2_elastic = 1e+06 *
l2 / velocity;
515 auto echannel_geom =
static_cast<int>(std::ceil(tof2_elastic / ds.chwidth));
517 int ch_diff = echannel_geom - echannel_user;
518 if ((echannel_user > 0) && (ch_diff < 0)) {
519 std::rotate(ds.signal[i].begin(), ds.signal[i].begin() - ch_diff, ds.signal[i].end());
520 }
else if ((echannel_user > 0) && (ch_diff > 0)) {
521 std::rotate(ds.signal[i].rbegin(), ds.signal[i].rbegin() + ch_diff, ds.signal[i].rend());
524 double theta = 0.5 * (ds.detID[i] * 5.0 - ds.deterota) *
deg2rad;
525 auto nchannels =
static_cast<int64_t
>(ds.signal[i].size());
526 if ((theta > theta_min) && (theta < theta_max)) {
528 for (int64_t channel = 0; channel < nchannels; channel++) {
530 double signal = ds.signal[i][channel];
532 double tof2 =
static_cast<double>(channel) * ds.chwidth + 0.5 * ds.chwidth;
535 double v2 = 1e+06 *
l2 / tof2;
541 double tlab = std::atan2(ki - kf * cos(2.0 * theta), kf * sin(2.0 * theta));
542 double omega = (ds.huber - ds.deterota) *
deg2rad - tlab;
543 V3D uphi(-cos(omega), 0, -sin(omega));
544 double qabs = 0.5 * std::sqrt(ki * ki + kf * kf - 2.0 * ki * kf * cos(2.0 * theta)) / M_PI;
545 V3D hphi = uphi * qabs;
546 V3D hkl = ub_inv * hphi;
547 std::vector<Mantid::coord_t> millerindex(4);
548 millerindex[0] =
static_cast<float>(hkl.
X());
549 millerindex[1] =
static_cast<float>(hkl.
Y());
550 millerindex[2] =
static_cast<float>(hkl.
Z());
551 millerindex[3] =
static_cast<float>(dE);
553 inserter.insertMDEvent(
static_cast<float>(signal),
static_cast<float>(
error *
error),
554 static_cast<uint16_t
>(expInfoIndex), 0, detid, millerindex.data());
556 norm_inserter.insertMDEvent(
static_cast<float>(norm_signal),
static_cast<float>(norm_error * norm_error),
557 static_cast<uint16_t
>(expInfoIndex), 0, detid, millerindex.data());
575 std::vector<std::string> vec_ID(3);
580 std::vector<std::string> dimensionNames(3);
581 dimensionNames[0] =
"Scattering Angle";
582 dimensionNames[1] =
"Omega";
583 dimensionNames[2] =
"TOF";
589 loadAlg->setChild(
true);
590 loadAlg->setLogging(
false);
591 loadAlg->initialize();
592 loadAlg->setProperty(
"InstrumentName",
"DNS");
593 loadAlg->setProperty(
"OutputWorkspace",
"__DNS_Inst");
596 const auto &instrument = instWS->getInstrument();
597 const auto &samplePosition = instrument->getSample()->getPos();
598 const auto &sourcePosition = instrument->getSource()->getPos();
599 const auto beamVector = samplePosition - sourcePosition;
600 const auto l1 = beamVector.norm();
603 auto tof1 = 1e+06 * l1 / velocity;
604 g_log.
debug() <<
"TOF1 = " << tof1 << std::endl;
611 std::vector<double> tth_limits =
getProperty(
"TwoThetaLimits");
612 double theta_min = tth_limits[0] / 2.0;
613 double theta_max = tth_limits[1] / 2.0;
615 std::vector<double> extentMins = {theta_min, 0.0, tof1};
616 std::vector<double> extentMaxs = {theta_max, 360.0,
m_tof_max};
626 for (
size_t i = 0; i < 3; ++i) {
627 std::string
id = vec_ID[i];
628 std::string
name = dimensionNames[i];
630 name,
id, frame,
static_cast<coord_t>(extentMins[i]),
static_cast<coord_t>(extentMaxs[i]), 5)));
634 m_OutWS->setCoordinateSystem(coordinateSystem);
638 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<3>, 3>>(
m_OutWS);
646 std::dynamic_pointer_cast<MDEventWorkspace<MDEvent<3>, 3>>(normWS);
654 uint16_t expInfoIndex = 0;
657 for (
size_t i = 0; i < ds.detID.size(); i++) {
658 const auto &detector = instWS->getDetector(i);
659 const auto &detectorPosition = detector->getPos();
660 const auto detectorVector = detectorPosition - samplePosition;
661 const auto l2 = detectorVector.norm();
662 auto tof2_elastic = 1e+06 *
l2 / velocity;
664 auto echannel_geom =
static_cast<int>(std::ceil(tof2_elastic / ds.chwidth));
666 int ch_diff = echannel_geom - echannel_user;
667 if ((echannel_user > 0) && (ch_diff < 0)) {
668 std::rotate(ds.signal[i].begin(), ds.signal[i].begin() - ch_diff, ds.signal[i].end());
669 }
else if ((echannel_user > 0) && (ch_diff > 0)) {
670 std::rotate(ds.signal[i].rbegin(), ds.signal[i].rbegin() + ch_diff, ds.signal[i].rend());
674 double theta = 0.5 * (ds.detID[i] * 5.0 - ds.deterota);
675 auto nchannels =
static_cast<int64_t
>(ds.signal[i].size());
676 if ((theta > theta_min) && (theta < theta_max)) {
678 for (int64_t channel = 0; channel < nchannels; channel++) {
680 double signal = ds.signal[i][channel];
682 double tof2(tof2_elastic);
684 tof2 =
static_cast<double>(channel) * ds.chwidth + 0.5 * ds.chwidth;
686 double omega = (ds.huber - ds.deterota);
688 std::vector<Mantid::coord_t> datapoint(3);
689 datapoint[0] =
static_cast<float>(theta);
690 datapoint[1] =
static_cast<float>(omega);
691 datapoint[2] =
static_cast<float>(tof1 + tof2);
693 inserter.insertMDEvent(
static_cast<float>(signal),
static_cast<float>(
error *
error),
694 static_cast<uint16_t
>(expInfoIndex), 0, detid, datapoint.data());
696 norm_inserter.insertMDEvent(
static_cast<float>(norm_signal),
static_cast<float>(norm_error * norm_error),
697 static_cast<uint16_t
>(expInfoIndex), 0, detid, datapoint.data());
709 std::map<std::string, double> &num_metadata) {
710 std::ifstream file(fname);
712 std::string::size_type
n;
714 boost::regex reg1(
"^#\\s+(\\w+):(.*)");
715 boost::regex reg2(
"^#\\s+((\\w+\\s)+)\\s+(-?\\d+(,\\d+)*(\\.\\d+(e\\d+)?)?)");
718 n = line.find(
"DNS");
719 if (
n == std::string::npos) {
720 throw std::invalid_argument(
"Not a DNS file");
723 Poco::File pfile(fname);
724 Poco::DateTime lastModified = pfile.getLastModified();
725 std::string wtime(Poco::DateTimeFormatter::format(lastModified,
"%Y-%m-%dT%H:%M:%S"));
726 str_metadata.insert(std::make_pair(
"file_save_time", wtime));
730 str_metadata.insert(std::make_pair(
"run_number", p.getBaseName()));
733 while (getline(file, line)) {
734 n = line.find(
"Lambda");
735 if (
n != std::string::npos) {
736 boost::regex re(
"[\\s]+");
738 boost::sregex_token_iterator it(s.begin(), s.end(), re, -1);
739 boost::sregex_token_iterator reg_end;
741 std::string s2 = line.substr(2);
742 boost::sregex_token_iterator it2(s2.begin(), s2.end(), re, -1);
743 for (; (it != reg_end) && (it2 != reg_end); ++it) {
744 std::string token(it->str());
745 if (token.find_first_not_of(
' ') == std::string::npos) {
749 if (token ==
"Mono") {
750 str_metadata.insert(std::make_pair(token, it2->str()));
752 num_metadata.insert(std::make_pair(token, std::stod(it2->str())));
758 n = line.find(
"start");
759 if (
n != std::string::npos) {
760 str_metadata.insert(std::make_pair(
"start_time", parseTime(line)));
762 str_metadata.insert(std::make_pair(
"stop_time", parseTime(line)));
765 if (boost::regex_search(line, match, reg1) && match.size() > 2) {
766 str_metadata.insert(std::make_pair(match.str(1), match.str(2)));
768 if (boost::regex_search(line, match, reg2) && match.size() > 2) {
770 s.erase(std::find_if_not(s.rbegin(), s.rend(), ::isspace).base(), s.end());
771 num_metadata.insert(std::make_pair(s, std::stod(match.str(3))));
773 n = line.find(
"DATA");
774 if (
n != std::string::npos) {
779 std::map<std::string, double>::const_iterator
m = num_metadata.lower_bound(
"TOF");
780 g_log.
debug() <<
"TOF Channels number: " <<
m->second << std::endl;
781 std::map<std::string, double>::const_iterator w = num_metadata.lower_bound(
"Time");
782 g_log.
debug() <<
"Channel width: " << w->second << std::endl;
785 ds.
deterota = num_metadata[
"DeteRota"];
786 ds.
huber = num_metadata[
"Huber"];
787 ds.
wavelength = 10.0 * num_metadata[
"Lambda[nm]"];
790 ds.
nchannels =
static_cast<size_t>(std::ceil(
m->second));
795 std::list<std::string> columns;
796 while (getline(file, line)) {
800 ds.
detID.emplace_back(std::stoi(columns.front()));
802 std::vector<double> signal;
803 std::transform(columns.begin(), columns.end(), std::back_inserter(signal),
804 [](
const std::string &s) { return std::stod(s); });
805 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)
Create the U matrix from two vectors.
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
Kernel::Logger g_log("ExperimentInfo")
static logger object
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