Mantid
Loading...
Searching...
No Matches
CreateDetectorTable.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2019 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
16#include "MantidAPI/TableRow.h"
18#include "MantidAlgorithms/DllConfig.h"
26
27namespace Mantid {
28namespace Algorithms {
29
30class MANTID_ALGORITHMS_DLL CreateDetectorTable final : public API::Algorithm {
31public:
35 const std::string name() const override { return "CreateDetectorTable"; }
37 int version() const override { return 1; }
39 const std::string category() const override { return "Utility\\Workspaces"; }
41 const std::string summary() const override {
42 return "Create a table showing detector information for the given "
43 "workspace and optionally the data for that detector";
44 }
45 std::map<std::string, std::string> validateInputs() override;
46
47private:
49 void init() override;
51 void exec() override;
52};
53
56 const std::vector<int> &indices, const bool includeData,
57 Kernel::Logger &logger);
58
60std::string createTruncatedList(const std::set<int> &elements);
61
63 const std::vector<int> &indices, const Mantid::API::SpectrumInfo &spectrumInfo,
64 bool signedThetaParamRetrieved, bool showSignedTwoTheta,
65 const Mantid::Geometry::PointingAlong &beamAxisIndex, const double sampleDist, const bool isScanning,
66 const bool include_data, const bool calcQ, const bool includeDiffConstants, Kernel::Logger &logger);
67std::vector<std::pair<std::string, std::string>> createColumns(const bool isScanning, const bool includeData,
68 const bool calcQ, const bool hasDiffConstants);
69
70} // namespace Algorithms
71} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
Definition: SpectrumInfo.h:53
const std::string category() const override
Algorithm's category for identification.
const std::string summary() const override
Summary of algorithms purpose.
const std::string name() const override
Algorithm's name.
int version() const override
Algorithm's version.
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition: Logger.h:52
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::string createTruncatedList(const std::set< int > &elements)
Converts a list to a string, shortened if necessary.
API::ITableWorkspace_sptr createDetectorTableWorkspace(const API::MatrixWorkspace_sptr &ws, const std::vector< int > &indices, const bool includeData, Kernel::Logger &logger)
Creates table workspace of detector information from a given workspace.
std::vector< std::pair< std::string, std::string > > createColumns(const bool isScanning, const bool includeData, const bool calcQ, const bool hasDiffConstants)
void populateTable(Mantid::API::ITableWorkspace_sptr &t, const Mantid::API::MatrixWorkspace_sptr &ws, const int nrows, const std::vector< int > &indices, const Mantid::API::SpectrumInfo &spectrumInfo, bool signedThetaParamRetrieved, bool showSignedTwoTheta, const Mantid::Geometry::PointingAlong &beamAxisIndex, const double sampleDist, const bool isScanning, const bool include_data, const bool calcQ, const bool includeDiffConstants, Kernel::Logger &logger)
PointingAlong
Type to describe pointing along options.
Helper class which provides the Collimation Length for SANS instruments.