Mantid
Loading...
Searching...
No Matches
IntegratePeaksCWSD.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
16#include "MantidMDAlgorithms/DllConfig.h"
17
18namespace Mantid {
19namespace MDAlgorithms {
20
26class MANTID_MDALGORITHMS_DLL IntegratePeaksCWSD final : public API::Algorithm, public API::DeprecatedAlgorithm {
27public:
29
31 const std::string name() const override { return "IntegratePeaksCWSD"; }
32
34 const std::string summary() const override {
35 return "Integrate single-crystal peaks in reciprocal space, for "
36 "MDEventWorkspaces from reactor-source single crystal "
37 "diffractometer.";
38 }
39
41 int version() const override { return 1; }
42 const std::vector<std::string> seeAlso() const override {
43 return {"IntegratePeaksHybrid", "IntegratePeaksMDHKL", "IntegratePeaksMD", "IntegratePeaksUsingClusters"};
44 }
45
47 const std::string category() const override { return "MDAlgorithms\\Peaks;Crystal\\Integration"; }
48
49private:
51 void init() override;
53 void exec() override;
54
56 void processInputs();
57
58 void simplePeakIntegration(const std::vector<detid_t> &vecMaskedDetID,
59 const std::map<int, signal_t> &run_monitor_map);
60 template <typename MDE, size_t nd>
62 const std::map<uint16_t, signal_t> &run_monitor_map);
63
65 std::map<int, signal_t> getMonitorCounts();
66
68 std::map<int, double> getMeasureTime();
69
70 std::vector<detid_t> processMaskWorkspace(const DataObjects::MaskWorkspace_const_sptr &maskws);
71
72 void getPeakInformation();
73
75
76 void mergePeaks();
77
79 void normalizePeaksIntensities();
80
81 DataObjects::PeaksWorkspace_sptr createPeakworkspace(Kernel::V3D peakCenter, const API::IMDEventWorkspace_sptr &mdws);
82
85
88
92 std::map<int, double> m_runNormMap;
93
94 std::map<int, Kernel::V3D> m_runPeakCenterMap;
100 bool m_normalizeByTime; // NormalizeByTime
101 double m_scaleFactor; // ScaleFactor
102
104 std::vector<DataObjects::Peak> m_vecPeaks;
106 std::map<int, double> m_runPeakCountsMap;
107
109 std::vector<detid_t> vecMaskedDetID;
110
113};
114
115} // namespace MDAlgorithms
116} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
Class for marking algorithms as deprecated.
std::shared_ptr< MDEventWorkspace< MDE, nd > > sptr
Typedef for a shared pointer of this kind of event workspace.
Class for 3D vectors.
Definition V3D.h:34
Integrate single-crystal peaks in reciprocal-space.
const std::string name() const override
Algorithm's name for identification.
Mantid::DataObjects::PeaksWorkspace_sptr m_peaksWS
Input PeaksWorkspace.
Mantid::API::IMDEventWorkspace_sptr m_inputWS
Input MDEventWorkspace.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
std::map< int, double > m_runPeakCountsMap
Integrated peaks' intensity per run number.
void integrate(typename DataObjects::MDEventWorkspace< MDE, nd >::sptr ws, const std::map< uint16_t, signal_t > &run_monitor_map)
std::map< int, Kernel::V3D > m_runPeakCenterMap
DataObjects::MaskWorkspace_sptr m_maskWS
std::vector< DataObjects::Peak > m_vecPeaks
Peaks.
std::map< int, double > m_runNormMap
a map for run number and normalization value (monitor or time)
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version for identification.
const std::string summary() const override
Summary of algorithms purpose.
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< const MaskWorkspace > MaskWorkspace_const_sptr
shared pointer to a const MaskWorkspace
std::shared_ptr< MaskWorkspace > MaskWorkspace_sptr
shared pointer to the MaskWorkspace class
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.