23#include "MantidHistogramData/LinearGenerator.h"
47const std::string
ELASTIC(
"Elastic");
50const std::string
Q3D(
"Q3D");
53const std::size_t
DIMS(3);
57 auto numSpectra =
static_cast<int>(wksp->getNumberHistograms());
59 for (
int i = 0; i < numSpectra; ++i) {
70 std::vector<double> buffer(
DIMS);
84 std::vector<Mantid::coord_t> locCoord(
DIMS, 0.);
85 unitConverter.updateConversion(i);
92 std::vector<std::pair<std::pair<double, double>,
V3D>> qList;
93 for (
const auto &raw_event : raw_events) {
94 double val = unitConverter.convertUnits(raw_event.tof());
96 for (
size_t dim = 0; dim <
DIMS; ++dim) {
97 buffer[dim] = locCoord[dim];
99 V3D qVec(buffer[0], buffer[1], buffer[2]);
100 qList.emplace_back(std::pair<double, double>(raw_event.m_weight, raw_event.m_errorSquared), qVec);
112 auto numSpectra =
static_cast<int>(wksp->getNumberHistograms());
114 for (
int i = 0; i < numSpectra; ++i) {
125 std::vector<double> buffer(
DIMS);
127 const auto &xVals = wksp->points(i);
128 const auto &yVals = wksp->y(i);
129 const auto &eVals = wksp->e(i);
132 std::vector<Mantid::coord_t> locCoord(
DIMS, 0.);
133 unitConverter.updateConversion(i);
141 for (
size_t j = 0; j < yVals.size(); ++j) {
142 const double &yVal = yVals[j];
143 const double &esqVal = eVals[j] * eVals[j];
146 double val = unitConverter.convertUnits(xVals[j]);
148 for (
size_t dim = 0; dim <
DIMS; ++dim) {
149 buffer[dim] = locCoord[dim];
153 V3D qVec(buffer[0], buffer[1], buffer[2]);
154 if (std::isnan(qVec[0]) || std::isnan(qVec[1]) || std::isnan(qVec[2]))
158 qList.emplace_back(std::pair<double, double>(yVal, esqVal), qVec);
180 mustBePositive->setLower(0.0);
190 "Only events at most this distance from a satellite peak will be considered when integration");
192 "Half-length of major axis for satellite peak ellipsoid");
193 alg.
declareProperty(
"ShareBackground",
false,
"Whether to use the same peak background region for satellite peaks.");
195 "SatelliteBackgroundInnerSize",
EMPTY_DBL(), mustBePositive,
196 "Half-length of major axis for the inner ellipsoidal surface of background region of the satellite peak");
198 "SatelliteBackgroundOuterSize",
EMPTY_DBL(), mustBePositive,
199 "Half-length of major axis for the outer ellipsoidal surface of background region of the satellite peak");
208 std::map<std::string, std::string> issues;
214 double back_inner_radius =
getProperty(
"BackgroundInnerSize");
215 double back_outer_radius =
getProperty(
"BackgroundOuterSize");
217 if (back_outer_radius > radius_m) {
218 issues[
"SpecifySize"] =
"BackgroundOuterSize must be less than or equal to the RegionRadius";
220 if (back_inner_radius >= back_outer_radius) {
221 issues[
"SpecifySize"] =
"BackgroundInnerSize must be less than BackgroundOuterSize";
223 if (peak_radius > back_inner_radius) {
224 issues[
"SpecifySize"] =
"PeakSize must be less than or equal to the BackgroundInnerSize";
242 if (satellite_back_outer_radius > satellite_radius) {
243 issues[
"SpecifySize"] =
"SatelliteBackgroundOuterSize must be less than or equal to the SatelliteRegionRadius";
245 if (satellite_back_inner_radius > satellite_back_outer_radius) {
246 issues[
"SpecifySize"] =
"SatelliteBackgroundInnerSize must be less than SatelliteBackgroundOuterSize";
248 if (satellite_peak_radius > satellite_back_inner_radius) {
249 issues[
"SpecifySize"] =
"SatellitePeakSize must be less than or equal to the SatelliteBackgroundInnerSize";
264 if (!eventWS && !histoWS) {
265 throw std::runtime_error(
"IntegrateEllipsoidsV2 needs either a "
266 "EventWorkspace or Workspace2D as input.");
270 if (eventWS && eventWS->getNumberEvents() <= 0) {
271 throw std::runtime_error(
"IntegrateEllipsoidsV2 does not work for empty event lists");
276 throw std::runtime_error(
"Could not read the peaks workspace");
284 double back_inner_radius =
getProperty(
"BackgroundInnerSize");
285 double back_outer_radius =
getProperty(
"BackgroundOuterSize");
286 bool integrateEdge =
getProperty(
"IntegrateIfOnEdge");
287 bool adaptiveQBackground =
getProperty(
"AdaptiveQBackground");
288 double adaptiveQMultiplier =
getProperty(
"AdaptiveQMultiplier");
289 double adaptiveQBackgroundMultiplier = 0.0;
290 bool useOnePercentBackgroundCorrection =
getProperty(
"UseOnePercentBackgroundCorrection");
305 bool shareBackground =
getProperty(
"ShareBackground");
307 if (adaptiveQBackground)
308 adaptiveQBackgroundMultiplier = adaptiveQMultiplier;
309 if (!integrateEdge) {
316 g_log.
error(
"Can't execute MaskBTP algorithm for this instrument to set "
317 "edge for IntegrateIfOnEdge option");
323 if (peak_ws != in_peak_ws)
324 peak_ws = in_peak_ws->clone();
327 std::vector<Peak> &peaks = peak_ws->getPeaks();
328 size_t n_peaks = peak_ws->getNumberPeaks();
332 for (
size_t i = 0; i < n_peaks; i++) {
334 const bool isSatellitePeak = (peaks[i].getIntMNP().norm2() > 0);
335 const V3D peak_q = peaks[i].getQLabFrame();
342 qList.emplace_back(std::pair<double, double>(1., 1.), peak_q);
346 std::vector<double> PeakRadiusVector(n_peaks, peak_radius);
347 std::vector<double> BackgroundInnerRadiusVector(n_peaks, back_inner_radius);
348 std::vector<double> BackgroundOuterRadiusVector(n_peaks, back_outer_radius);
350 std::vector<double> SatellitePeakRadiusVector(n_peaks, satellite_peak_radius);
351 std::vector<double> SatelliteBackgroundInnerRadiusVector(n_peaks, satellite_back_inner_radius);
352 std::vector<double> SatelliteBackgroundOuterRadiusVector(n_peaks, satellite_back_outer_radius);
358 IntegrateQLabEvents integrator(qList, satellite_radius, useOnePercentBackgroundCorrection);
366 const size_t numSpectra = wksp->getNumberHistograms();
367 Progress prog(
this, 0.5, 1.0, numSpectra);
379 std::map<size_t, std::vector<Peak *>> satellitePeakMap;
381 std::vector<size_t> satellitePeaks;
382 if (shareBackground) {
387 std::vector<double> principalaxis1, principalaxis2, principalaxis3;
389 std::map<size_t, std::pair<double, double>> cachedBraggBackground;
390 for (
size_t i = 0; i < n_peaks; i++) {
392 const bool isSatellitePeak = (peaks[i].getIntMNP().norm2() > 0);
394 const V3D peak_q = peaks[i].getQLabFrame();
404 const double lenQpeak = (adaptiveQMultiplier != 0.0) ? peak_q.
norm() : 0.0;
406 double adaptiveRadius = isSatellitePeak ? adaptiveQMultiplier * lenQpeak + satellite_peak_radius
407 : adaptiveQMultiplier * lenQpeak + peak_radius;
409 if (adaptiveRadius < 0.0) {
411 std::ostringstream errmsg;
412 errmsg <<
"Error: Radius for integration sphere of peak " << i <<
" is negative = " << adaptiveRadius <<
'\n';
415 peaks[i].setIntensity(0.0);
416 peaks[i].setSigmaIntensity(0.0);
417 PeakRadiusVector[i] = 0.0;
418 BackgroundInnerRadiusVector[i] = 0.0;
419 BackgroundOuterRadiusVector[i] = 0.0;
420 SatellitePeakRadiusVector[i] = 0.0;
421 SatelliteBackgroundInnerRadiusVector[i] = 0.0;
422 SatelliteBackgroundOuterRadiusVector[i] = 0.0;
427 std::vector<double> axes_radii;
431 double adaptiveBack_inner_radius = isSatellitePeak
432 ? adaptiveQBackgroundMultiplier * lenQpeak + satellite_back_inner_radius
433 : adaptiveQBackgroundMultiplier * lenQpeak + back_inner_radius;
434 double adaptiveBack_outer_radius = isSatellitePeak
435 ? adaptiveQBackgroundMultiplier * lenQpeak + satellite_back_outer_radius
436 : adaptiveQBackgroundMultiplier * lenQpeak + back_outer_radius;
440 if (isSatellitePeak) {
442 SatellitePeakRadiusVector[i] = adaptiveRadius;
443 SatelliteBackgroundInnerRadiusVector[i] = adaptiveBack_inner_radius;
444 SatelliteBackgroundOuterRadiusVector[i] = adaptiveBack_outer_radius;
446 std::pair<double, double> backi;
448 if (!shareBackground || (satellitePeaks.size() > 0 &&
449 std::find(satellitePeaks.begin(), satellitePeaks.end(), i) != satellitePeaks.end())) {
453 adaptiveBack_outer_radius, axes_radii, inti, sigi, backi);
456 SatelliteBackgroundInnerRadiusVector[i] = adaptiveQBackgroundMultiplier * lenQpeak + back_inner_radius;
457 SatelliteBackgroundOuterRadiusVector[i] = adaptiveQBackgroundMultiplier * lenQpeak + back_outer_radius;
461 adaptiveRadius, axes_radii, inti, sigi, backi);
466 PeakRadiusVector[i] = adaptiveRadius;
467 BackgroundInnerRadiusVector[i] = adaptiveBack_inner_radius;
468 BackgroundOuterRadiusVector[i] = adaptiveBack_outer_radius;
470 std::pair<double, double> backi;
474 adaptiveBack_outer_radius, axes_radii, inti, sigi, backi);
475 if (shareBackground) {
477 cachedBraggBackground[i] = backi;
481 peaks[i].setIntensity(inti);
482 peaks[i].setSigmaIntensity(sigi);
483 peaks[i].setPeakShape(shape);
484 if (axes_radii.size() == 3) {
485 if (inti / sigi > cutoffIsigI || cutoffIsigI ==
EMPTY_DBL()) {
486 principalaxis1.emplace_back(axes_radii[0]);
487 principalaxis2.emplace_back(axes_radii[1]);
488 principalaxis3.emplace_back(axes_radii[2]);
495 if (shareBackground) {
499 if (principalaxis1.size() > 1) {
500 outputAxisProfiles(principalaxis1, principalaxis2, principalaxis3, cutoffIsigI, numSigmas, peaks, integrator);
505 peak_ws->mutableRun().addProperty(
"PeaksIntegrated", 1,
true);
507 peak_ws->mutableRun().addProperty(
"PeakRadius", PeakRadiusVector,
true);
508 peak_ws->mutableRun().addProperty(
"BackgroundInnerRadius", BackgroundInnerRadiusVector,
true);
509 peak_ws->mutableRun().addProperty(
"BackgroundOuterRadius", BackgroundOuterRadiusVector,
true);
511 peak_ws->mutableRun().addProperty(
"SatellitePeakRadius", SatellitePeakRadiusVector,
true);
512 peak_ws->mutableRun().addProperty(
"SatelliteBackgroundInnerRadius", SatelliteBackgroundInnerRadiusVector,
true);
513 peak_ws->mutableRun().addProperty(
"SatelliteBackgroundOuterRadius", SatelliteBackgroundOuterRadiusVector,
true);
526 childAlg->setProperty(
"InputWorkspace", wksp);
527 childAlg->executeAsChildAlg();
531 throw(std::runtime_error(
"Can not retrieve results of \"PreprocessDetectorsToMD\""));
537 for (
size_t i = 0; i < detectorInfo.
size(); ++i) {
542 const auto &det = detectorInfo.
detector(i);
544 double ph1 = det.getPhi();
545 V3D E1 =
V3D(-std::sin(tt1) * std::cos(ph1), -std::sin(tt1) * std::sin(ph1),
547 E1 =
E1 * (1. /
E1.norm());
556 const std::vector<double> &principalaxis2,
557 const std::vector<double> &principalaxis3,
const std::string &wsname) {
559 constexpr size_t histogramNumber = 3;
562 Workspace2D_sptr wsProfile2D = std::dynamic_pointer_cast<Workspace2D>(wsProfile);
566 Points points(principalaxis1.size(), LinearGenerator(0, 1));
567 wsProfile2D->setHistogram(0, points, Counts(std::move(principalaxis1)));
568 wsProfile2D->setHistogram(1, points, Counts(std::move(principalaxis2)));
569 wsProfile2D->setHistogram(2, points, Counts(std::move(principalaxis3)));
580 std::map<
size_t, std::vector<Peak *>> &satellitePeakMap,
581 std::vector<size_t> &satellitePeaks) {
583 std::vector<size_t> braggPeaks;
585 for (
size_t i = 0; i < n_peaks; i++) {
587 const bool isSatellitePeak = (peaks[i].getIntMNP().norm2() > 0);
589 const V3D peak_q = peaks[i].getQLabFrame();
597 if (isSatellitePeak) {
598 satellitePeaks.emplace_back(i);
600 braggPeaks.emplace_back(i);
605 for (
auto it = braggPeaks.begin(); it != braggPeaks.end(); it++) {
606 const auto braggHKL = peaks[*it].getIntHKL();
609 for (
auto satIt = satellitePeaks.begin(); satIt != satellitePeaks.end();) {
610 const auto satHKL = peaks[*satIt].getIntHKL();
611 if (satHKL == braggHKL) {
613 satellitePeakMap[*it].emplace_back(&peaks[*satIt]);
616 satIt = satellitePeaks.erase(satIt);
624 if (satellitePeaks.size() > 0) {
625 g_log.
debug() <<
"Unable to find Bragg peaks for " << satellitePeaks.size()
626 <<
" satellite peaks.. integrating these using the satellite background radii options.\n";
634 std::map<
size_t, std::pair<double, double>> &cachedBraggBackground) {
637 for (
auto it = satellitePeakMap.begin(); it != satellitePeakMap.end(); it++) {
638 const double bkgd_value{cachedBraggBackground[it->first].first};
639 const double bkgd_sigma{cachedBraggBackground[it->first].second};
640 for (
auto satPeak = it->second.begin(); satPeak != it->second.end(); satPeak++) {
643 (*satPeak)->setIntensity((*satPeak)->getIntensity() - bkgd_value);
646 double sigInt = (*satPeak)->getSigmaIntensity();
647 (*satPeak)->setSigmaIntensity(sqrt(sigInt * sigInt + bkgd_sigma));
657 std::vector<double> &principalaxis3,
const double &cutoffIsigI,
658 const int &numSigmas, std::vector<Peak> &peaks,
662 outputProfileWS(principalaxis1, principalaxis2, principalaxis3,
"EllipsoidAxes");
681 double meanMax = std::max(std::max(stats1.
mean, stats2.
mean), stats3.
mean);
686 if (principalaxis1.size() > 1) {
687 outputProfileWS(principalaxis1, principalaxis2, principalaxis3,
"EllipsoidAxes_2ndPass");
697 std::vector<double> &principalaxis1,
698 std::vector<double> &principalaxis2,
699 std::vector<double> &principalaxis3,
const int &numSigmas,
702 principalaxis1.clear();
703 principalaxis2.clear();
704 principalaxis3.clear();
706 bool specify_size =
true;
710 double peak_radius = meanMax + numSigmas * stdMax;
711 double back_inner_radius = peak_radius;
712 double back_outer_radius = peak_radius * 1.25992105;
714 for (
size_t i = 0; i < peaks.size(); i++) {
716 const bool isSatellitePeak = (peaks[i].getIntMNP().norm2() > 0);
718 const V3D peak_q = peaks[i].getQLabFrame();
719 std::vector<double> axes_radii;
721 double inti{0.}, sigi{0.};
722 std::pair<double, double> backi;
723 if (isSatellitePeak) {
726 axes_radii, inti, sigi, backi);
730 axes_radii, inti, sigi, backi);
733 peaks[i].setIntensity(inti);
734 peaks[i].setSigmaIntensity(sigi);
735 if (axes_radii.size() == 3) {
736 principalaxis1.emplace_back(axes_radii[0]);
737 principalaxis2.emplace_back(axes_radii[1]);
738 principalaxis3.emplace_back(axes_radii[2]);
744 const std::string &property,
const std::string &values) {
747 alg->setProperty(property, values);
749 throw std::runtime_error(
"MaskDetectors Child Algorithm has not executed successfully");
#define DECLARE_ALGORITHM(classname)
#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.
Base class from which all concrete algorithm classes should be derived.
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.
void removeProperty(const std::string &name, const bool delproperty=true) override
Removes the property from management.
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.
Helper class for reporting progress from algorithms.
void compressEvents(double tolerance, EventList *destination)
Compress the event list by grouping events with the same TOF (within a given tolerance).
std::vector< WeightedEventNoTime > & getWeightedEventsNoTime()
Return the list of WeightedEvent contained.
void switchTo(Mantid::API::EventType newType) override
Switch the EventList to use the given EventType (TOF, WEIGHTED, or WEIGHTED_NOTIME)
bool empty() const
Much like stl containers, returns true if there is nothing in the event list.
Geometry::DetectorInfo is an intermediate step towards a DetectorInfo that is part of Instrument-2....
bool isMasked(const size_t index) const
Returns true if the detector is masked.
const Geometry::IDetector & detector(const size_t index) const
Return a const reference to the detector with given index.
size_t size() const
Returns the size of the DetectorInfo, i.e., the number of detectors in the instrument.
bool isMonitor(const size_t index) const
Returns true if the detector is a monitor.
virtual double getTwoTheta(const Kernel::V3D &observer, const Kernel::V3D &axis) const =0
Gives the angle of this detector object with respect to an axis.
BoundedValidator is a validator that requires the values to be between upper or lower bounds,...
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 error(const std::string &msg)
Logs at error level.
void report()
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.
virtual bool isDefault() const =0
Overriden function that returns if property has the same value that it was initialised with,...
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
double norm() const noexcept
static void initInstance(API::Algorithm &alg)
MDWSDescription m_targWSDescr
void outputProfileWS(const std::vector< double > &principalaxis1, const std::vector< double > &principalaxis2, const std::vector< double > &principalaxis3, const std::string &wsname)
Write Axis profile to a MatrixWorkspace (Workspace2D)
void integratePeaksCutoffISigI(const double &meanMax, const double &stdMax, std::vector< double > &principalaxis1, std::vector< double > &principalaxis2, std::vector< double > &principalaxis3, const int &numSigmas, std::vector< DataObjects::Peak > &peaks, IntegrateQLabEvents &integrator_satellite)
Integrate peaks again with cutoff value of I/Sig(I)
void outputAxisProfiles(std::vector< double > &principalaxis1, std::vector< double > &principalaxis2, std::vector< double > &principalaxis3, const double &cutoffIsigI, const int &numSigmas, std::vector< DataObjects::Peak > &peaks, IntegrateQLabEvents &integrator)
Write the profiles of each principle axis to the output workspace with fixed name.
void removeSharedBackground(std::map< size_t, std::vector< DataObjects::Peak * > > &satellitePeakMap, std::map< size_t, std::pair< double, double > > &cachedBraggBackground)
Remove shared background from each satellite peak.
double m_satellitePeakRadius
peak radius for satellite peaks
std::vector< Kernel::V3D > E1Vec
save for all detector pixels
std::map< std::string, std::string > validateInputs() override
Private validator for inputs.
double m_braggPeakRadius
peak radius for Bragg peaks
void exec() override
Execute the algorithm.
void runMaskDetectors(const Mantid::DataObjects::PeaksWorkspace_sptr &peakWS, const std::string &property, const std::string &values)
static void initInstance(API::Algorithm &alg)
void pairBraggSatellitePeaks(const size_t &n_peaks, std::vector< DataObjects::Peak > &peaks, std::map< size_t, std::vector< DataObjects::Peak * > > &satellitePeakMap, std::vector< size_t > &satellitePeaks)
Pair all Bragg peaks with their related satellite peaks.
void initTargetWSDescr(API::MatrixWorkspace_sptr &wksp)
Initialize the output information for the MD conversion framework.
void init() override
Initialize the algorithm's properties.
void qListFromEventWS(IntegrateQLabEvents &integrator, API::Progress &prog, DataObjects::EventWorkspace_sptr &wksp)
create a list of SlimEvent objects from an events workspace
void calculateE1(const Geometry::DetectorInfo &detectorInfo)
Calculate if this Q is on a detector.
void qListFromHistoWS(IntegrateQLabEvents &integrator, API::Progress &prog, DataObjects::Workspace2D_sptr &wksp)
create a list of SlimEvent objects from a histogram workspace
This is a low-level class to construct a map with lists of events near each peak Q-vector in the lab ...
static bool isOrigin(const V3D &q, const double &cellSize)
Determine if an input Q-vector lies in the cell associated to the origin.
void setRadius(const double &radius)
Set peak integration radius.
void populateCellsWithPeaks()
Assign events to each of the cells occupied by events.
PeakShape_const_sptr ellipseIntegrateEvents(const std::vector< V3D > &E1Vec, V3D const &peak_q, bool specify_size, double peak_radius, double back_inner_radius, double back_outer_radius, std::vector< double > &axes_radii, double &inti, double &sigi, std::pair< double, double > &backi)
Integrate the events around the specified peak QLab vector.
void addEvents(SlimEvents const &event_qs)
distribute the events among the cells of the partitioned QLab space.
Class responsible for conversion of input workspace data into proper number of output dimensions for ...
bool calcMatrixCoord(const double &deltaEOrK0, std::vector< coord_t > &Coord, double &s, double &err) const override
Calculates 3D transformation of the variable coordinates and (if applicable) signal and error dependi...
void initialize(const MDWSDescription &ConvParams) override
function initalizes all variables necessary for converting workspace variables into MD variables in M...
bool calcYDepCoordinates(std::vector< coord_t > &Coord, size_t i) override
Method updates the value of preprocessed detector coordinates in Q-space, used by other functions.
void setMinMax(const std::vector< double > &minVal, const std::vector< double > &maxVal)
function sets up min-max values to the dimensions, described by the class
void buildFromMatrixWS(const API::MatrixWorkspace_sptr &pWS, const std::string &QMode, const std::string &dEMode, const std::vector< std::string > &dimPropertyNames=std::vector< std::string >())
method builds MD Event ws description from a matrix workspace and the transformations,...
DataObjects::TableWorkspace_const_sptr m_PreprDetTable
void setLorentsCorr(bool On=false)
do we need to perform Lorentz corrections
void initialize(const MDWSDescription &targetWSDescr, const std::string &unitsTo, bool forceViaTOF=false)
Initialize unit conversion helper This method is interface to internal initialize method,...
std::complex< double > MANTID_API_DLL E1(std::complex< double > z)
Integral for Gamma.
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
std::shared_ptr< Algorithm > Algorithm_sptr
Typedef for a shared pointer to an Algorithm.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
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.
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
std::shared_ptr< const PeakShape > PeakShape_const_sptr
Statistics getStatistics(const std::vector< TYPE > &data, const unsigned int flags=StatOptions::AllStats)
Return a statistics object for the given data set.
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.
std::vector< SlimEvent > SlimEvents
const std::string Q3D("Q3D")
Only convert to Q-vector.
const std::size_t DIMS(3)
Q-vector is always three dimensional.
const std::string ELASTIC("Elastic")
This only works for diffraction.
constexpr double EMPTY_DBL() noexcept
Returns what we consider an "empty" double within a property.
Simple struct to store statistics.
double median
Median value.
double minimum
Minimum value.
double maximum
Maximum value.
double standard_deviation
standard_deviation of the values