Mantid
Loading...
Searching...
No Matches
DgsConvertToEnergyTransfer.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
9#include "MantidAPI/Run.h"
20
21#include <boost/lexical_cast.hpp>
22
23using namespace Mantid::Kernel;
24using namespace Mantid::API;
25using namespace Mantid::Geometry;
26using namespace WorkflowAlgorithmHelpers;
27
29
30// Register the algorithm into the AlgorithmFactory
31DECLARE_ALGORITHM(DgsConvertToEnergyTransfer)
32
33
34const std::string DgsConvertToEnergyTransfer::name() const { return "DgsConvertToEnergyTransfer"; }
35
37int DgsConvertToEnergyTransfer::version() const { return 1; }
38
40const std::string DgsConvertToEnergyTransfer::category() const { return "Workflow\\Inelastic\\UsesPropertyManager"; }
41
45 this->declareProperty(std::make_unique<WorkspaceProperty<>>("InputWorkspace", "", Direction::Input),
46 "A sample data workspace.");
47 this->declareProperty(
48 std::make_unique<WorkspaceProperty<>>("InputMonitorWorkspace", "", Direction::Input, PropertyMode::Optional),
49 "A monitor workspace associated with the sample workspace.");
50 this->declareProperty("IncidentEnergyGuess", EMPTY_DBL(),
51 "This is the starting point for the incident energy calculation.");
52 this->declareProperty(
53 std::make_unique<WorkspaceProperty<>>("IntegratedDetectorVanadium", "", Direction::Input, PropertyMode::Optional),
54 "A workspace containing the "
55 "integrated detector vanadium.");
56 this->declareProperty(std::make_unique<WorkspaceProperty<MatrixWorkspace>>("MaskWorkspace", "", Direction::Input,
58 "A mask workspace");
59 this->declareProperty(std::make_unique<WorkspaceProperty<MatrixWorkspace>>("GroupingWorkspace", "", Direction::Input,
61 "A grouping workspace");
62 this->declareProperty("AlternateGroupingTag", "", "Allows modification to the OldGroupingFile property name");
63 this->declareProperty(std::make_unique<WorkspaceProperty<>>("OutputWorkspace", "", Direction::Output),
64 "The name for the output workspace.");
65 this->declareProperty(std::make_unique<WorkspaceProperty<>>("OutputTibWorkspace", "", Direction::Output),
66 "The name for the output TIB workspace.");
67 this->declareProperty("ReductionProperties", "__dgs_reduction_properties", Direction::Input);
68}
69
73 g_log.notice() << "Starting DgsConvertToEnergyTransfer\n";
74 // Get the reduction property manager
75 const std::string reductionManagerName = this->getProperty("ReductionProperties");
76 std::shared_ptr<PropertyManager> reductionManager;
77 if (PropertyManagerDataService::Instance().doesExist(reductionManagerName))
78 reductionManager = PropertyManagerDataService::Instance().retrieve(reductionManagerName);
79 else
80 throw std::runtime_error("DgsConvertToEnergyTransfer cannot run without a "
81 "reduction PropertyManager.");
82
83 MatrixWorkspace_sptr inputWS = this->getProperty("InputWorkspace");
84 MatrixWorkspace_sptr outputWS = this->getProperty("OutputWorkspace");
85 MatrixWorkspace_sptr monWS = this->getProperty("InputMonitorWorkspace");
86
87 // Make a monitor workspace name for SNS data
88 std::string monWsName = inputWS->getName() + "_monitors";
89 bool preserveEvents = false;
90
91 // Calculate the initial energy and time zero
92 const std::string facility = ConfigService::Instance().getFacility().name();
93 g_log.notice() << "Processing for " << facility << '\n';
94 double eiGuess = this->getProperty("IncidentEnergyGuess");
95 if (EMPTY_DBL() == eiGuess) {
96 // SNS has a log called EnergyRequest that can be used to get the
97 // incident energy guess.
98 if ("SNS" == facility) {
99 const TimeSeriesProperty<double> *eiLog = inputWS->run().getTimeSeriesProperty<double>("EnergyRequest");
100 eiGuess = eiLog->getStatistics().mean;
101 } else {
102 throw std::runtime_error("Incident energy guess MUST be given!");
103 }
104 }
105 const bool useEiGuess = reductionManager->getProperty("UseIncidentEnergyGuess");
106 const double tZeroGuess = reductionManager->getProperty("TimeZeroGuess");
107 std::vector<double> etBinning = reductionManager->getProperty("EnergyTransferRange");
108
109 // Create a default set of binning parameters: (-0.5Ei, 0.01Ei, 0.99Ei)
110 if (etBinning.empty()) {
111 double emin = -0.5 * eiGuess;
112 double deltaE = 0.01 * eiGuess;
113 double emax = 0.99 * eiGuess;
114 etBinning.emplace_back(emin);
115 etBinning.emplace_back(deltaE);
116 etBinning.emplace_back(emax);
117 }
118
119 double incidentEnergy = 0.0;
120 double monPeak = 0.0;
121 specnum_t eiMon1Spec = static_cast<specnum_t>(reductionManager->getProperty("Monitor1SpecId"));
122 specnum_t eiMon2Spec = static_cast<specnum_t>(reductionManager->getProperty("Monitor2SpecId"));
123
124 if ("SNS" == facility) {
125 // SNS wants to preserve events until the last
126 preserveEvents = true;
127 double tZero = 0.0;
128 if (useEiGuess) {
129 incidentEnergy = eiGuess;
130 if (EMPTY_DBL() != tZeroGuess)
131 tZero = tZeroGuess;
132 } else {
133 if (!monWS) {
134 g_log.notice() << "Trying to determine file name\n";
135 std::string runFileName = inputWS->run().getProperty("Filename")->value();
136 if (runFileName.empty())
137 throw std::runtime_error("Cannot find run filename, therefore cannot "
138 "find the initial energy");
139
140 std::string loadAlgName;
141 std::string fileProp;
142 if (runFileName.ends_with("_event.nxs") || runFileName.ends_with(".nxs.h5") || runFileName.ends_with(".nxs")) {
143 g_log.notice() << "Loading NeXus monitors\n";
144 loadAlgName = "LoadNexusMonitors";
145 fileProp = "Filename";
146 }
147
148 // Load the monitors
149 auto loadmon = createChildAlgorithm(loadAlgName);
150 loadmon->setProperty(fileProp, runFileName);
151 loadmon->setProperty("OutputWorkspace", monWsName);
152 loadmon->executeAsChildAlg();
153 Workspace_sptr monWSOutput = loadmon->getProperty("OutputWorkspace");
154 // the algorithm can return a group workspace if the file is multi
155 // period
156 monWS = std::dynamic_pointer_cast<MatrixWorkspace>(monWSOutput);
157 if ((monWSOutput) && (!monWS))
158 // this was a group workspace - DGSReduction does not support multi
159 // period data yet
160 throw Exception::NotImplementedError("The file contains multi period data, support for this is not "
161 "implemented in DGSReduction yet");
162 }
163
164 // Calculate Ei
165 auto getei = createChildAlgorithm("GetEi");
166 getei->setProperty("InputWorkspace", monWS);
167 getei->setProperty("Monitor1Spec", eiMon1Spec);
168 getei->setProperty("Monitor2Spec", eiMon2Spec);
169 getei->setProperty("EnergyEstimate", eiGuess);
170 getei->executeAsChildAlg();
171 incidentEnergy = getei->getProperty("IncidentEnergy");
172 tZero = getei->getProperty("Tzero");
173 }
174
175 g_log.notice() << "Adjusting for T0\n";
176 auto alg = createChildAlgorithm("ChangeBinOffset");
177 alg->setProperty("InputWorkspace", inputWS);
178 alg->setProperty("OutputWorkspace", outputWS);
179 alg->setProperty("Offset", -tZero);
180 alg->executeAsChildAlg();
181 outputWS = alg->getProperty("OutputWorkspace");
182
183 // Add T0 to sample logs
184 auto addLog = createChildAlgorithm("AddSampleLog");
185 addLog->setProperty("Workspace", outputWS);
186 addLog->setProperty("LogName", "CalculatedT0");
187 addLog->setProperty("LogType", "Number");
188 addLog->setProperty("LogText", boost::lexical_cast<std::string>(tZero));
189 addLog->executeAsChildAlg();
190 }
191 // Do ISIS
192 else {
193 auto getei = createChildAlgorithm("GetEi");
194 getei->setProperty("InputWorkspace", inputWS);
195 getei->setProperty("Monitor1Spec", eiMon1Spec);
196 getei->setProperty("Monitor2Spec", eiMon2Spec);
197 getei->setProperty("EnergyEstimate", eiGuess);
198 getei->executeAsChildAlg();
199
200 monPeak = getei->getProperty("FirstMonitorPeak");
201 const specnum_t monIndex = static_cast<specnum_t>(getei->getProperty("FirstMonitorIndex"));
202 // Why did the old way get it from the log?
203 incidentEnergy = getei->getProperty("IncidentEnergy");
204
205 auto cbo = createChildAlgorithm("ChangeBinOffset");
206 cbo->setProperty("InputWorkspace", inputWS);
207 cbo->setProperty("OutputWorkspace", outputWS);
208 cbo->setProperty("Offset", -monPeak);
209 cbo->executeAsChildAlg();
210 outputWS = cbo->getProperty("OutputWorkspace");
211
212 const auto &specInfo = inputWS->spectrumInfo();
213 const V3D &monPos = specInfo.position(monIndex);
214 std::string srcName = inputWS->getInstrument()->getSource()->getName();
215
216 auto moveInstComp = createChildAlgorithm("MoveInstrumentComponent");
217 moveInstComp->setProperty("Workspace", outputWS);
218 moveInstComp->setProperty("ComponentName", srcName);
219 moveInstComp->setProperty("X", monPos.X());
220 moveInstComp->setProperty("Y", monPos.Y());
221 moveInstComp->setProperty("Z", monPos.Z());
222 moveInstComp->setProperty("RelativePosition", false);
223 moveInstComp->executeAsChildAlg();
224 }
225
226 const double binOffset = -monPeak;
227
228 if ("ISIS" == facility) {
229 std::string detcalFile;
230 if (reductionManager->existsProperty("SampleDetCalFilename"))
231 detcalFile = reductionManager->getPropertyValue("SampleDetCalFilename");
232 // Try to get it from run object.
233 else
234 detcalFile = inputWS->run().getProperty("Filename")->value();
235 if (!detcalFile.empty()) {
236 const bool relocateDets = reductionManager->getProperty("RelocateDetectors");
237 auto loaddetinfo = createChildAlgorithm("LoadDetectorInfo");
238 loaddetinfo->setProperty("Workspace", outputWS);
239 loaddetinfo->setProperty("DataFilename", detcalFile);
240 loaddetinfo->setProperty("RelocateDets", relocateDets);
241 loaddetinfo->executeAsChildAlg();
242 outputWS = loaddetinfo->getProperty("Workspace");
243 } else {
244 throw std::runtime_error("Cannot find detcal filename in run object or as parameter.");
245 }
246 }
247
248 // Subtract time-independent background if necessary
249 const bool doTibSub = reductionManager->getProperty("TimeIndepBackgroundSub");
250 if (doTibSub) {
251 // Setup for later use
252 auto cnvToDist = createChildAlgorithm("ConvertToDistribution");
253
254 // Set the binning parameters for the background region
255 double tibTofStart = getDblPropOrParam("TibTofRangeStart", reductionManager, "bkgd-range-min", inputWS);
256 tibTofStart += binOffset;
257 double tibTofEnd = getDblPropOrParam("TibTofRangeEnd", reductionManager, "bkgd-range-max", inputWS);
258 tibTofEnd += binOffset;
259 const double tibTofWidth = tibTofEnd - tibTofStart;
260 std::vector<double> params{tibTofStart, tibTofWidth, tibTofEnd};
261
262 bool treatTibAsEvents = false;
263
264 // Do we want to treat the TIB as events
265 std::vector<std::string> backgroundType =
266 inputWS->getInstrument()->getStringParameter("treat-background-as-events");
267 if (backgroundType.empty()) {
268 // Set the default behaviour.
269 treatTibAsEvents = false;
270 } else {
271 if ("yes" == backgroundType[0] || "true" == backgroundType[0]) {
272 treatTibAsEvents = true;
273 }
274 }
275
276 if ("SNS" == facility) {
278
279 // Do we want to treat the constant background as events ?
280 if (treatTibAsEvents) {
281 g_log.notice("TIB removal using event mode.");
282 // Treat background as events
283 auto createBkg = createChildAlgorithm("CreateFlatEventWorkspace");
284 createBkg->setProperty("InputWorkspace", outputWS);
285 createBkg->setProperty("RangeStart", tibTofStart);
286 createBkg->setProperty("RangeEnd", tibTofEnd);
287 createBkg->executeAsChildAlg();
288 bkgWS = createBkg->getProperty("OutputWorkspace");
289 } else {
290 g_log.notice("TIB removal using legacy mode.");
291 // Create an original background workspace from a portion of the
292 // result workspace.
293 std::string origBkgWsName = "background_origin_ws";
294 auto rebin = createChildAlgorithm("Rebin");
295 rebin->setProperty("InputWorkspace", outputWS);
296 rebin->setProperty("OutputWorkspace", origBkgWsName);
297 rebin->setProperty("Params", params);
298 rebin->setProperty("PreserveEvents", false);
299 rebin->setProperty("IgnoreBinErrors", true);
300 rebin->executeAsChildAlg();
301 MatrixWorkspace_sptr origBkgWS = rebin->getProperty("OutputWorkspace");
302
303 // Convert result workspace to DeltaE since we have Et binning
304 auto cnvun = createChildAlgorithm("ConvertUnits");
305 cnvun->setProperty("InputWorkspace", outputWS);
306 cnvun->setProperty("OutputWorkspace", outputWS);
307 cnvun->setProperty("Target", "DeltaE");
308 cnvun->setProperty("EMode", "Direct");
309 cnvun->setProperty("EFixed", incidentEnergy);
310 cnvun->executeAsChildAlg();
311 outputWS = cnvun->getProperty("OutputWorkspace");
312
313 // Rebin to Et
314 rebin->setProperty("InputWorkspace", outputWS);
315 rebin->setProperty("OutputWorkspace", outputWS);
316 rebin->setProperty("Params", etBinning);
317 rebin->setProperty("PreserveEvents", false);
318 rebin->executeAsChildAlg();
319 outputWS = rebin->getProperty("OutputWorkspace");
320
321 // Convert result workspace to TOF
322 cnvun->setProperty("InputWorkspace", outputWS);
323 cnvun->setProperty("OutputWorkspace", outputWS);
324 cnvun->setProperty("Target", "TOF");
325 cnvun->setProperty("EMode", "Direct");
326 cnvun->setProperty("EFixed", incidentEnergy);
327 cnvun->executeAsChildAlg();
328 outputWS = cnvun->getProperty("OutputWorkspace");
329
330 // Make result workspace a distribution
331 cnvToDist->setProperty("Workspace", outputWS);
332 cnvToDist->executeAsChildAlg();
333 outputWS = cnvToDist->getProperty("Workspace");
334
335 // Calculate the background
336 auto flatBg = createChildAlgorithm("CalculateFlatBackground");
337 flatBg->setProperty("InputWorkspace", origBkgWS);
338 flatBg->setProperty("StartX", tibTofStart);
339 flatBg->setProperty("EndX", tibTofEnd);
340 flatBg->setProperty("Mode", "Mean");
341 flatBg->setProperty("OutputMode", "Return Background");
342 flatBg->executeAsChildAlg();
343 bkgWS = flatBg->getProperty("OutputWorkspace");
344
345 // Remove unneeded original background workspace
346 origBkgWS.reset();
347
348 // Make background workspace a distribution
349 cnvToDist->setProperty("Workspace", bkgWS);
350 cnvToDist->executeAsChildAlg();
351 bkgWS = cnvToDist->getProperty("Workspace");
352 }
353
354 // Subtract background from result workspace
355 auto minus = createChildAlgorithm("Minus");
356 minus->setProperty("LHSWorkspace", outputWS);
357 minus->setProperty("RHSWorkspace", bkgWS);
358 minus->setProperty("OutputWorkspace", outputWS);
359 minus->executeAsChildAlg();
360
361 this->setProperty("OutputTibWorkspace", bkgWS);
362 }
363 // Do ISIS
364 else {
365 // Make result workspace a distribution
366 cnvToDist->setProperty("Workspace", outputWS);
367 cnvToDist->executeAsChildAlg();
368 outputWS = cnvToDist->getProperty("Workspace");
369
370 auto flatBg = createChildAlgorithm("CalculateFlatBackground");
371 flatBg->setProperty("InputWorkspace", outputWS);
372 flatBg->setProperty("OutputWorkspace", outputWS);
373 flatBg->setProperty("StartX", tibTofStart);
374 flatBg->setProperty("EndX", tibTofEnd);
375 flatBg->setProperty("Mode", "Mean");
376 flatBg->executeAsChildAlg();
377 outputWS = flatBg->getProperty("OutputWorkspace");
378 }
379
380 if (!treatTibAsEvents) {
381 // Convert result workspace back to histogram
382 auto cnvFrDist = createChildAlgorithm("ConvertFromDistribution");
383 cnvFrDist->setProperty("Workspace", outputWS);
384 cnvFrDist->executeAsChildAlg();
385 outputWS = cnvFrDist->getProperty("Workspace");
386 }
387 }
388
389 // Normalise result workspace to incident beam parameter
390 auto norm = createChildAlgorithm("DgsPreprocessData");
391 norm->setProperty("InputWorkspace", outputWS);
392 norm->setProperty("OutputWorkspace", outputWS);
393 norm->setProperty("InputMonitorWorkspace", monWS);
394 norm->setProperty("TofRangeOffset", binOffset);
395 norm->executeAsChildAlg();
396 outputWS = norm->getProperty("OutputWorkspace");
397
398 // Convert to energy transfer
399 g_log.notice() << "Converting to energy transfer.\n";
400 auto cnvun = createChildAlgorithm("ConvertUnits");
401 cnvun->setProperty("InputWorkspace", outputWS);
402 cnvun->setProperty("OutputWorkspace", outputWS);
403 cnvun->setProperty("Target", "DeltaE");
404 cnvun->setProperty("EMode", "Direct");
405 cnvun->setProperty("EFixed", incidentEnergy);
406 cnvun->executeAsChildAlg();
407 outputWS = cnvun->getProperty("OutputWorkspace");
408
409 g_log.notice() << "Rebinning data\n";
410 auto rebin = createChildAlgorithm("Rebin");
411 rebin->setProperty("InputWorkspace", outputWS);
412 rebin->setProperty("OutputWorkspace", outputWS);
413 rebin->setProperty("Params", etBinning);
414 rebin->setProperty("IgnoreBinErrors", true);
415 rebin->setProperty("PreserveEvents", preserveEvents);
416 rebin->executeAsChildAlg();
417 outputWS = rebin->getProperty("OutputWorkspace");
418
419 // Correct for detector efficiency
420 if ("SNS" == facility) {
421 // He3TubeEfficiency requires the workspace to be in wavelength
422 cnvun->setProperty("InputWorkspace", outputWS);
423 cnvun->setProperty("OutputWorkspace", outputWS);
424 cnvun->setProperty("Target", "Wavelength");
425 cnvun->executeAsChildAlg();
426 outputWS = cnvun->getProperty("OutputWorkspace");
427
428 // Do the correction
429 auto alg2 = this->createChildAlgorithm("He3TubeEfficiency");
430 alg2->setProperty("InputWorkspace", outputWS);
431 alg2->setProperty("OutputWorkspace", outputWS);
432 alg2->executeAsChildAlg();
433 outputWS = alg2->getProperty("OutputWorkspace");
434
435 // Convert back to energy transfer
436 cnvun->setProperty("InputWorkspace", outputWS);
437 cnvun->setProperty("OutputWorkspace", outputWS);
438 cnvun->setProperty("Target", "DeltaE");
439 cnvun->executeAsChildAlg();
440 outputWS = cnvun->getProperty("OutputWorkspace");
441 }
442 // Do ISIS
443 else {
444 auto alg = createChildAlgorithm("DetectorEfficiencyCor");
445 alg->setProperty("InputWorkspace", outputWS);
446 alg->setProperty("OutputWorkspace", outputWS);
447 alg->executeAsChildAlg();
448 outputWS = alg->getProperty("OutputWorkspace");
449 }
450
451 const bool correctKiKf = reductionManager->getProperty("CorrectKiKf");
452 if (correctKiKf) {
453 // Correct for Ki/Kf
454 auto kikf = createChildAlgorithm("CorrectKiKf");
455 kikf->setProperty("InputWorkspace", outputWS);
456 kikf->setProperty("OutputWorkspace", outputWS);
457 kikf->setProperty("EMode", "Direct");
458 kikf->executeAsChildAlg();
459 outputWS = kikf->getProperty("OutputWorkspace");
460 }
461
462 // Rebin to ensure consistency
463 const bool sofphieIsDistribution = reductionManager->getProperty("SofPhiEIsDistribution");
464
465 g_log.notice() << "Rebinning data\n";
466 rebin->setProperty("InputWorkspace", outputWS);
467 rebin->setProperty("OutputWorkspace", outputWS);
468 rebin->setProperty("IgnoreBinErrors", true);
469 if (sofphieIsDistribution)
470 rebin->setProperty("PreserveEvents", false);
471 rebin->executeAsChildAlg();
472 outputWS = rebin->getProperty("OutputWorkspace");
473
474 if (sofphieIsDistribution) {
475 g_log.notice() << "Making distribution\n";
476 auto distrib = createChildAlgorithm("ConvertToDistribution");
477 distrib->setProperty("Workspace", outputWS);
478 distrib->executeAsChildAlg();
479 outputWS = distrib->getProperty("Workspace");
480 } else {
481 // Discard events outside nominal bounds
482 auto crop = createChildAlgorithm("CropWorkspace");
483 crop->setProperty("InputWorkspace", outputWS);
484 crop->setProperty("OutputWorkspace", outputWS);
485 crop->setProperty("XMin", etBinning[0]);
486 crop->setProperty("XMax", etBinning[2]);
487 crop->executeAsChildAlg();
488 outputWS = crop->getProperty("OutputWorkspace");
489 }
490
491 // Normalise by the detector vanadium if necessary
492 MatrixWorkspace_sptr detVanWS = this->getProperty("IntegratedDetectorVanadium");
493 if (detVanWS) {
494 auto divide = createChildAlgorithm("Divide");
495 divide->setProperty("LHSWorkspace", outputWS);
496 divide->setProperty("RHSWorkspace", detVanWS);
497 divide->setProperty("OutputWorkspace", outputWS);
498 divide->executeAsChildAlg();
499 outputWS = divide->getProperty("OutputWorkspace");
500 }
501
502 // Mask and group workspace if necessary.
503 MatrixWorkspace_sptr maskWS = this->getProperty("MaskWorkspace");
504 MatrixWorkspace_sptr groupWS = this->getProperty("GroupingWorkspace");
505 std::string oldGroupFile;
506 std::string filePropMod = this->getProperty("AlternateGroupingTag");
507 std::string fileProp = filePropMod + "OldGroupingFilename";
508 if (reductionManager->existsProperty(fileProp))
509 oldGroupFile = reductionManager->getPropertyValue(fileProp);
510 auto remap = createChildAlgorithm("DgsRemap");
511 remap->setProperty("InputWorkspace", outputWS);
512 remap->setProperty("OutputWorkspace", outputWS);
513 remap->setProperty("MaskWorkspace", maskWS);
514 remap->setProperty("GroupingWorkspace", groupWS);
515 remap->setProperty("OldGroupingFile", oldGroupFile);
516 remap->executeAsChildAlg();
517 outputWS = remap->getProperty("OutputWorkspace");
518
519 if ("ISIS" == facility) {
520 double scaleFactor = inputWS->getInstrument()->getNumberParameter("scale-factor")[0];
521 auto scaleAlg = createChildAlgorithm("Scale");
522 scaleAlg->setProperty("InputWorkspace", outputWS);
523 scaleAlg->setProperty("Factor", scaleFactor);
524 scaleAlg->setProperty("Operation", "Multiply");
525 scaleAlg->setProperty("OutputWorkspace", outputWS);
526 scaleAlg->executeAsChildAlg();
527 }
528 this->setProperty("OutputWorkspace", outputWS);
529}
530
531} // namespace Mantid::WorkflowAlgorithms
std::string name
Definition Run.cpp:60
#define DECLARE_ALGORITHM(classname)
Definition Algorithm.h:547
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.
Kernel::Logger & g_log
Definition Algorithm.h:426
A property class for workspaces.
Marks code as not implemented yet.
Definition Exception.h:138
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.
Definition Logger.cpp:126
A specialised Property class for holding a series of time-value pairs.
TimeSeriesPropertyStatistics getStatistics(const Kernel::TimeROI *roi=nullptr) const override
Return a TimeSeriesPropertyStatistics object.
Class for 3D vectors.
Definition V3D.h:35
constexpr double X() const noexcept
Get x.
Definition V3D.h:239
constexpr double Y() const noexcept
Get y.
Definition V3D.h:240
constexpr double Z() const noexcept
Get z.
Definition V3D.h:241
DgsConvertToEnergyTransfer : This is the algorithm responsible for the conversion from TOF to energy ...
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version for identification.
void init() override
Initialize the algorithm's properties.
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
int32_t specnum_t
Typedef for a spectrum Number.
Definition IDTypes.h:14
constexpr double EMPTY_DBL() noexcept
Returns what we consider an "empty" double within a property.
Definition EmptyValues.h:42
double getDblPropOrParam(const std::string &pmProp, Mantid::Kernel::PropertyManager_sptr &pm, const std::string &instParam, Mantid::API::MatrixWorkspace_sptr &ws, const double overrideValue=Mantid::EMPTY_DBL())
Function to get double property or instrument parameter value.
STL namespace.
@ Input
An input workspace.
Definition Property.h:54
@ Output
An output workspace.
Definition Property.h:55