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
13#include "MantidAlgorithms/DllConfig.h"
16#include <cstddef>
17
18namespace Mantid {
19namespace Algorithms {
20
21class MANTID_ALGORITHMS_DLL CreateDetectorTable final : public API::Algorithm {
22public:
26 const std::string name() const override { return "CreateDetectorTable"; }
28 int version() const override { return 1; }
30 const std::string category() const override { return "Utility\\Workspaces"; }
32 const std::string summary() const override {
33 return "Create a table showing detector information for the given "
34 "workspace and optionally the data for that detector";
35 }
36 std::map<std::string, std::string> validateInputs() override;
37
39 void setup();
40 void createColumns();
41 void populateTable();
42 void populateTableByDetID();
43 void setTableToOutput();
44
45private:
47 std::vector<int> workspaceIndices;
52 bool calcQ;
58 bool showSignedTwoTheta; // If true, signedVersion of the two theta
60 double sampleDist;
63 int wsIndex = 0;
64 int specNo = 0;
65 std::set<int> detIds;
66 std::string timeIndexes;
67 std::string isMonitor;
68 double dataY0 = 0, dataE0 = 0;
69 double R = 0, theta = 0, q = 0, phi = 0;
70 double difa = 0, difc = 0, difcUnc = 0, tzero = 0;
71 Kernel::V3D detPosition{0, 0, 0};
72 };
73
74 void init() override;
76 void exec() override;
77
78 void getSphericalCoordinates(size_t wsIndex, double &R, double &theta, double &phi);
79 const std::string getTimeIndexes(size_t wsIndex);
80 double getQ(size_t wsIndex);
81 void getDiffConst(size_t wsIndex, double &difa, double &difc, double &difcUnc, double &tzero);
82 void writeRowToTable(const int row, const DetectorRowData &data);
83 DetectorRowData calculateWsIdxData(size_t wsIndex);
84};
85
87std::string createTruncatedList(const std::set<int> &elements);
88
89} // namespace Algorithms
90} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
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.
const Geometry::DetectorInfo * detectorInfo
Geometry::DetectorInfo is an intermediate step towards a DetectorInfo that is part of Instrument-2....
Class for 3D vectors.
Definition V3D.h:34
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.
PointingAlong
Type to describe pointing along options.
Helper class which provides the Collimation Length for SANS instruments.