Mantid
Loading...
Searching...
No Matches
SortHKL.h
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 +
7#pragma once
8
12
14
17
21
22namespace Mantid {
23namespace Crystal {
24
30class MANTID_CRYSTAL_DLL SortHKL final : public API::Algorithm {
31public:
32 SortHKL();
33 ~SortHKL() override;
34
36 const std::string name() const override { return "SortHKL"; };
38 const std::string summary() const override {
39 return "Sorts a PeaksWorkspace by HKL. Averages intensities using point "
40 "group.";
41 }
42
44 int version() const override { return 1; };
45 const std::vector<std::string> seeAlso() const override { return {"TransformHKL"}; }
47 const std::string category() const override { return R"(Crystal\Peaks;DataHandling\Text;Utility\Sorting)"; }
48
49private:
50 void init() override;
51 void exec() override;
52
53 std::vector<DataObjects::Peak> getNonZeroPeaks(const std::vector<DataObjects::Peak> &inputPeaks) const;
54
55 PeakStatisticsTools::UniqueReflectionCollection getUniqueReflections(const std::vector<DataObjects::Peak> &peaks,
56 const Geometry::UnitCell &cell) const;
57
58 Geometry::ReflectionCondition_sptr getCentering() const;
59 Geometry::PointGroup_sptr getPointgroup() const;
60
61 std::pair<double, double> getDLimits(const std::vector<DataObjects::Peak> &peaks,
62 const Geometry::UnitCell &cell) const;
63
64 API::ITableWorkspace_sptr getStatisticsTable(const std::string &name) const;
65 void insertStatisticsIntoTable(const API::ITableWorkspace_sptr &table,
66 const PeakStatisticsTools::PeaksStatistics &statistics) const;
67
69 getOutputPeaksWorkspace(const DataObjects::PeaksWorkspace_sptr &inputPeaksWorkspace) const;
70
71 void sortOutputPeaksByHKL(const API::IPeaksWorkspace_sptr &outputPeaksWorkspace);
72
74 std::vector<Mantid::Geometry::PointGroup_sptr> m_pointGroups;
75
77 std::vector<Mantid::Geometry::ReflectionCondition_sptr> m_refConds;
78};
79
80} // namespace Crystal
81} // namespace Mantid
std::string name
Definition Run.cpp:60
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
The PeaksStatistics class is a small helper class that is used in SortHKL.
This class computes all possible unique reflections within the specified d-limits,...
Save a PeaksWorkspace to a Gsas-style ASCII .hkl file.
Definition SortHKL.h:30
const std::string summary() const override
Summary of algorithms purpose.
Definition SortHKL.h:38
std::vector< Mantid::Geometry::ReflectionCondition_sptr > m_refConds
Reflection conditions.
Definition SortHKL.h:77
const std::string category() const override
Algorithm's category for identification.
Definition SortHKL.h:47
int version() const override
Algorithm's version for identification.
Definition SortHKL.h:44
const std::string name() const override
Algorithm's name for identification.
Definition SortHKL.h:36
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition SortHKL.h:45
std::vector< Mantid::Geometry::PointGroup_sptr > m_pointGroups
Point Groups possible.
Definition SortHKL.h:74
Class to implement unit cell of crystals.
Definition UnitCell.h:44
std::shared_ptr< IPeaksWorkspace > IPeaksWorkspace_sptr
shared pointer to Mantid::API::IPeaksWorkspace
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< PeaksWorkspace > PeaksWorkspace_sptr
Typedef for a shared pointer to a peaks workspace.
std::shared_ptr< ReflectionCondition > ReflectionCondition_sptr
Shared pointer to a ReflectionCondition.
std::shared_ptr< PointGroup > PointGroup_sptr
Shared pointer to a PointGroup.
Definition PointGroup.h:69
Helper class which provides the Collimation Length for SANS instruments.