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
15#include "MantidMDAlgorithms/DllConfig.h"
16
17namespace Mantid {
18namespace MDAlgorithms {
19
25class MANTID_MDALGORITHMS_DLL IntegratePeaksCWSD final : public API::Algorithm {
26public:
28
30 const std::string name() const override { return "IntegratePeaksCWSD"; }
31
33 const std::string summary() const override {
34 return "Integrate single-crystal peaks in reciprocal space, for "
35 "MDEventWorkspaces from reactor-source single crystal "
36 "diffractometer.";
37 }
38
40 int version() const override { return 1; }
41 const std::vector<std::string> seeAlso() const override {
42 return {"IntegratePeaksHybrid", "IntegratePeaksMDHKL", "IntegratePeaksMD", "IntegratePeaksUsingClusters"};
43 }
44
46 const std::string category() const override { return "MDAlgorithms\\Peaks;Crystal\\Integration"; }
47
48private:
50 void init() override;
52 void exec() override;
53
55 void processInputs();
56
57 void simplePeakIntegration(const std::vector<detid_t> &vecMaskedDetID,
58 const std::map<int, signal_t> &run_monitor_map);
59 template <typename MDE, size_t nd>
61 const std::map<uint16_t, signal_t> &run_monitor_map);
62
64 std::map<int, signal_t> getMonitorCounts();
65
67 std::map<int, double> getMeasureTime();
68
69 std::vector<detid_t> processMaskWorkspace(const DataObjects::MaskWorkspace_const_sptr &maskws);
70
71 void getPeakInformation();
72
74
75 void mergePeaks();
76
78 void normalizePeaksIntensities();
79
80 DataObjects::PeaksWorkspace_sptr createPeakworkspace(Kernel::V3D peakCenter, const API::IMDEventWorkspace_sptr &mdws);
81
84
87
91 std::map<int, double> m_runNormMap;
92
93 std::map<int, Kernel::V3D> m_runPeakCenterMap;
99 bool m_normalizeByTime; // NormalizeByTime
100 double m_scaleFactor; // ScaleFactor
101
103 std::vector<DataObjects::Peak> m_vecPeaks;
105 std::map<int, double> m_runPeakCountsMap;
106
108 std::vector<detid_t> vecMaskedDetID;
109
112};
113
114} // namespace MDAlgorithms
115} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
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
Definition: MaskWorkspace.h:67
std::shared_ptr< MaskWorkspace > MaskWorkspace_sptr
shared pointer to the MaskWorkspace class
Definition: MaskWorkspace.h:64
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.