23#include "MantidHistogramData/LinearGenerator.h"
32#include <boost/math/special_functions/round.hpp>
42namespace MDAlgorithms {
48const std::string
Q3D(
"Q3D");
65 auto numSpectra =
static_cast<int>(wksp->getNumberHistograms());
67 for (
int i = 0; i < numSpectra; ++i) {
78 std::vector<double> buffer(
DIMS);
92 std::vector<Mantid::coord_t> locCoord(
DIMS, 0.);
93 unitConverter.updateConversion(i);
100 std::vector<std::pair<std::pair<double, double>,
V3D>> qList;
101 for (
const auto &raw_event : raw_events) {
102 double val = unitConverter.convertUnits(raw_event.tof());
104 for (
size_t dim = 0; dim <
DIMS; ++dim) {
105 buffer[dim] = locCoord[dim];
107 V3D qVec(buffer[0], buffer[1], buffer[2]);
110 qList.emplace_back(std::pair<double, double>(raw_event.m_weight, raw_event.m_errorSquared), qVec);
130 DblMatrix const &UBinv,
bool hkl_integ) {
134 auto numSpectra =
static_cast<int>(wksp->getNumberHistograms());
136 for (
int i = 0; i < numSpectra; ++i) {
147 std::vector<double> buffer(
DIMS);
149 const auto &xVals = wksp->points(i);
150 const auto &yVals = wksp->y(i);
151 const auto &eVals = wksp->e(i);
154 std::vector<Mantid::coord_t> locCoord(
DIMS, 0.);
155 unitConverter.updateConversion(i);
162 std::vector<std::pair<std::pair<double, double>,
V3D>> qList;
164 for (
size_t j = 0; j < yVals.size(); ++j) {
165 const double &yVal = yVals[j];
166 const double &esqVal = eVals[j] * eVals[j];
169 double val = unitConverter.convertUnits(xVals[j]);
171 for (
size_t dim = 0; dim <
DIMS; ++dim) {
172 buffer[dim] = locCoord[dim];
176 V3D qVec(buffer[0], buffer[1], buffer[2]);
180 if (std::isnan(qVec[0]) || std::isnan(qVec[1]) || std::isnan(qVec[2]))
184 qList.emplace_back(std::pair<double, double>(yVal, esqVal), qVec);
218 auto ws_valid = std::make_shared<CompositeValidator>();
225 "An input MatrixWorkspace with time-of-flight units along "
226 "X-axis and defined instrument with defined sample");
229 "Workspace with Peaks to be integrated. NOTE: The peaks MUST "
230 "be indexed with integer HKL values.");
233 mustBePositive->setLower(0.0);
236 "Only events at most this distance from a peak will be "
237 "considered when integrating");
239 alg.
declareProperty(
"SpecifySize",
false,
"If true, use the following for the major axis sizes, else use 3-sigma");
241 alg.
declareProperty(
"PeakSize", .18, mustBePositive,
"Half-length of major axis for peak ellipsoid");
244 "Half-length of major axis for inner ellipsoidal surface of "
245 "background region");
248 "Half-length of major axis for outer ellipsoidal surface of "
249 "background region");
252 "The output PeaksWorkspace will be a copy of the input PeaksWorkspace "
253 "with the peaks' integrated intensities.");
256 "Cuttoff for I/sig(i) when finding mean of half-length of "
257 "major radius in first pass when SpecifySize is false."
258 "Default is no second pass.");
261 "Number of sigmas to add to mean of half-length of "
262 "major radius for second pass when SpecifySize is false.");
264 alg.
declareProperty(
"IntegrateInHKL",
false,
"If true, integrate in HKL space not Q space.");
267 "Set to false to not integrate if peak radius is off edge of detector."
268 "Background will be scaled if background radius is off edge.");
271 "Default is false. If true, "
272 "BackgroundOuterRadius + AdaptiveQMultiplier * **|Q|** and "
273 "BackgroundInnerRadius + AdaptiveQMultiplier * **|Q|**");
276 "PeakRadius + AdaptiveQMultiplier * **|Q|** "
277 "so each peak has a "
278 "different integration radius. Q includes the 2*pi factor.");
281 "If this options is enabled, then the the top 1% of the "
282 "background will be removed"
283 "before the background subtraction.");
286 "Only events at most this distance from a peak will be "
287 "considered when integrating");
290 "Half-length of major axis for satellite peak ellipsoid");
292 alg.
declareProperty(
"SatelliteBackgroundInnerSize", .08, mustBePositive,
293 "Half-length of major axis for inner ellipsoidal surface of "
294 "satellite background region");
296 alg.
declareProperty(
"SatelliteBackgroundOuterSize", .09, mustBePositive,
297 "Half-length of major axis for outer ellipsoidal surface of "
298 "satellite background region");
300 alg.
declareProperty(
"GetUBFromPeaksWorkspace",
false,
"If true, UB is taken from peak workspace.");
312 if (!eventWS && !histoWS) {
313 throw std::runtime_error(
"IntegrateEllipsoidsV1 needs either a "
314 "EventWorkspace or Workspace2D as input.");
318 if (eventWS && eventWS->getNumberEvents() <= 0) {
319 throw std::runtime_error(
"IntegrateEllipsoidsV1 does not work for empty event lists");
324 throw std::runtime_error(
"Could not read the peaks workspace");
328 double radius_s =
getProperty(
"SatelliteRegionRadius");
333 double sate_peak_radius =
getProperty(
"SatellitePeakSize");
334 double back_inner_radius =
getProperty(
"BackgroundInnerSize");
335 double sate_back_inner_radius =
getProperty(
"SatelliteBackgroundInnerSize");
336 double back_outer_radius =
getProperty(
"BackgroundOuterSize");
337 double sate_back_outer_radius =
getProperty(
"SatelliteBackgroundOuterSize");
339 bool integrateEdge =
getProperty(
"IntegrateIfOnEdge");
340 bool adaptiveQBackground =
getProperty(
"AdaptiveQBackground");
341 double adaptiveQMultiplier =
getProperty(
"AdaptiveQMultiplier");
342 double adaptiveQBackgroundMultiplier = 0.0;
343 bool useOnePercentBackgroundCorrection =
getProperty(
"UseOnePercentBackgroundCorrection");
344 bool getUB =
getProperty(
"GetUBFromPeaksWorkspace");
347 if (!(in_peak_ws->sample().hasOrientedLattice()) && getUB) {
348 throw std::runtime_error(
"Peaks workspace needs a oriented lattice for "
349 "GetUBFromPeaksWorkspace is true");
352 if (adaptiveQBackground)
353 adaptiveQBackgroundMultiplier = adaptiveQMultiplier;
354 if (!integrateEdge) {
361 g_log.
error(
"Can't execute MaskBTP algorithm for this instrument to set "
362 "edge for IntegrateIfOnEdge option");
368 if (peak_ws != in_peak_ws)
369 peak_ws = in_peak_ws->clone();
373 std::vector<Peak> &peaks = peak_ws->getPeaks();
374 size_t n_peaks = peak_ws->getNumberPeaks();
375 size_t indexed_count = 0;
376 std::vector<V3D> peak_q_list;
377 std::vector<std::pair<std::pair<double, double>,
V3D>> qList;
378 std::vector<V3D> hkl_vectors;
379 std::vector<V3D> mnp_vectors;
381 for (
size_t i = 0; i < n_peaks; i++)
383 V3D hkl(peaks[i].getIntHKL());
384 V3D mnp(peaks[i].getIntMNP());
386 if (mnp[0] != 0 && ModDim == 0)
388 if (mnp[1] != 0 && ModDim == 1)
390 if (mnp[2] != 0 && ModDim == 2)
395 peak_q_list.emplace_back(peaks[i].getQLabFrame());
396 qList.emplace_back(std::pair<double, double>(1., 1.),
V3D(peaks[i].getQLabFrame()));
397 hkl_vectors.emplace_back(hkl);
398 mnp_vectors.emplace_back(mnp);
410 if (getUB & peak_ws->sample().hasOrientedLattice()) {
411 if (indexed_count < 1)
412 throw std::runtime_error(
"At least one indexed peak required.");
413 OrientedLattice lattice = peak_ws->mutableSample().getOrientedLattice();
414 auto goniometerMatrix = peak_ws->run().getGoniometerMatrix();
416 UB = goniometerMatrix * lattice.
getUB();
417 modUB = goniometerMatrix * lattice.
getModUB();
422 if (indexed_count < 3)
423 throw std::runtime_error(
"At least three linearly independent indexed peaks are needed.");
425 if (peak_ws->sample().hasOrientedLattice()) {
426 OrientedLattice lattice = peak_ws->mutableSample().getOrientedLattice();
437 UBinv *= (1.0 / (2.0 * M_PI));
439 std::vector<double> PeakRadiusVector(n_peaks, peak_radius);
440 std::vector<double> BackgroundInnerRadiusVector(n_peaks, back_inner_radius);
441 std::vector<double> BackgroundOuterRadiusVector(n_peaks, back_outer_radius);
443 if (back_outer_radius > radius_m)
444 throw std::runtime_error(
"BackgroundOuterSize must be less than or equal to the RegionRadius");
446 if (back_inner_radius >= back_outer_radius)
447 throw std::runtime_error(
"BackgroundInnerSize must be less BackgroundOuterSize");
449 if (peak_radius > back_inner_radius)
450 throw std::runtime_error(
"PeakSize must be less than or equal to the BackgroundInnerSize");
455 useOnePercentBackgroundCorrection);
463 const size_t numSpectra = wksp->getNumberHistograms();
464 Progress prog(
this, 0.5, 1.0, numSpectra);
476 std::vector<double> principalaxis1, principalaxis2, principalaxis3;
477 std::vector<double> sateprincipalaxis1, sateprincipalaxis2, sateprincipalaxis3;
478 for (
size_t i = 0; i < n_peaks; i++) {
479 const V3D hkl(peaks[i].getIntHKL());
480 const V3D mnp(peaks[i].getIntMNP());
483 const V3D peak_q = peaks[i].getQLabFrame();
485 const double lenQpeak = adaptiveQMultiplier != 0.0 ? peak_q.
norm() : 0.0;
487 double adaptiveRadius = adaptiveQMultiplier * lenQpeak + peak_radius;
488 if (mnp !=
V3D(0, 0, 0))
489 adaptiveRadius = adaptiveQMultiplier * lenQpeak + sate_peak_radius;
491 if (adaptiveRadius <= 0.0) {
492 g_log.
error() <<
"Error: Radius for integration sphere of peak " << i <<
" is negative = " << adaptiveRadius
494 peaks[i].setIntensity(0.0);
495 peaks[i].setSigmaIntensity(0.0);
496 PeakRadiusVector[i] = 0.0;
497 BackgroundInnerRadiusVector[i] = 0.0;
498 BackgroundOuterRadiusVector[i] = 0.0;
502 double adaptiveBack_inner_radius;
503 double adaptiveBack_outer_radius;
504 if (mnp ==
V3D(0, 0, 0)) {
505 adaptiveBack_inner_radius = adaptiveQBackgroundMultiplier * lenQpeak + back_inner_radius;
506 adaptiveBack_outer_radius = adaptiveQBackgroundMultiplier * lenQpeak + back_outer_radius;
508 adaptiveBack_inner_radius = adaptiveQBackgroundMultiplier * lenQpeak + sate_back_inner_radius;
509 adaptiveBack_outer_radius = adaptiveQBackgroundMultiplier * lenQpeak + sate_back_outer_radius;
511 PeakRadiusVector[i] = adaptiveRadius;
512 BackgroundInnerRadiusVector[i] = adaptiveBack_inner_radius;
513 BackgroundOuterRadiusVector[i] = adaptiveBack_outer_radius;
515 std::vector<double> axes_radii;
517 E1Vec, peak_q, hkl, mnp, specify_size, adaptiveRadius, adaptiveBack_inner_radius, adaptiveBack_outer_radius,
518 axes_radii, inti, sigi);
519 peaks[i].setIntensity(inti);
520 peaks[i].setSigmaIntensity(sigi);
521 peaks[i].setPeakShape(shape);
522 if (axes_radii.size() == 3) {
523 if (inti / sigi > cutoffIsigI || cutoffIsigI ==
EMPTY_DBL()) {
524 if (mnp ==
V3D(0, 0, 0)) {
525 principalaxis1.emplace_back(axes_radii[0]);
526 principalaxis2.emplace_back(axes_radii[1]);
527 principalaxis3.emplace_back(axes_radii[2]);
529 sateprincipalaxis1.emplace_back(axes_radii[0]);
530 sateprincipalaxis2.emplace_back(axes_radii[1]);
531 sateprincipalaxis3.emplace_back(axes_radii[2]);
536 peaks[i].setIntensity(0.0);
537 peaks[i].setSigmaIntensity(0.0);
540 if (principalaxis1.size() > 1) {
554 if (sateprincipalaxis1.size() > 1) {
558 <<
" minimum " << satestats1.
minimum <<
" maximum " << satestats1.
maximum <<
" median "
559 << satestats1.
median <<
"\n";
563 <<
" minimum " << satestats2.
minimum <<
" maximum " << satestats2.
maximum <<
" median "
564 << satestats2.
median <<
"\n";
568 <<
" minimum " << satestats3.
minimum <<
" maximum " << satestats3.
maximum <<
" median "
569 << satestats3.
median <<
"\n";
572 constexpr size_t histogramNumber = 3;
574 principalaxis1.size(), principalaxis1.size());
575 Workspace2D_sptr wsProfile2D = std::dynamic_pointer_cast<Workspace2D>(wsProfile);
579 Points points(principalaxis1.size(), LinearGenerator(0, 1));
580 wsProfile2D->setHistogram(0, points, Counts(std::move(principalaxis1)));
581 wsProfile2D->setHistogram(1, points, Counts(std::move(principalaxis2)));
582 wsProfile2D->setHistogram(2, points, Counts(std::move(principalaxis3)));
585 principalaxis1.clear();
586 principalaxis2.clear();
587 principalaxis3.clear();
588 sateprincipalaxis1.clear();
589 sateprincipalaxis2.clear();
590 sateprincipalaxis3.clear();
592 peak_radius = std::max(std::max(stats1.
mean, stats2.
mean), stats3.
mean) +
595 back_inner_radius = peak_radius;
596 back_outer_radius = peak_radius * 1.25992105;
599 for (
size_t i = 0; i < n_peaks; i++) {
600 V3D hkl(peaks[i].getIntHKL());
601 V3D mnp(peaks[i].getIntMNP());
603 const V3D peak_q = peaks[i].getQLabFrame();
604 std::vector<double> axes_radii;
606 back_outer_radius, axes_radii, inti, sigi);
607 peaks[i].setIntensity(inti);
608 peaks[i].setSigmaIntensity(sigi);
609 if (axes_radii.size() == 3) {
610 if (mnp ==
V3D(0, 0, 0)) {
611 principalaxis1.emplace_back(axes_radii[0]);
612 principalaxis2.emplace_back(axes_radii[1]);
613 principalaxis3.emplace_back(axes_radii[2]);
615 sateprincipalaxis1.emplace_back(axes_radii[0]);
616 sateprincipalaxis2.emplace_back(axes_radii[1]);
617 sateprincipalaxis3.emplace_back(axes_radii[2]);
621 peaks[i].setIntensity(0.0);
622 peaks[i].setSigmaIntensity(0.0);
625 if (principalaxis1.size() > 1) {
627 principalaxis1.size(), principalaxis1.size());
628 Workspace2D_sptr wsProfile2D2 = std::dynamic_pointer_cast<Workspace2D>(wsProfile2);
631 Points profilePoints(principalaxis1.size(), LinearGenerator(0, 1));
632 wsProfile2D->setHistogram(0, profilePoints, Counts(std::move(principalaxis1)));
633 wsProfile2D->setHistogram(1, profilePoints, Counts(std::move(principalaxis2)));
634 wsProfile2D->setHistogram(2, profilePoints, Counts(std::move(principalaxis3)));
641 peak_ws->mutableRun().addProperty(
"PeaksIntegrated", 1,
true);
643 peak_ws->mutableRun().addProperty(
"PeakRadius", PeakRadiusVector,
true);
644 peak_ws->mutableRun().addProperty(
"BackgroundInnerRadius", BackgroundInnerRadiusVector,
true);
645 peak_ws->mutableRun().addProperty(
"BackgroundOuterRadius", BackgroundOuterRadiusVector,
true);
664 childAlg->setProperty(
"InputWorkspace", wksp);
665 childAlg->executeAsChildAlg();
669 throw(std::runtime_error(
"Can not retrieve results of \"PreprocessDetectorsToMD\""));
688 for (
size_t i = 0; i < detectorInfo.
size(); ++i) {
693 const auto &det = detectorInfo.
detector(i);
695 double ph1 = det.getPhi();
696 V3D E1 =
V3D(-std::sin(tt1) * std::cos(ph1), -std::sin(tt1) * std::sin(ph1),
698 E1 =
E1 * (1. /
E1.norm());
704 const std::string &property,
const std::string &values) {
707 alg->setProperty(property, values);
709 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.
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.
A validator which checks that a workspace has a valid instrument.
Helper class for reporting progress from algorithms.
A property class for workspaces.
A validator which checks that the unit of the workspace referred to by a WorkspaceProperty is the exp...
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.
static double Optimize_6dUB(Kernel::DblMatrix &UB, Kernel::DblMatrix &ModUB, const std::vector< Kernel::V3D > &hkl_vectors, const std::vector< Kernel::V3D > &mnp_vectors, const int &ModDim, const std::vector< Kernel::V3D > &q_vectors, std::vector< double > &sigabc, std::vector< double > &sigq)
STATIC method Optimize_UB: Calculates the matrix that most nearly maps the specified hkl_vectors to t...
static bool ValidIndex(const Kernel::V3D &hkl, double tolerance)
Check is hkl is within tolerance of integer (h,k,l) non-zero values.
Class to implement UB matrix.
void setModUB(const Kernel::DblMatrix &newModUB)
Sets the Modulation UB matrix.
void setUB(const Kernel::DblMatrix &newUB)
Sets the UB matrix and recalculates lattice parameters.
const Kernel::DblMatrix & getUB() const
Get the UB matrix.
const Kernel::DblMatrix & getModUB() const
int getMaxOrder() const
Get max order.
const Kernel::DblMatrix & getModHKL() const
Get modulation vectors for satellites.
bool getCrossTerm() const
Get cross term boolean.
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 notice(const std::string &msg)
Logs at notice level.
void error(const std::string &msg)
Logs at error level.
T Invert()
LU inversion routine.
void report()
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.
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
This is a low-level class to construct a map with lists of events near each peak Q-vector,...
std::shared_ptr< const Mantid::Geometry::PeakShape > ellipseIntegrateModEvents(const std::vector< Kernel::V3D > &E1Vec, Mantid::Kernel::V3D const &peak_q, Mantid::Kernel::V3D const &hkl, Mantid::Kernel::V3D const &mnp, bool specify_size, double peak_radius, double back_inner_radius, double back_outer_radius, std::vector< double > &axes_radii, double &inti, double &sigi)
Find the net integrated intensity of a modulated peak, using ellipsoidal volumes.
void addEvents(std::vector< std::pair< std::pair< double, double >, Mantid::Kernel::V3D > > const &event_qs, bool hkl_integ)
Add event Q's to lists of events near peaks.
int version() const override
Algorithm's version for identification.
static void initInstance(API::Algorithm &alg)
std::vector< Kernel::V3D > E1Vec
save for all detector pixels
MDWSDescription m_targWSDescr
void runMaskDetectors(const Mantid::DataObjects::PeaksWorkspace_sptr &peakWS, const std::string &property, const std::string &values)
void initTargetWSDescr(API::MatrixWorkspace_sptr &wksp)
IntegrateEllipsoidsV1::initTargetWSDescr Initialize the output information for the MD conversion fram...
void qListFromEventWS(Integrate3DEvents &integrator, API::Progress &prog, DataObjects::EventWorkspace_sptr &wksp, Kernel::DblMatrix const &UBinv, bool hkl_integ)
qListFromEventWS creates qlist from events
void calculateE1(const Geometry::DetectorInfo &detectorInfo)
Calculate if this Q is on a detector.
void qListFromHistoWS(Integrate3DEvents &integrator, API::Progress &prog, DataObjects::Workspace2D_sptr &wksp, Kernel::DblMatrix const &UBinv, bool hkl_integ)
qListFromHistoWS creates qlist from input workspaces of type Workspace2D
void exec() override
Execute the algorithm.
const std::string category() const override
Algorithm's category for identification.
void init() override
Initialize the algorithm's properties.
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::shared_ptr< IAlgorithm > IAlgorithm_sptr
shared pointer to Mantid::API::IAlgorithm
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.
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.
Helper class which provides the Collimation Length for SANS instruments.
constexpr double EMPTY_DBL() noexcept
Returns what we consider an "empty" double within a property.
@ InOut
Both an input & output workspace.
@ Input
An input workspace.
@ Output
An output workspace.
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