Mantid
Loading...
Searching...
No Matches
ExtractSpectra.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2015 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 +
7#pragma once
8
10#include "MantidAlgorithms/DllConfig.h"
12
13namespace Mantid {
14namespace Algorithms {
15
19class MANTID_ALGORITHMS_DLL ExtractSpectra : public API::DistributedAlgorithm {
20public:
21 const std::string name() const override;
22 int version() const override;
23 const std::vector<std::string> seeAlso() const override {
24 return {"CropWorkspace", "ExtractSingleSpectrum", "ExtractUnmaskedSpectra", "PerformIndexOperations"};
25 }
26 const std::string category() const override;
27 const std::string summary() const override;
28 std::map<std::string, std::string> validateInputs() override;
29
30private:
31 void init() override;
32 void exec() override;
33 void execHistogram();
34 void execEvent();
35
36 void propagateBinMasking(API::MatrixWorkspace &workspace, const int i) const;
37 void checkProperties();
38 std::size_t getXMinIndex(const size_t wsIndex = 0);
39 std::size_t getXMaxIndex(const size_t wsIndex = 0);
40 void cropRagged(API::MatrixWorkspace &workspace, int index);
41
46 std::size_t m_minX = 0;
48 std::size_t m_maxX = 0;
50 bool m_commonBoundaries = false;
52 bool m_histogram = false;
54 bool m_croppingInX = false;
56 std::vector<size_t> m_workspaceIndexList;
57};
58
59} // namespace Algorithms
60} // namespace Mantid
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
Base class for algorithms that treat all spectra independently, i.e., we can trivially parallelize ov...
Base MatrixWorkspace Abstract Class.
Extracts specified spectra from a workspace and places them in a new workspace.
std::vector< size_t > m_workspaceIndexList
The list of workspaces to extract.
API::MatrixWorkspace_sptr m_inputWorkspace
The input workspace.
DataObjects::EventWorkspace_sptr eventW
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
Helper class which provides the Collimation Length for SANS instruments.