36bool compareMomentum(
const std::array<double, 4> &v1,
const std::array<double, 4> &v2) {
return (v1[3] < v2[3]); }
37const std::string LOG_CHARGE_NAME(
"proton_charge");
47 : m_normWS(), m_inputWS(), m_hmin(0.0f), m_hmax(0.0f), m_kmin(0.0f), m_kmax(0.0f), m_lmin(0.0f), m_lmax(0.0f),
48 m_dEmin(0.f), m_dEmax(0.f), m_Ei(0.), m_ki(0.), m_kfmin(0.), m_kfmax(0.), m_hIntegrated(true),
49 m_kIntegrated(true), m_lIntegrated(true), m_dEIntegrated(true), m_rubw(3, 3), m_hIdx(-1), m_kIdx(-1), m_lIdx(-1),
50 m_eIdx(-1), m_hX(), m_kX(), m_lX(), m_eX(), m_samplePos(), m_beamDir() {}
60 return "Calculate normalization for an MDEvent workspace for single crystal "
61 "direct geometry inelastic measurement.";
72 "An input MDWorkspace.");
77 for (
size_t i = 0; i < dimChars.size(); i++) {
80 std::string propName =
"AlignedDim" + dim;
84 "Enter it as a comma-separated list of values with the format: "
85 "'name,minimum,maximum,number_of_bins'. Leave blank for NONE.");
88 auto solidAngleValidator = std::make_shared<CompositeValidator>();
92 m_progress = std::make_unique<API::Progress>(
this, 0, 1, 1);
96 "An input workspace containing integrated vanadium (a measure of the "
100 "If set to true, the algorithm does "
101 "not check history if the workspace was modified since the"
102 "ConvertToMD algorithm was run, and assume that the direct "
103 "geometry inelastic mode is used.");
107 "An input MDHistoWorkspace used to accumulate normalization "
108 "from multiple MDEventWorkspaces. If unspecified a blank "
109 "MDHistoWorkspace will be created.");
113 "An input MDHistoWorkspace used to accumulate data from "
114 "multiple MDEventWorkspaces. If unspecified a blank "
115 "MDHistoWorkspace will be created.");
118 "A name for the output data MDHistoWorkspace.");
120 "A name for the output normalization MDHistoWorkspace.");
130 convention = Kernel::ConfigService::Instance().getString(
"Q.convention");
132 setProperty<Workspace_sptr>(
"OutputWorkspace", outputWS);
141 for (uint16_t expInfoIndex = 0; expInfoIndex <
m_numExptInfos; expInfoIndex++) {
142 const auto ¤tExptInfo = *(
m_inputWS->getExperimentInfo(expInfoIndex));
143 if (!currentExptInfo.run().hasProperty(
"RUBW_MATRIX")) {
144 throw std::runtime_error(
"Wokspace does not contain a log entry for the RUBW matrix."
149 bool skipNormalization =
false;
154 if (!skipNormalization) {
155 if (currentExptInfo.run().hasProperty(
"useLogTimes")) {
161 g_log.
warning(
"Binning limits are outside the limits of the MDWorkspace. "
162 "Not applying normalization.");
169 outputWS->setDisplayNormalization(
m_inputWS->displayNormalizationHisto());
179 throw std::invalid_argument(
"Invalid energy transfer mode. Algorithm only "
180 "supports direct geometry spectrometers.");
185 m_hmin = hdim->getMinimum();
186 m_kmin = kdim->getMinimum();
187 m_lmin = ldim->getMinimum();
189 m_hmax = hdim->getMaximum();
190 m_kmax = kdim->getMaximum();
191 m_lmax = ldim->getMaximum();
194 const auto &exptInfoZero = *(
m_inputWS->getExperimentInfo(0));
195 auto source = exptInfoZero.getInstrument()->getSource();
196 auto sample = exptInfoZero.getInstrument()->getSample();
197 if (source ==
nullptr || sample ==
nullptr) {
199 "Instrument not sufficiently defined: failed to get source and/or "
205 double originaldEmin = exptInfoZero.run().getBinBoundaries().front();
206 double originaldEmax = exptInfoZero.run().getBinBoundaries().back();
207 if (exptInfoZero.run().hasProperty(
"Ei")) {
208 m_Ei = exptInfoZero.run().getPropertyValueAsType<
double>(
"Ei");
210 throw std::invalid_argument(
"Ei stored in the workspace is not positive");
213 throw std::invalid_argument(
"Could not find Ei value in the workspace.");
216 if (
m_Ei - originaldEmin < eps) {
217 originaldEmin =
m_Ei - eps;
219 if (
m_Ei - originaldEmax < eps) {
220 originaldEmax =
m_Ei - 1e-7;
222 if (originaldEmin == originaldEmax) {
223 throw std::runtime_error(
"The limits of the original workspace used in "
224 "ConvertToMD are incorrect");
229 m_kfmin = std::sqrt(energyToK * (
m_Ei - originaldEmin));
230 m_kfmax = std::sqrt(energyToK * (
m_Ei - originaldEmax));
238 const auto &hist =
m_inputWS->getHistory();
239 const size_t nalgs = hist.size();
240 const auto &lastAlgHist = hist.getAlgorithmHistory(nalgs - 1);
243 if (lastAlgHist->name() ==
"ConvertToMD") {
245 emode = lastAlgHist->getPropertyValue(
"dEAnalysisMode");
247 if ((lastAlgHist->name() ==
"Load" || lastAlgHist->name() ==
"LoadMD") && nalgs > 1) {
248 const auto &penultimateAlgHist = hist.getAlgorithmHistory(nalgs - 2);
249 if (penultimateAlgHist->name() ==
"ConvertToMD") {
250 return penultimateAlgHist->getPropertyValue(
"dEAnalysisMode");
253 throw std::invalid_argument(
"The last algorithm in the history of the "
254 "input workspace is not ConvertToMD");
267 binMD->setPropertyValue(
"AxisAligned",
"1");
268 for (
auto prop : props) {
269 const auto &propName = prop->name();
270 if (propName !=
"SolidAngleWorkspace" && propName !=
"TemporaryNormalizationWorkspace" &&
271 propName !=
"OutputNormalizationWorkspace" && propName !=
"SkipSafetyCheck") {
272 binMD->setPropertyValue(propName, prop->value());
275 binMD->executeAsChildAlg();
277 return std::dynamic_pointer_cast<MDHistoWorkspace>(outputWS);
286 std::shared_ptr<IMDHistoWorkspace>
tmp = this->
getProperty(
"TemporaryNormalizationWorkspace");
287 m_normWS = std::dynamic_pointer_cast<MDHistoWorkspace>(
tmp);
303 uint16_t expInfoIndex)
const {
304 const auto ¤tRun =
m_inputWS->getExperimentInfo(expInfoIndex)->run();
306 std::vector<coord_t> otherDimValues;
307 for (
size_t i = 4; i <
m_inputWS->getNumDims(); i++) {
308 const auto dimension =
m_inputWS->getDimension(i);
309 auto dimMin =
static_cast<float>(dimension->getMinimum());
310 auto dimMax =
static_cast<float>(dimension->getMaximum());
313 auto value =
static_cast<coord_t>(dimProp->firstValue());
314 otherDimValues.emplace_back(
value);
317 if (value < dimMin || value > dimMax) {
318 skipNormalization =
true;
322 return otherDimValues;
335 bool &skipNormalization) {
340 const size_t nrm1 = affineMat.
numRows() - 1;
341 const size_t ncm1 = affineMat.
numCols() - 1;
342 for (
size_t row = 0; row < nrm1; row++)
344 const auto dimen =
m_normWS->getDimension(row);
345 const auto dimMin(dimen->getMinimum()), dimMax(dimen->getMaximum());
346 if (affineMat[row][0] == 1.) {
352 skipNormalization =
true;
355 if (affineMat[row][1] == 1.) {
361 skipNormalization =
true;
364 if (affineMat[row][2] == 1.) {
370 skipNormalization =
true;
374 if (affineMat[row][3] == 1.) {
380 skipNormalization =
true;
383 for (
size_t col = 4; col < ncm1; col++)
385 if (affineMat[row][col] == 1.) {
386 double val = otherDimValues.at(col - 3);
387 if (val > dimMax || val < dimMin) {
388 skipNormalization =
true;
406 m_hX.resize(hDim.getNBoundaries());
407 for (
size_t i = 0; i <
m_hX.size(); ++i) {
408 m_hX[i] = hDim.getX(i);
413 m_kX.resize(kDim.getNBoundaries());
414 for (
size_t i = 0; i <
m_kX.size(); ++i) {
415 m_kX[i] = kDim.getX(i);
420 m_lX.resize(lDim.getNBoundaries());
421 for (
size_t i = 0; i <
m_lX.size(); ++i) {
422 m_lX[i] = lDim.getX(i);
428 m_eX.resize(eDim.getNBoundaries());
429 for (
size_t i = 0; i <
m_eX.size(); ++i) {
430 double temp =
m_Ei - eDim.getX(i);
431 temp = std::max(temp, 0.);
432 m_eX[i] = std::sqrt(energyToK * temp);
447 const auto ¤tExptInfo = *(
m_inputWS->getExperimentInfo(expInfoIndex));
448 const auto &spectrumInfo = currentExptInfo.spectrumInfo();
451 m_rubw = currentExptInfo.run().getGoniometerMatrix() * rubwValue;
453 const double protonCharge = currentExptInfo.run().getProtonCharge();
467 const auto ¤tExptInfo = *(
m_inputWS->getExperimentInfo(expInfoIndex));
468 const auto &spectrumInfo = currentExptInfo.spectrumInfo();
474 const Run &run = currentExptInfo.run();
476 throw std::runtime_error(
"Wokspace does not contain the proton charge log. Cannot continue.");
480 double progressEnd = 0.3 + 0.7 * (expInfoIndex + 1) /
m_numExptInfos;
481 double normfac = run.
hasProperty(
"NormalizationFactor")
484 std::istringstream tosplit;
486 std::vector<TimeSeriesProperty<double> *> logs;
487 std::vector<size_t> movingGonioIndex;
490 std::vector<Types::Core::DateAndTime> protonTimes = protonlog->
timesAsVector();
493 for (std::string
name; std::getline(tosplit,
name,
',');) {
497 movingGonioIndex.push_back(logs.size() - 1);
502 if (protonlog->
units().find(
"picoCoulomb") != std::string::npos) {
506 if (movingGonioIndex.size() == 1) {
510 const auto &gonioAxLog = logs[movingGonioIndex[0]];
511 std::vector<double> filteredVals = gonioAxLog->filteredValuesAsVector(&timeroi);
512 const auto &[min, max] = std::minmax_element(filteredVals.begin(), filteredVals.end());
513 std::vector<double> gonioCharge(
static_cast<int>((*max - *min) /
GONIOBINSTEP) + 1, 0.0);
514 for (
size_t n = 0;
n < protonCharge.size();
n++) {
515 double logval = gonioAxLog->getSingleValue(protonTimes[
n]);
516 if (std::isnan(logval) || logval > *max || logval < *min) {
519 auto idx =
static_cast<size_t>(floor((logval - *min) /
GONIOBINSTEP));
520 gonioCharge[idx] += protonCharge[
n];
522 m_progress->resetNumSteps(
static_cast<int64_t
>(gonioCharge.size()), progressStart, progressEnd);
523 for (
size_t n = 0;
n < gonioCharge.size();
n++) {
527 auto nn =
static_cast<double>(
n);
536 double chargeSum = 0.0;
538 bool skipIter =
false;
539 m_progress->resetNumSteps(
static_cast<int64_t
>(protonCharge.size()), progressStart, progressEnd);
540 for (
size_t n = 0;
n < protonCharge.size();
n++) {
541 chargeSum += protonCharge[
n];
543 size_t mid =
static_cast<int>(floor(
static_cast<double>(
n - i0) / 2.));
546 double logval = logs[gAx]->getSingleValue(protonTimes[mid]);
547 if (std::isnan(logval)) {
570 const std::vector<coord_t> &otherValues,
575 const auto ndets =
static_cast<int64_t
>(spectrumInfo.
size());
579 if (solidAngleWS !=
nullptr) {
581 solidAngDetToIdx = solidAngleWS->getDetectorIDToWorkspaceIndexMap();
584 const size_t vmdDims = 4;
587 for (int64_t i = 0; i < ndets; i++) {
593 const auto &detector = spectrumInfo.
detector(i);
595 double phi = detector.getPhi();
597 const auto detID = detector.getID();
600 std::vector<std::array<double, 4>> intersections;
601 std::vector<coord_t> pos, posNew;
603 if (intersections.empty())
607 double solid = protonCharge;
609 solid = solidAngleWS->y(solidAngDetToIdx.find(detID)->second)[0] * protonCharge;
613 pos.resize(vmdDims + otherValues.size() + 1);
614 std::copy(otherValues.begin(), otherValues.end(), pos.begin() + vmdDims);
615 pos.emplace_back(1.f);
616 for (
auto it = intersections.begin() + 1; it != intersections.end(); ++it) {
617 const auto &curIntSec = *it;
618 const auto &prevIntSec = *(it - 1);
620 double delta = (curIntSec[3] * curIntSec[3] - prevIntSec[3] * prevIntSec[3]) / energyToK;
625 std::transform(curIntSec.data(), curIntSec.data() + vmdDims, prevIntSec.data(), pos.begin(),
626 [](
const double rhs,
const double lhs) { return static_cast<coord_t>(0.5 * (rhs + lhs)); });
629 pos[3] =
static_cast<coord_t>(
m_Ei - pos[3] * pos[3] / energyToK);
631 size_t linIndex =
m_normWS->getLinearIndexAtCoord(posNew.data());
632 if (linIndex ==
static_cast<size_t>(-1))
637 double signal = solid *
delta;
655 V3D qout(sin(theta) * cos(phi), sin(theta) * sin(phi), cos(theta)), qin(0., 0.,
m_ki);
663 double hStart = qin.
X() - qout.X() *
m_kfmin, hEnd = qin.
X() - qout.X() *
m_kfmax;
664 double kStart = qin.
Y() - qout.Y() *
m_kfmin, kEnd = qin.
Y() - qout.Y() *
m_kfmax;
665 double lStart = qin.
Z() - qout.Z() *
m_kfmin, lEnd = qin.
Z() - qout.Z() *
m_kfmax;
667 auto hNBins =
m_hX.size();
668 auto kNBins =
m_kX.size();
669 auto lNBins =
m_lX.size();
670 auto eNBins =
m_eX.size();
671 intersections.clear();
672 intersections.reserve(hNBins + kNBins + lNBins + eNBins + 8);
675 if (
fabs(hStart - hEnd) > eps) {
677 double fk = (kEnd - kStart) / (hEnd - hStart);
678 double fl = (lEnd - lStart) / (hEnd - hStart);
680 for (
size_t i = 0; i < hNBins; i++) {
682 if ((hi >=
m_hmin) && (hi <=
m_hmax) && ((hStart - hi) * (hEnd - hi) < 0)) {
686 double ki = fk * (hi - hStart) + kStart;
687 double li = fl * (hi - hStart) + lStart;
689 double momi = fmom * (hi - hStart) +
m_kfmin;
690 intersections.push_back({{hi, ki, li, momi}});
699 double khmin = fk * (
m_hmin - hStart) + kStart;
700 double lhmin = fl * (
m_hmin - hStart) + lStart;
702 intersections.push_back({{
m_hmin, khmin, lhmin, momhMin}});
708 double khmax = fk * (
m_hmax - hStart) + kStart;
709 double lhmax = fl * (
m_hmax - hStart) + lStart;
711 intersections.push_back({{
m_hmax, khmax, lhmax, momhMax}});
717 if (
fabs(kStart - kEnd) > eps) {
719 double fh = (hEnd - hStart) / (kEnd - kStart);
720 double fl = (lEnd - lStart) / (kEnd - kStart);
722 for (
size_t i = 0; i < kNBins; i++) {
724 if ((ki >=
m_kmin) && (ki <=
m_kmax) && ((kStart - ki) * (kEnd - ki) < 0)) {
728 double hi = fh * (ki - kStart) + hStart;
729 double li = fl * (ki - kStart) + lStart;
731 double momi = fmom * (ki - kStart) +
m_kfmin;
732 intersections.push_back({{hi, ki, li, momi}});
740 double hkmin = fh * (
m_kmin - kStart) + hStart;
741 double lkmin = fl * (
m_kmin - kStart) + lStart;
743 intersections.push_back({{hkmin,
m_kmin, lkmin, momkMin}});
749 double hkmax = fh * (
m_kmax - kStart) + hStart;
750 double lkmax = fl * (
m_kmax - kStart) + lStart;
752 intersections.push_back({{hkmax,
m_kmax, lkmax, momkMax}});
758 if (
fabs(lStart - lEnd) > eps) {
760 double fh = (hEnd - hStart) / (lEnd - lStart);
761 double fk = (kEnd - kStart) / (lEnd - lStart);
763 for (
size_t i = 0; i < lNBins; i++) {
765 if ((li >=
m_lmin) && (li <=
m_lmax) && ((lStart - li) * (lEnd - li) < 0)) {
766 double hi = fh * (li - lStart) + hStart;
767 double ki = fk * (li - lStart) + kStart;
769 double momi = fmom * (li - lStart) +
m_kfmin;
770 intersections.push_back({{hi, ki, li, momi}});
778 double hlmin = fh * (
m_lmin - lStart) + hStart;
779 double klmin = fk * (
m_lmin - lStart) + kStart;
781 intersections.push_back({{hlmin, klmin,
m_lmin, momlMin}});
787 double hlmax = fh * (
m_lmax - lStart) + hStart;
788 double klmax = fk * (
m_lmax - lStart) + kStart;
790 intersections.push_back({{hlmax, klmax,
m_lmax, momlMax}});
797 for (
size_t i = 0; i < eNBins; i++) {
798 double kfi =
m_eX[i];
800 double h = qin.
X() - qout.X() * kfi;
801 double k = qin.
Y() - qout.Y() * kfi;
802 double l = qin.
Z() - qout.Z() * kfi;
804 intersections.push_back({{h, k, l, kfi}});
813 intersections.push_back({{hStart, kStart, lStart,
m_kfmin}});
817 intersections.push_back({{hEnd, kEnd, lEnd,
m_kfmax}});
821 std::stable_sort(intersections.begin(), intersections.end(), compareMomentum);
#define DECLARE_ALGORITHM(classname)
const std::vector< double > & rhs
double value
The value of the point.
#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_END_INTERRUPT_REGION
Ends a block to skip processing is the algorithm has been interupted Note the start of the block if n...
#define PRAGMA_OMP(expression)
#define PARALLEL_CHECK_INTERRUPT_REGION
Adds a check after a Parallel region to see if it was interupted.
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.
const std::vector< Kernel::Property * > & getProperties() const override
Get the list of managed properties.
A validator which provides a TENTATIVE check that a workspace contains common bins in each spectrum.
A validator which checks that a workspace has a valid instrument.
bool hasProperty(const std::string &name) const
Does the property exist on the object.
const Kernel::TimeROI & getTimeROI() const
Kernel::Property * getProperty(const std::string &name) const
Returns the named property as a pointer.
Kernel::TimeSeriesProperty< T > * getTimeSeriesProperty(const std::string &name) const
Returns a property as a time series property.
This class stores information regarding an experimental run as a series of log entries.
const Geometry::Goniometer & getGoniometer() const
Return reference to the first const Goniometer object for this run.
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
bool isMonitor(const size_t index) const
Returns true if the detector(s) associated with the spectrum are monitors.
bool hasDetectors(const size_t index) const
Returns true if the spectrum is associated with detectors in the instrument.
bool isMasked(const size_t index) const
Returns true if the detector(s) associated with the spectrum are masked.
const Geometry::IDetector & detector(const size_t index) const
Return a const reference to the detector or detector group of the spectrum with given index.
size_t size() const
Returns the size of the SpectrumInfo, i.e., the number of spectra.
A property class for workspaces.
std::unique_ptr< MDHistoWorkspace > clone() const
Returns a clone of the workspace.
Class to represent a particular goniometer setting, which is described by the rotation matrix.
void setRotationAngle(const std::string &name, double value)
Set rotation angle for an axis using motor name.
size_t getNumberAxes() const
const Kernel::DblMatrix & getR() const
Return global rotation matrix.
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.
Exception for errors associated with the instrument definition.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void warning(const std::string &msg)
Logs at warning level.
T Invert()
LU inversion routine.
void multiplyPoint(const std::vector< T > &in, std::vector< T > &out) const
Multiply M*Vec.
size_t numRows() const
Return the number of rows in the matrix.
size_t numCols() const
Return the number of columns in the matrix.
The concrete, templated class for properties.
virtual const std::string & units() const
Returns the units of the property, if any, as a string.
TimeROI : Object that holds information about when the time measurement was active.
A specialised Property class for holding a series of time-value pairs.
std::vector< TYPE > valuesAsVector() const
Return the time series's values (unfiltered) as a vector<TYPE>
std::vector< Types::Core::DateAndTime > timesAsVector() const override
Return the time series's times as a vector<DateAndTime>
constexpr double X() const noexcept
Get x.
constexpr double Y() const noexcept
Get y.
constexpr double Z() const noexcept
Get z.
MDNormSCD : Generate MD normalization for single crystal diffraction.
DataObjects::MDHistoWorkspace_sptr binInputWS()
Runs the BinMD algorithm on the input to provide the output workspace All slicing algorithm propertie...
Mantid::Kernel::DblMatrix m_rubw
(2*PiRUBW)^-1
static constexpr double CHARGEBINSIZE
API::IMDEventWorkspace_sptr m_inputWS
Input workspace.
void calculateNormInner(const API::SpectrumInfo &spectrumInfo, const double protonCharge, const std::vector< coord_t > &otherValues, const Kernel::Matrix< coord_t > &affineTrans)
double m_Ei
cached values for incident energy and momentum, final momentum min/max
int version() const override
Algorithm's version for identification.
std::vector< std::atomic< signal_t > > m_signalArray
internal array to accumulate signals to avoid copying (serial) each loop
Kernel::V3D m_samplePos
Sample position.
void calculateNormContinuous(const std::vector< coord_t > &otherValues, const Kernel::Matrix< coord_t > &affineTrans, uint16_t expInfoIndex)
Computes the normalization for the input workspace for the case of a continous rotation.
Kernel::V3D m_beamDir
Beam direction.
void calculateNormalization(const std::vector< coord_t > &otherValues, const Kernel::Matrix< coord_t > &affineTrans, uint16_t expInfoIndex)
Computed the normalization for the input workspace.
static constexpr double GONIOBINSTEP
void createNormalizationWS(const DataObjects::MDHistoWorkspace &dataWS)
Create & cached the normalization workspace.
DataObjects::MDHistoWorkspace_sptr m_normWS
Normalization workspace.
std::vector< double > m_lX
bool m_hIntegrated
flag for integrated h,k,l, dE dimensions
Kernel::Matrix< coord_t > findIntergratedDimensions(const std::vector< coord_t > &otherDimValues, bool &skipNormalization)
Checks the normalization workspace against the indices of the original dimensions.
const std::string name() const override
Algorithm's name for use in the GUI and help.
coord_t m_hmin
limits for h,k,l, dE dimensions
static constexpr double STATIONARYANGLIM
std::vector< coord_t > getValuesFromOtherDimensions(bool &skipNormalization, uint16_t expInfoIndex=0) const
Retrieve logged values from non-HKL dimensions.
void calculateIntersections(std::vector< std::array< double, 4 > > &intersections, const double theta, const double phi)
Calculate the points of intersection for the given detector with cuboid surrounding the detector posi...
void cacheInputs()
Set up starting values for cached variables.
std::unique_ptr< API::Progress > m_progress
Progress bar.
void init() override
Initialize the algorithm's properties.
const std::string summary() const override
Algorithm's summary for use in the GUI and help.
uint16_t m_numExptInfos
number of experiment infos
std::vector< double > m_eX
std::vector< double > m_hX
cached X values along dimensions h,k,l. dE
const std::string category() const override
Algorithm's category for identification.
std::vector< double > m_kX
size_t m_hIdx
index of h,k,l, dE dimensions in the output workspaces
std::string convention
ki-kf for Inelastic convention; kf-ki for Crystallography convention
void cacheDimensionXValues()
Stores the X values from each H,K,L,E dimension as member variables Energy dimension is transformed t...
static constexpr double MINPROTONCHARGE
std::string inputEnergyMode() const
Currently looks for the ConvertToMD algorithm in the history.
void exec() override
Execute the algorithm.
static std::string getDimensionChars()
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
@ NoNormalization
Don't normalize = return raw counts.
std::shared_ptr< MDHistoWorkspace > MDHistoWorkspace_sptr
A shared pointer to a MDHistoWorkspace.
std::string toString(const T &value)
Convert a number to a string.
MANTID_KERNEL_DLL V3D normalize(V3D v)
Normalizes a V3D.
void AtomicOp(std::atomic< T > &f, T d, BinaryOp op)
Uses std::compare_exchange_weak to update the atomic value f = op(f, d) Used to improve parallel scal...
Kernel::PropertyWithValue< std::vector< double > > VectorDoubleProperty
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.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...
std::unordered_map< detid_t, size_t > detid2index_map
Map with key = detector ID, value = workspace index.
Describes the direction (within an algorithm) of a Property.
@ Input
An input workspace.
@ Output
An output workspace.