Mantid
Loading...
Searching...
No Matches
DiffractionFocussing2.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 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"
13#include "MantidIndexing/SpectrumNumber.h"
14
15namespace Mantid {
16namespace Algorithms {
65class MANTID_ALGORITHMS_DLL DiffractionFocussing2 final : public API::Algorithm {
66public:
68 const std::string name() const override { return "DiffractionFocussing"; }
70 const std::string summary() const override {
71 return "Algorithm to focus powder diffraction data into a number of "
72 "histograms according to a grouping scheme defined in a CalFile.";
73 }
74
76 int version() const override { return 2; }
77 const std::vector<std::string> seeAlso() const override {
78 return {"AlignDetectors", "AlignAndFocusPowder", "LoadCalFile"};
79 }
81 const std::string category() const override { return "Diffraction\\Focussing"; }
82
83private:
84 // Overridden Algorithm methods
85 void init() override;
86 void exec() override;
87 void cleanup();
88
89 std::size_t setupGroupToWSIndices();
90
91 // For events
92 void execEvent();
93
97 void determineRebinParameters();
98 int validateSpectrumInGroup(size_t wi);
99
102
105
108
109 // This map needs to be ordered to process the groups in order.
111 using group2vectormap = std::map<int, std::shared_ptr<MantidVec>>;
113 std::vector<int> udet2group;
115 std::vector<int> groupAtWorkspaceIndex;
117 std::map<int, HistogramData::BinEdges> group2xvector;
121 int64_t nGroups = 0;
123 int nHist = 0;
125 int nPoints = 0;
127 std::vector<std::vector<std::size_t>> m_wsIndices;
129 std::vector<Indexing::SpectrumNumber> m_validGroups;
130};
131
132} // namespace Algorithms
133} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Algorithm to focus powder diffraction data into a number of histograms according to a grouping scheme...
Mantid::DataObjects::GroupingWorkspace_sptr groupWS
Grouping workspace with groups to build.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
std::map< int, HistogramData::BinEdges > group2xvector
Map from the group number to the group's X vector.
DataObjects::EventWorkspace_const_sptr m_eventW
Shared pointer to the event workspace.
std::map< int, std::shared_ptr< MantidVec > > group2vectormap
typedef for the storage of each group's X vector
std::vector< int > groupAtWorkspaceIndex
The list of group numbers.
std::vector< std::vector< std::size_t > > m_wsIndices
Mapping of group number to vector of inputworkspace indices.
std::vector< Indexing::SpectrumNumber > m_validGroups
List of valid group numbers.
const std::string summary() const override
Summary of algorithms purpose.
std::vector< int > udet2group
Map from udet to group.
group2vectormap group2wgtvector
Map from the group number to the group's summed weight vector.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
int version() const override
Algorithm's version for identification overriding a virtual method.
API::MatrixWorkspace_const_sptr m_matrixInputW
Shared pointer to the input workspace.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< const EventWorkspace > EventWorkspace_const_sptr
shared pointer to a const Workspace2D
std::shared_ptr< GroupingWorkspace > GroupingWorkspace_sptr
shared pointer to the GroupingWorkspace class
Helper class which provides the Collimation Length for SANS instruments.