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"
19
21
24class MANTID_DATAHANDLING_DLL AlignAndFocusPowderSlim : public API::Algorithm {
25public:
26 const std::string name() const override;
27 int version() const override;
28 const std::string category() const override;
29 const std::string summary() const override;
30 const std::vector<std::string> seeAlso() const override;
31
32private:
33 void init() override;
34 std::map<std::string, std::string> validateInputs() override;
35 void exec() override;
36
37 void determineBanksToLoad(const Mantid::Nexus::NexusDescriptor &descriptor, std::vector<std::string> &bankEntryNames,
38 std::vector<std::string> &bankNames);
39 void initializeOutputWorkspace(const API::MatrixWorkspace_sptr &wksp, size_t num_hist);
40 SpectraProcessingData initializeSpectraProcessingData(const API::MatrixWorkspace_sptr &outputWS);
41 void storeSpectraProcessingData(const SpectraProcessingData &processingData,
42 const API::MatrixWorkspace_sptr &outputWS);
43 API::MatrixWorkspace_sptr editInstrumentGeometry(API::MatrixWorkspace_sptr &wksp, const double l1,
44 const std::vector<double> &polars,
45 const std::vector<specnum_t> &specids,
46 const std::vector<double> &l2s,
47 const std::vector<double> &azimuthals);
49 void initCalibrationConstants(API::MatrixWorkspace_sptr &wksp, const std::vector<double> &difc_focus);
50 void initCalibrationConstantsFromCalWS(const std::vector<double> &difc_focus,
51 const API::ITableWorkspace_sptr calibrationWS);
52 const API::ITableWorkspace_sptr loadCalFile(const API::Workspace_sptr &inputWS, const std::string &filename,
54 void initScaleAtSample(const API::MatrixWorkspace_sptr &wksp);
55 std::vector<std::pair<size_t, size_t>> determinePulseIndices(const Kernel::TimeROI &filterROI);
56 std::vector<std::pair<int, std::pair<size_t, size_t>>>
57 determinePulseIndicesTargets(const Kernel::TimeROI &filterROI, const DataObjects::TimeSplitter &timeSplitter);
58 Kernel::TimeROI getFilterROI(const API::MatrixWorkspace_sptr &wksp);
59 DataObjects::TimeSplitter timeSplitterFromSplitterWorkspace(const Types::Core::DateAndTime &);
60
61 std::map<detid_t, double> m_calibration;
66 std::map<detid_t, double> m_scale_at_sample;
67 std::set<detid_t> m_masked;
68 bool is_time_filtered{false};
70 std::vector<int64_t> loadStart;
72 std::vector<int64_t> loadSize;
73 // map of detectorID to output spectrum number
74 std::map<detid_t, size_t> detIDToSpecNum;
75 // pulse times
76 std::shared_ptr<std::vector<Types::Core::DateAndTime>> m_pulse_times;
77};
78
79// these properties are public to simplify testing and calling from other code
80namespace PropertyNames {
81const std::string FILENAME("Filename");
82const std::string CAL_FILE("CalFileName");
83const std::string FILTER_TIMESTART("FilterByTimeStart");
84const std::string FILTER_TIMESTOP("FilterByTimeStop");
85const std::string GROUPING_WS("GroupingWorkspace");
86const std::string SPLITTER_WS("SplitterWorkspace");
87const std::string SPLITTER_RELATIVE("RelativeTime");
88const std::string CORRECTION_TO_SAMPLE("CorrectionToSample");
89const std::string PROCESS_BANK_SPLIT_TASK("ProcessBankSplitTask");
90const std::string FULL_TIME("UseFullTime");
91const std::string FILTER_BAD_PULSES("FilterBadPulses");
92const std::string FILTER_BAD_PULSES_LOWER_CUTOFF("BadPulsesLowerCutoff");
93const std::string X_MIN("XMin");
94const std::string X_MAX("XMax");
95const std::string X_DELTA("XDelta");
96const std::string BIN_UNITS("BinningUnits");
97const std::string BINMODE("BinningMode");
98const std::string OUTPUT_WKSP("OutputWorkspace");
99const std::string READ_SIZE_FROM_DISK("ReadSizeFromDisk");
100const std::string EVENTS_PER_THREAD("EventsPerThread");
101const std::string ALLOW_LOGS("LogAllowList");
102const std::string BLOCK_LOGS("LogBlockList");
103const std::string BANK_NUMBER("BankNumber");
104// focus positions
105const std::string L1("L1");
106const std::string L2("L2");
107const std::string POLARS("Polar");
108const std::string AZIMUTHALS("Azimuthal");
109} // namespace PropertyNames
110
111} // 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 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