Mantid
Loading...
Searching...
No Matches
MaskDetectors.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 +
8
11
14#include "MantidIndexing/IndexInfo.h"
15#include "MantidIndexing/LegacyConversion.h"
16#include "MantidIndexing/SpectrumIndexSet.h"
20#include <algorithm>
21#include <numeric>
22#include <set>
23
24namespace { // declare file scoped function
32void constrainIndexInRange(std::vector<size_t> &sourceList, std::vector<size_t> &targetList, size_t minIndex,
33 size_t maxIndex) {
34 targetList.reserve(sourceList.size());
35 std::sort(sourceList.begin(), sourceList.end());
36 std::copy_if(sourceList.cbegin(), sourceList.cend(), std::back_inserter(targetList),
37 [minIndex, maxIndex](auto sourceValue) { return sourceValue >= minIndex && sourceValue <= maxIndex; });
38}
39} // namespace
40
41namespace Mantid::DataHandling {
42
43// Register the algorithm into the algorithm factory
44DECLARE_ALGORITHM(MaskDetectors)
45
46using namespace API;
47using namespace Kernel;
48using namespace DataObjects;
49using namespace Geometry;
50
51/*
52 * Define input arguments
53 */
55 declareProperty(std::make_unique<WorkspaceProperty<Workspace>>("Workspace", "", Direction::InOut),
56 "The name of the input and output workspace on which to perform the "
57 "algorithm.");
58 declareProperty(std::make_unique<ArrayProperty<specnum_t>>("SpectraList"), "A list of spectra to mask");
59 declareProperty(std::make_unique<ArrayProperty<detid_t>>("DetectorList"), "A list of detector ID's to mask");
60 declareProperty(std::make_unique<ArrayProperty<size_t>>("WorkspaceIndexList"),
61 "A list of the workspace indices to mask");
63 std::make_unique<WorkspaceProperty<>>("MaskedWorkspace", "", Direction::Input, PropertyMode::Optional),
64 "If given but not as a SpecialWorkspace2D, the masking from "
65 "this workspace will be copied. If given as a "
66 "SpecialWorkspace2D, the masking is read from its Y values.");
67 declareProperty("ForceInstrumentMasking", false,
68 "Works when 'MaskedWorkspace' is provided and forces "
69 "to use spectra-detector mapping even in case when number of "
70 "spectra in 'Workspace' and 'MaskedWorkspace' are equal",
72 setPropertySettings("ForceInstrumentMasking",
73 std::make_unique<EnabledWhenProperty>("MaskedWorkspace", ePropertyCriterion::IS_NOT_DEFAULT));
74
75 auto mustBePosInt = std::make_shared<BoundedValidator<int>>();
76 mustBePosInt->setLower(0);
77 declareProperty("StartWorkspaceIndex", 0, mustBePosInt,
78 "If other masks fields are provided, it's the first index of the "
79 "target workspace to be allowed to be masked from by these masks, "
80 "if not, its the first index of the target workspace to mask.\n"
81 "Default value is 0 if other masking is present or ignored if not.");
82 declareProperty("EndWorkspaceIndex", EMPTY_INT(), mustBePosInt,
83 "If other masks are provided, it's the last index of the "
84 "target workspace allowed to be masked to by these masks, "
85 "if not, its the last index of the target workspace to mask.\n"
86 "Default is number of histograms in target workspace if other masks are"
87 " present "
88 "or ignored if not.");
89 declareProperty(std::make_unique<ArrayProperty<std::string>>("ComponentList"), "A list names of components to mask");
90}
91
92/*
93 * Main exec body
94 */
96 // Get the input workspace
97 Workspace_sptr propWS = getProperty("Workspace");
98 MatrixWorkspace_sptr WS = std::dynamic_pointer_cast<MatrixWorkspace>(propWS);
99 PeaksWorkspace_sptr peaksWS = std::dynamic_pointer_cast<PeaksWorkspace>(propWS);
100 if (peaksWS) {
101 execPeaks(peaksWS);
102 return;
103 }
104
105 // Is it an event workspace?
106 EventWorkspace_sptr eventWS = std::dynamic_pointer_cast<EventWorkspace>(WS);
107
108 // Is it a Mask Workspace ?
109 MaskWorkspace_sptr inputAsMaskWS = std::dynamic_pointer_cast<MaskWorkspace>(WS);
110 const auto isMaskWS = static_cast<bool>(inputAsMaskWS);
111
112 std::vector<size_t> indexList = getProperty("WorkspaceIndexList");
113 auto spectraList = Indexing::makeSpectrumNumberVector(getProperty("SpectraList"));
114 std::vector<detid_t> detectorList = getProperty("DetectorList");
115 std::vector<std::string> componentList = getProperty("ComponentList");
116 if (!componentList.empty()) {
118 }
119 const MatrixWorkspace_sptr prevMasking = getProperty("MaskedWorkspace");
120
121 auto ranges_info = getRanges(WS);
122 bool range_constrained = std::get<2>(ranges_info);
123
124 bool mask_defined(false);
125 if (!indexList.empty() || !spectraList.empty() || !detectorList.empty() || prevMasking) {
126 mask_defined = true;
127 }
128
129 // each one of these values is optional but the user can not leave all six
130 // blank
131 if (!mask_defined && !range_constrained) {
132 g_log.information(name() + ": There is nothing to mask, the index, spectra, "
133 "detector lists and masked workspace properties are all empty");
134 return;
135 }
136
137 // Index range are provided as min/max values
138 if (!mask_defined && range_constrained) {
139 size_t list_size = std::get<1>(ranges_info) - std::get<0>(ranges_info) + 1;
140 indexList.resize(list_size);
141 std::iota(indexList.begin(), indexList.end(), std::get<0>(ranges_info));
142 }
143
144 auto maskWS = std::dynamic_pointer_cast<DataObjects::MaskWorkspace>(prevMasking);
145 if (maskWS && prevMasking) { // is a mask workspace
146 handleMaskByMaskWorkspace(maskWS, WS, detectorList, indexList, ranges_info);
147 } else if (prevMasking) { // is not a mask workspace
148 handleMaskByMatrixWorkspace(prevMasking, WS, detectorList, indexList, ranges_info);
149 }
150
151 // If the spectraList property has been set, need to loop over the workspace
152 // looking for the
153 // appropriate spectra number and adding the indices they are linked to the
154 // list to be processed
155 if (!spectraList.empty()) {
156 fillIndexListFromSpectra(indexList, std::move(spectraList), WS, ranges_info);
157 } // End dealing with spectraList
158 if (!detectorList.empty()) {
159 // Convert from detectors to workspace indexes
160 if (indexList.empty()) {
161 indexList = WS->getIndicesFromDetectorIDs(detectorList);
162 } else {
163 auto tmpList = WS->getIndicesFromDetectorIDs(detectorList);
164 indexList.insert(indexList.end(), std::begin(tmpList), std::end(tmpList));
165 }
166 detectorList.clear();
167 //
168 // Constrain by ws indexes provided, if any
169 if (range_constrained) {
170 constrainMaskedIndexes(indexList, ranges_info);
171 }
172 }
173
174 if (indexList.empty()) {
175 g_log.warning("No spectra affected.");
176 return;
177 }
178
179 // Get a reference to the spectra-detector map to get hold of detector ID's
180 auto &spectrumInfo = WS->mutableSpectrumInfo();
181 double prog = 0.0;
182 for (const auto i : indexList) {
183 WS->getSpectrum(i).clearData();
184 if (spectrumInfo.hasDetectors(i))
185 spectrumInfo.setMasked(i, true);
186
187 // Progress
188 prog += (1.0 / static_cast<int>(indexList.size()));
189 progress(prog);
190 }
191
192 if (eventWS) {
193 // Also clear the MRU for event workspaces.
194 eventWS->clearMRU();
195 }
196
197 if (isMaskWS) {
198 // When input is a MaskWorkspace, some special handling is needed.
199 auto &maskWsSpectrumInfo = inputAsMaskWS->mutableSpectrumInfo();
200 for (size_t i = 0; i < inputAsMaskWS->getNumberHistograms(); ++i) {
201 const bool mask = inputAsMaskWS->isMaskedIndex(i) || maskWsSpectrumInfo.isMasked(i);
202 inputAsMaskWS->setMaskedIndex(i, mask);
203 // Always clear the mask flag from MaskWorkspace
204 maskWsSpectrumInfo.setMasked(i, false);
205 }
206 }
207}
208
222 std::vector<detid_t> &detectorList, std::vector<size_t> &indexList,
223 const RangeInfo &rangeInfo) {
224
225 if (maskWs->getInstrument()->getDetectorIDs().size() != WS->getInstrument()->getDetectorIDs().size()) {
226 throw std::runtime_error("Instrument's detector numbers mismatch "
227 "between input Workspace and MaskWorkspace");
228 }
229
230 g_log.debug() << "Extracting mask from MaskWorkspace (" << maskWs->getName() << ")\n";
231 bool forceDetIDs = getProperty("ForceInstrumentMasking");
232 if (maskWs->getNumberHistograms() != WS->getNumberHistograms() || forceDetIDs) {
233 g_log.notice("Masking using detectors IDs");
235 } else {
236 g_log.notice("Masking using workspace indicies");
237 appendToIndexListFromMaskWS(indexList, maskWs, rangeInfo);
238 }
239}
240
254 std::vector<detid_t> &detectorList, std::vector<size_t> &indexList,
255 const RangeInfo &rangeInfo) {
256
257 const auto nHist = maskWs->getNumberHistograms();
258 auto instrument = WS->getInstrument();
259 auto maskInstrument = maskWs->getInstrument();
260
261 // Check the provided workspace has the same number of spectra as the
262 // input, if so assume index list
263 if (nHist == WS->getNumberHistograms()) {
264 g_log.notice("Masking using workspace indicies");
265 appendToIndexListFromWS(indexList, maskWs, rangeInfo);
266 // Check they both have instrument and then use detector based masking
267 } else if (instrument && maskInstrument) {
268 const auto inputDetCount = instrument->getNumberDetectors();
269 const auto maskDetCount = maskInstrument->getNumberDetectors();
270
271 g_log.notice("Masking using detectors IDs");
272
273 if (inputDetCount != maskDetCount)
274 g_log.warning() << "Number of detectors does not match between "
275 "mask workspace and input workspace";
276
277 if (instrument->getName() != maskInstrument->getName())
278 g_log.warning() << "Mask is from a different instrument to the input "
279 "workspace. ";
280
281 appendToDetectorListFromWS(detectorList, WS, maskWs, rangeInfo);
282 // Not an index list and there's no instrument, so give up.
283 } else {
284 throw std::runtime_error("Input or mask workspace does not have an instrument.");
285 }
286}
287
288/* Verifies input ranges are defined and returns these ranges if they are.
289 *
290 * @return tuple containing min/max ranges provided to algorithm
291 * (from 0 to max histogram range) and Boolean value,
292 * containing true if the ranges are
293 * constrained (or defined in other words)
294 * and false if they are not.
295 */
296std::tuple<size_t, size_t, bool> MaskDetectors::getRanges(const MatrixWorkspace_sptr &targWS) {
297 int endIndex = getProperty("EndWorkspaceIndex");
298 int startIndex = getProperty("StartWorkspaceIndex");
299 size_t max_ind = targWS->getNumberHistograms() - 1;
300
301 if (endIndex == EMPTY_INT() && startIndex == 0) {
302 return std::tuple<size_t, size_t, bool>(0, max_ind, false);
303 } else {
304 if (startIndex < 0) {
305 startIndex = 0;
306 }
307 auto startIndex_l = static_cast<size_t>(startIndex);
308 auto endIndex_l = static_cast<size_t>(endIndex);
309
310 if (endIndex == EMPTY_INT()) {
311 endIndex_l = max_ind;
312 }
313 if (endIndex_l > max_ind) {
314 endIndex_l = max_ind;
315 }
316 if (startIndex_l > endIndex_l) {
317 startIndex_l = endIndex_l;
318 }
319
320 return std::tuple<size_t, size_t, bool>(startIndex_l, endIndex_l, true);
321 }
322}
323/* Do constrain masked indexes by limits, provided as input
324 * @param indexList :: list of indexes to verify against constrain on input
325 * and list of constrained indexes on the output.
326 * @param startIndex :: minimal index (inclusive) to include in the constrained
327 * list.
328 * @param endIndex :: maximal index (inclusive) to include in the constrained
329 * list.
330 */
331void MaskDetectors::constrainMaskedIndexes(std::vector<size_t> &indexList,
332 const std::tuple<size_t, size_t, bool> &range_info) {
333
334 std::vector<size_t> tmp;
335 constrainIndexInRange(indexList, tmp, std::get<0>(range_info), std::get<1>(range_info));
336 tmp.swap(indexList);
337}
338
339/* Method to extract detector's id-s from mask workspace
340* the mask workspace assumed to be not having masked detectors, but has masked
341* state defined in its spectra
342@param detectorList :: list of masked detectors, appended on output by the
343* detectors, defined in the mask workspace.
344@param maskWS :: shared pointer to workspace containing masks.
345*/
348
349 size_t nHist = maskWS->getNumberHistograms();
350 for (size_t i = 0; i < nHist; ++i) {
351 if (maskWS->y(i).front() > 0.5) {
352 const auto &dets = maskWS->getSpectrum(i).getDetectorIDs();
353 std::copy(dets.cbegin(), dets.cend(), std::back_inserter(detectorList));
354 }
355 }
356}
357
358/*
359 * Peaks exec body
360 * @param WS :: The input peaks workspace to be masked
361 */
363 std::vector<detid_t> detectorList = getProperty("DetectorList");
364 const MatrixWorkspace_sptr prevMasking = getProperty("MaskedWorkspace");
365
366 // each one of these values is optional but the user can't leave all four
367 // blank
368 if (detectorList.empty() && !prevMasking) {
369 g_log.information(name() + ": There is nothing to mask, "
370 "detector lists and masked workspace properties are all empty");
371 return;
372 }
373
374 auto &detInfo = WS->mutableDetectorInfo();
375 std::vector<size_t> indicesToMask;
376 for (const auto &detID : detectorList) {
377 try {
378 indicesToMask.emplace_back(detInfo.indexOf(detID));
379 } catch (std::out_of_range &) {
380 g_log.warning() << "Invalid detector ID " << detID << ". Found while running MaskDetectors\n";
381 }
382 }
383
384 // If we have a workspace that could contain masking,copy that in too
385 if (prevMasking) {
386 DataObjects::MaskWorkspace_sptr maskWS = std::dynamic_pointer_cast<DataObjects::MaskWorkspace>(prevMasking);
387 if (maskWS) {
388 const auto &maskDetInfo = maskWS->detectorInfo();
389 if (detInfo.size() != maskDetInfo.size()) {
390 throw std::runtime_error("Size mismatch between input Workspace and MaskWorkspace");
391 }
392
393 g_log.debug() << "Extracting mask from MaskWorkspace (" << maskWS->getName() << ")\n";
394
395 for (size_t i = 0; i < maskDetInfo.size(); ++i)
396 if (maskDetInfo.isMasked(i))
397 indicesToMask.emplace_back(i);
398 }
399 }
400
401 for (const auto index : indicesToMask)
402 detInfo.setMasked(index, true);
403}
404
405/* Convert a list of spectra numbers into the corresponding workspace indices.
406 *
407 * @param indexList :: An output index list from the given spectra list
408 * @param spectraList :: A list of spectra numbers
409 * @param WS :: The input workspace to be masked
410 * @param range_info :: tuple containing the range of spectra to process and
411 * Boolean indicating if these ranges are defined
412 */
413void MaskDetectors::fillIndexListFromSpectra(std::vector<size_t> &indexList,
414 std::vector<Indexing::SpectrumNumber> spectraList,
416 const std::tuple<size_t, size_t, bool> &range_info) {
417
418 std::vector<size_t> tmp_index;
419 size_t startIndex = std::get<0>(range_info);
420 size_t endIndex = std::get<1>(range_info);
421 bool range_constrained = std::get<2>(range_info);
422
423 if (range_constrained) {
424 constrainIndexInRange(indexList, tmp_index, startIndex, endIndex);
425 } else {
426 tmp_index.swap(indexList);
427 }
428
429 // Ignore duplicate entries.
430 std::sort(spectraList.begin(), spectraList.end());
431 auto last = std::unique(spectraList.begin(), spectraList.end());
432 if (last != spectraList.end())
433 g_log.warning("Duplicate entries in spectrum list.");
434 spectraList.erase(last, spectraList.end());
435 for (auto ws_index : WS->indexInfo().makeIndexSet(spectraList)) {
436 if (range_constrained && (ws_index < startIndex || ws_index > endIndex)) {
437 continue;
438 }
439 tmp_index.emplace_back(ws_index);
440 }
441
442 tmp_index.swap(indexList);
443}
444
445/* Append the indices of the masked spectra from the given workspace list to the
446 * given list
447 *
448 * @param indexList :: An existing list of indices.
449 * @param sourceWS :: An workspace with masked spectra.
450 * @param range_info :: tuple containing the range of spectra to process and
451 * Boolean indicating if these ranges are defined
452 */
453void MaskDetectors::appendToIndexListFromWS(std::vector<size_t> &indexList, const MatrixWorkspace_const_sptr &sourceWS,
454 const std::tuple<size_t, size_t, bool> &range_info) {
455
456 std::vector<size_t> tmp_index;
457 size_t startIndex = std::get<0>(range_info);
458 size_t endIndex = std::get<1>(range_info);
459 bool range_constrained = std::get<2>(range_info);
460
461 const auto &spectrumInfo = sourceWS->spectrumInfo();
462 if (range_constrained) {
463 constrainIndexInRange(indexList, tmp_index, startIndex, endIndex);
464
465 for (size_t i = startIndex; i <= endIndex; ++i) {
466 if (spectrumInfo.hasDetectors(i) && spectrumInfo.isMasked(i)) {
467 tmp_index.emplace_back(i);
468 }
469 }
470 } else {
471 tmp_index.swap(indexList);
472
473 endIndex = sourceWS->getNumberHistograms();
474 for (size_t i = 0; i < endIndex; ++i) {
475 if (spectrumInfo.hasDetectors(i) && spectrumInfo.isMasked(i)) {
476 tmp_index.emplace_back(i);
477 }
478 }
479 }
480 tmp_index.swap(indexList);
481}
482
495 const MatrixWorkspace_const_sptr &inputWs,
496 const MatrixWorkspace_const_sptr &maskWs,
497 const std::tuple<size_t, size_t, bool> &range_info) {
498 const auto startIndex = std::get<0>(range_info);
499 const auto endIndex = std::get<1>(range_info);
500 const auto &detMap = inputWs->getDetectorIDToWorkspaceIndexMap();
501 detectorList.reserve(maskWs->getNumberHistograms());
502
503 for (size_t i = 0; i < maskWs->getNumberHistograms(); ++i) {
504 if (maskWs->y(i)[0] == 0) {
505 const auto &spec = maskWs->getSpectrum(i);
506 for (const auto &id : spec.getDetectorIDs()) {
507 if (detMap.at(id) >= startIndex && detMap.at(id) <= endIndex)
508 detectorList.emplace_back(id);
509 }
510 }
511 }
512}
513
523void MaskDetectors::appendToIndexListFromMaskWS(std::vector<size_t> &indexList,
524 const DataObjects::MaskWorkspace_const_sptr &maskedWorkspace,
525 const std::tuple<size_t, size_t, bool> &range_info) {
526
527 std::vector<size_t> tmp_index;
528
529 size_t startIndex = std::get<0>(range_info);
530 size_t endIndex = std::get<1>(range_info);
531 bool range_constrained = std::get<2>(range_info);
532
533 if (range_constrained) {
534 constrainIndexInRange(indexList, tmp_index, startIndex, endIndex);
535
536 for (size_t i = startIndex; i <= endIndex; ++i) {
537 if (maskedWorkspace->y(i)[0] > 0.5) {
538 g_log.debug() << "Adding WorkspaceIndex " << i << " to mask.\n";
539 tmp_index.emplace_back(i);
540 }
541 }
542 } else {
543 tmp_index.swap(indexList);
544 endIndex = maskedWorkspace->getNumberHistograms();
545 for (size_t i = 0; i < endIndex; ++i) {
546
547 if (maskedWorkspace->y(i)[0] > 0.5) {
548 g_log.debug() << "Adding WorkspaceIndex " << i << " to mask.\n";
549 tmp_index.emplace_back(i);
550 }
551 }
552 }
553 tmp_index.swap(indexList);
554} // appendToIndexListFromWS
555
565 const std::vector<std::string> &componentList,
567 const auto instrument = WS->getInstrument();
568 if (!instrument) {
569 g_log.error() << "No instrument in input workspace. Ignoring ComponentList\n";
570 return;
571 }
572 std::set<detid_t> detectorIDs;
573 for (const auto &compName : componentList) {
574 std::vector<IDetector_const_sptr> dets;
575 instrument->getDetectorsInBank(dets, compName);
576 if (dets.empty()) {
577 const auto component = instrument->getComponentByName(compName);
578 const auto det = std::dynamic_pointer_cast<const IDetector>(component);
579 if (!det) {
580 g_log.warning() << "No detectors found in component '" << compName << "'\n";
581 continue;
582 }
583 dets.emplace_back(det);
584 }
585 for (const auto &det : dets) {
586 detectorIDs.emplace(det->getID());
587 }
588 }
589 const auto oldSize = detectorList.size();
590 detectorList.resize(detectorList.size() + detectorIDs.size());
591 auto appendBegin = detectorList.begin() + oldSize;
592 std::copy(detectorIDs.cbegin(), detectorIDs.cend(), appendBegin);
593} // appendToDetectorListFromComponentList
594
595} // namespace Mantid::DataHandling
#define DECLARE_ALGORITHM(classname)
Definition: Algorithm.h:576
gsl_vector * tmp
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
IntArray detectorList
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
Definition: Algorithm.cpp:1913
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
Definition: Algorithm.cpp:2076
Kernel::Logger & g_log
Definition: Algorithm.h:451
void progress(double p, const std::string &msg="", double estimatedTime=0.0, int progressPrecision=0)
Sends ProgressNotification.
Definition: Algorithm.cpp:231
A property class for workspaces.
void handleMaskByMatrixWorkspace(const API::MatrixWorkspace_const_sptr &maskWs, const API::MatrixWorkspace_const_sptr &WS, std::vector< detid_t > &detectorList, std::vector< size_t > &indexList, const RangeInfo &rangeInfo)
Choose how to mask given that we have a matrix workspace.
void fillIndexListFromSpectra(std::vector< size_t > &indexList, std::vector< Indexing::SpectrumNumber > spectraList, const API::MatrixWorkspace_sptr &WS, const RangeInfo &range_info)
RangeInfo getRanges(const API::MatrixWorkspace_sptr &targWS)
std::tuple< size_t, size_t, bool > RangeInfo
Definition: MaskDetectors.h:61
void constrainMaskedIndexes(std::vector< size_t > &indexList, const RangeInfo &range_info)
void init() override
Virtual method - must be overridden by concrete algorithm.
void appendToDetectorListFromWS(std::vector< detid_t > &detectorList, const API::MatrixWorkspace_const_sptr &inputWs, const API::MatrixWorkspace_const_sptr &maskWs, const std::tuple< size_t, size_t, bool > &range_info)
Append the indices of a workspace corresponding to detector IDs to the given list.
void appendToIndexListFromMaskWS(std::vector< size_t > &indexList, const DataObjects::MaskWorkspace_const_sptr &maskedWorkspace, const std::tuple< size_t, size_t, bool > &range_info)
Append the indices of the masked spectra from the given workspace list to the given list.
void exec() override
Virtual method - must be overridden by concrete algorithm.
void appendToDetectorListFromComponentList(std::vector< detid_t > &detectorList, const std::vector< std::string > &componentList, const API::MatrixWorkspace_const_sptr &WS)
Append the detector IDs of detectors found recursively in the list of components.
void appendToIndexListFromWS(std::vector< size_t > &indexList, const API::MatrixWorkspace_const_sptr &maskedWorkspace, const RangeInfo &range_info)
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: MaskDetectors.h:43
void execPeaks(const DataObjects::PeaksWorkspace_sptr &WS)
void extractMaskedWSDetIDs(std::vector< detid_t > &detectorList, const DataObjects::MaskWorkspace_const_sptr &maskWS)
void handleMaskByMaskWorkspace(const DataObjects::MaskWorkspace_const_sptr &maskWs, const API::MatrixWorkspace_const_sptr &WS, std::vector< detid_t > &detectorList, std::vector< size_t > &indexList, const RangeInfo &rangeInfo)
Choose how to mask given that we have a mask workspace.
Support for a property that holds an array of values.
Definition: ArrayProperty.h:28
void setPropertySettings(const std::string &name, std::unique_ptr< IPropertySettings > settings)
void debug(const std::string &msg)
Logs at debug level.
Definition: Logger.cpp:114
void notice(const std::string &msg)
Logs at notice level.
Definition: Logger.cpp:95
void error(const std::string &msg)
Logs at error level.
Definition: Logger.cpp:77
void warning(const std::string &msg)
Logs at warning level.
Definition: Logger.cpp:86
void information(const std::string &msg)
Logs at information level.
Definition: Logger.cpp:105
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Definition: Workspace_fwd.h:20
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< const MaskWorkspace > MaskWorkspace_const_sptr
shared pointer to a const MaskWorkspace
Definition: MaskWorkspace.h:67
std::shared_ptr< MaskWorkspace > MaskWorkspace_sptr
shared pointer to the MaskWorkspace class
Definition: MaskWorkspace.h:64
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
constexpr int EMPTY_INT() noexcept
Returns what we consider an "empty" integer within a property.
Definition: EmptyValues.h:25
@ InOut
Both an input & output workspace.
Definition: Property.h:55
@ Input
An input workspace.
Definition: Property.h:53