Mantid
Loading...
Searching...
No Matches
FindSXPeaks.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/Algorithm.h"
14#include "MantidCrystal/DllConfig.h"
17
18#include <vector>
19
20namespace Mantid {
21namespace Crystal {
22
23using peakvector = std::vector<FindSXPeaksHelper::SXPeak>;
24
38class MANTID_CRYSTAL_DLL FindSXPeaks final : public API::Algorithm {
39public:
43 const std::string name() const override { return "FindSXPeaks"; }
45 const std::string summary() const override {
46 return "Takes a 2D workspace as input and finds the highest intensity "
47 "point in each 1D spectrum. This is used in particular for single "
48 "crystal as a quick way to find strong peaks.";
49 }
50
52 int version() const override { return (1); }
53 const std::vector<std::string> seeAlso() const override { return {"IndexSXPeaks"}; }
55 const std::string category() const override { return "Crystal\\Peaks;Optimization\\PeakFinding"; }
56
57 static const std::string strongestPeakStrategy;
58 static const std::string allPeaksStrategy;
59 static const std::string relativeResolutionStrategy;
60 static const std::string absoluteResolutionPeaksStrategy;
61
62private:
63 // Overridden Algorithm methods
64 void init() override;
65 void exec() override;
66 std::map<std::string, std::string> validateInputs() override;
67
69 std::unique_ptr<FindSXPeaksHelper::BackgroundStrategy> getBackgroundStrategy() const;
70
72 std::unique_ptr<FindSXPeaksHelper::PeakFindingStrategy>
73 getPeakFindingStrategy(const FindSXPeaksHelper::BackgroundStrategy *backgroundStrategy,
74 const API::SpectrumInfo &spectrumInfo, const double minValue, const double maxValue,
75 const FindSXPeaksHelper::XAxisUnit tofUnits = FindSXPeaksHelper::XAxisUnit::TOF) const;
76
78 std::unique_ptr<FindSXPeaksHelper::ReducePeakListStrategy>
79 getReducePeakListStrategy(const FindSXPeaksHelper::CompareStrategy *compareStrategy) const;
80
82 std::unique_ptr<FindSXPeaksHelper::CompareStrategy> getCompareStrategy() const;
83
84 //
85 void reducePeakList(const peakvector &, Mantid::API::Progress &progress);
86
89
91 double m_MinRange;
93 double m_MaxRange;
98 // The peaks workspace that contains the peaks information.
100};
101
102} // namespace Crystal
103} // namespace Mantid
double maxValue
double minValue
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Helper class for reporting progress from algorithms.
Definition: Progress.h:25
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2....
Definition: SpectrumInfo.h:53
Search detector space for single crystal peaks.
Definition: FindSXPeaks.h:38
static const std::string absoluteResolutionPeaksStrategy
Definition: FindSXPeaks.h:60
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: FindSXPeaks.h:43
Mantid::DataObjects::PeaksWorkspace_sptr m_peaks
Definition: FindSXPeaks.h:99
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: FindSXPeaks.h:52
size_t m_MaxWsIndex
The spectrum to finish the integration at.
Definition: FindSXPeaks.h:97
const std::string summary() const override
Summary of algorithms purpose.
Definition: FindSXPeaks.h:45
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition: FindSXPeaks.h:55
double m_MinRange
The value in X to start the search from.
Definition: FindSXPeaks.h:91
double m_MaxRange
The value in X to finish the search at.
Definition: FindSXPeaks.h:93
static const std::string strongestPeakStrategy
Definition: FindSXPeaks.h:57
static const std::string relativeResolutionStrategy
Definition: FindSXPeaks.h:59
static const std::string allPeaksStrategy
Definition: FindSXPeaks.h:58
size_t m_MinWsIndex
The spectrum to start the integration from.
Definition: FindSXPeaks.h:95
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: FindSXPeaks.h:53
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
XAxisUnit
enum to determine the units of the workspaces X axis we are searching in
std::vector< FindSXPeaksHelper::SXPeak > peakvector
Definition: FindSXPeaks.h:23
std::shared_ptr< PeaksWorkspace > PeaksWorkspace_sptr
Typedef for a shared pointer to a peaks workspace.
Helper class which provides the Collimation Length for SANS instruments.