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::Algorithm {
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 std::size_t histXMaxIndex() const;
43 int index);
44 void cropRagged(API::MatrixWorkspace &workspace, int index);
45
50 std::size_t m_minXIndex = 0;
52 std::size_t m_maxXIndex = 0;
54 bool m_commonBoundaries = false;
56 bool m_isHistogramData = false;
58 bool m_croppingInX = false;
60 std::vector<size_t> m_workspaceIndexList;
61};
62
63} // namespace Algorithms
64} // namespace Mantid
std::string name
Definition Run.cpp:60
IPeaksWorkspace_sptr workspace
std::map< DeltaEMode::Type, std::string > index
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
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.
Implements a copy on write data template.
Definition cow_ptr.h:41
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.