Mantid
Loading...
Searching...
No Matches
ProcessBankSplitFullTimeTask.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2025 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
10#include "MantidDataHandling/DllConfig.h"
13#include <H5Cpp.h>
14#include <MantidAPI/Progress.h>
15#include <map>
16#include <set>
17#include <tbb/tbb.h>
18#include <vector>
19
21
22// We need to include additional pulses because time-of-flight can be greater than a couple of pulse periods.
23// This is in nanoseconds. So four pulses of 1/60s is 66666666 ns.
24const int64_t PULSETIME_OFFSET = 66666666;
25
26class MANTID_DATAHANDLING_DLL ProcessBankSplitFullTimeTask {
27public:
28 ProcessBankSplitFullTimeTask(std::vector<std::string> &bankEntryNames, H5::H5File &h5file,
29 const bool is_time_filtered, std::vector<int> &workspaceIndices,
30 std::vector<API::MatrixWorkspace_sptr> &wksps,
31 const std::map<detid_t, double> &calibration,
32 const std::map<detid_t, double> &scale_at_sample, const std::set<detid_t> &masked,
33 const size_t events_per_chunk, const size_t grainsize_event,
34 const std::vector<PulseROI> &pulse_indices,
35 const std::map<Mantid::Types::Core::DateAndTime, int> &splitterMap,
36 std::shared_ptr<API::Progress> &progress);
37
38 // Constructor with custom loader to allow mocking in tests
39 ProcessBankSplitFullTimeTask(std::vector<std::string> &bankEntryNames, H5::H5File &h5file,
40 std::shared_ptr<NexusLoader> loader, std::vector<int> &workspaceIndices,
41 std::vector<API::MatrixWorkspace_sptr> &wksps,
42 const std::map<detid_t, double> &calibration,
43 const std::map<detid_t, double> &scale_at_sample, const std::set<detid_t> &masked,
44 const size_t events_per_chunk, const size_t grainsize_event,
45 const std::map<Mantid::Types::Core::DateAndTime, int> &splitterMap,
46 std::shared_ptr<API::Progress> &progress);
47
48 void operator()(const tbb::blocked_range<size_t> &range) const;
49
50private:
51 H5::H5File m_h5file;
52 const std::vector<std::string> m_bankEntries;
53 std::shared_ptr<NexusLoader> m_loader;
54 std::vector<int> m_workspaceIndices;
55 std::vector<API::MatrixWorkspace_sptr> m_wksps;
56 const std::map<detid_t, double> m_calibration; // detid: 1/difc
57 std::map<detid_t, double> m_scale_at_sample;
58 const std::set<detid_t> m_masked;
60 const size_t m_events_per_chunk;
61 const std::map<Mantid::Types::Core::DateAndTime, int> m_splitterMap;
63 const size_t m_grainsize_event;
64 std::shared_ptr<API::Progress> m_progress;
65};
66} // namespace Mantid::DataHandling::AlignAndFocusPowderSlim
const size_t m_grainsize_event
number of events to histogram in a single thread
const size_t m_events_per_chunk
number of events to read from disk at one time
std::map< detid_t, double > m_scale_at_sample
multiplicative 0<value<1 to move neutron TOF at sample