Mantid
Loading...
Searching...
No Matches
AlignAndFocusPowderSlim.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2024 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
13#include "MantidDataHandling/DllConfig.h"
20
22
25class MANTID_DATAHANDLING_DLL AlignAndFocusPowderSlim : public API::Algorithm {
26public:
27 const std::string name() const override;
28 int version() const override;
29 const std::string category() const override;
30 const std::string summary() const override;
31 const std::vector<std::string> seeAlso() const override;
32
33private:
34 void init() override;
35 std::map<std::string, std::string> validateInputs() override;
36 void exec() override;
37
38 void determineBanksToLoad(const Mantid::Nexus::NexusDescriptor &descriptor, std::vector<std::string> &bankEntryNames,
39 std::vector<std::string> &bankNames);
40 void initializeOutputWorkspace(const API::MatrixWorkspace_sptr &wksp, size_t num_hist);
41 SpectraProcessingData initializeSpectraProcessingData(const API::MatrixWorkspace_sptr &outputWS);
42 void storeSpectraProcessingData(const SpectraProcessingData &processingData,
43 const API::MatrixWorkspace_sptr &outputWS);
44 API::MatrixWorkspace_sptr editInstrumentGeometry(API::MatrixWorkspace_sptr &wksp, const double l1,
45 const std::vector<double> &polars,
46 const std::vector<specnum_t> &specids,
47 const std::vector<double> &l2s,
48 const std::vector<double> &azimuthals);
50 void initCalibrationConstants(API::MatrixWorkspace_sptr &wksp, const std::vector<double> &difc_focus);
51 void initCalibrationConstantsFromCalWS(const std::vector<double> &difc_focus,
52 const API::ITableWorkspace_sptr calibrationWS);
53 void loadCalFile(const API::Workspace_sptr &inputWS, const std::string &filename,
57 const std::string &filename);
58 void initScaleAtSample(const API::MatrixWorkspace_sptr &wksp);
59 std::vector<std::pair<size_t, size_t>> determinePulseIndices(const Kernel::TimeROI &filterROI);
60 std::vector<std::pair<int, std::pair<size_t, size_t>>>
61 determinePulseIndicesTargets(const Kernel::TimeROI &filterROI, const DataObjects::TimeSplitter &timeSplitter);
62 Kernel::TimeROI getFilterROI(const API::MatrixWorkspace_sptr &wksp);
63 DataObjects::TimeSplitter timeSplitterFromSplitterWorkspace(const Types::Core::DateAndTime &);
64
65 std::map<detid_t, double> m_calibration;
70 std::map<detid_t, double> m_scale_at_sample;
71 std::set<detid_t> m_masked;
72 bool is_time_filtered{false};
74 std::vector<int64_t> loadStart;
76 std::vector<int64_t> loadSize;
77 // map of detectorID to output spectrum number
78 std::map<detid_t, size_t> detIDToSpecNum;
79 // pulse times
80 std::shared_ptr<std::vector<Types::Core::DateAndTime>> m_pulse_times;
81};
82
83// these properties are public to simplify testing and calling from other code
84namespace PropertyNames {
85const std::string FILENAME("Filename");
86const std::string CAL_FILE("CalFileName");
87const std::string CAL_WKSP("CalibrationWorkspace");
88const std::string MASK_WKSP("MaskWorkspace");
89const std::string FILTER_TIMESTART("FilterByTimeStart");
90const std::string FILTER_TIMESTOP("FilterByTimeStop");
91const std::string GROUPING_WS("GroupingWorkspace");
92const std::string GROUP_FILE("GroupFilename");
93const std::string SPLITTER_WS("SplitterWorkspace");
94const std::string SPLITTER_RELATIVE("RelativeTime");
95const std::string CORRECTION_TO_SAMPLE("CorrectionToSample");
96const std::string PROCESS_BANK_SPLIT_TASK("ProcessBankSplitTask");
97const std::string FULL_TIME("UseFullTime");
98const std::string FILTER_BAD_PULSES("FilterBadPulses");
99const std::string FILTER_BAD_PULSES_LOWER_CUTOFF("BadPulsesLowerCutoff");
100const std::string X_MIN("XMin");
101const std::string X_MAX("XMax");
102const std::string X_DELTA("XDelta");
103const std::string BIN_UNITS("BinningUnits");
104const std::string BINMODE("BinningMode");
105const std::string OUTPUT_WKSP("OutputWorkspace");
106const std::string READ_SIZE_FROM_DISK("ReadSizeFromDisk");
107const std::string EVENTS_PER_THREAD("EventsPerThread");
108const std::string ALLOW_LOGS("LogAllowList");
109const std::string BLOCK_LOGS("LogBlockList");
110const std::string BANK_NUMBER("BankNumber");
111// focus positions
112const std::string L1("L1");
113const std::string L2("L2");
114const std::string POLARS("Polar");
115const std::string AZIMUTHALS("Azimuthal");
116} // namespace PropertyNames
117
118} // namespace Mantid::DataHandling::AlignAndFocusPowderSlim
std::string name
Definition Run.cpp:60
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
std::vector< int64_t > loadStart
Index to load start at in the file.
std::shared_ptr< std::vector< Types::Core::DateAndTime > > m_pulse_times
std::map< detid_t, double > m_scale_at_sample
Multiplicative 0<value<1 to move neutron TOF at sample.
TimeROI : Object that holds information about when the time measurement was active.
Definition TimeROI.h:18
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
const std::string GROUPING_WS("GroupingWorkspace")
const std::string FILTER_TIMESTART("FilterByTimeStart")
const std::string FILTER_BAD_PULSES_LOWER_CUTOFF("BadPulsesLowerCutoff")
const std::string PROCESS_BANK_SPLIT_TASK("ProcessBankSplitTask")
const std::string CORRECTION_TO_SAMPLE("CorrectionToSample")
const std::string CAL_WKSP("CalibrationWorkspace")
const std::string FILTER_TIMESTOP("FilterByTimeStop")
const std::string SPLITTER_WS("SplitterWorkspace")
const std::string EVENTS_PER_THREAD("EventsPerThread")
const std::string FILTER_BAD_PULSES("FilterBadPulses")
const std::string READ_SIZE_FROM_DISK("ReadSizeFromDisk")
std::shared_ptr< GroupingWorkspace > GroupingWorkspace_sptr
shared pointer to the GroupingWorkspace class
std::shared_ptr< MaskWorkspace > MaskWorkspace_sptr
shared pointer to the MaskWorkspace class