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
8#pragma once
9
15#include "MantidDataHandling/DllConfig.h"
18#include <H5Cpp.h>
19#include <MantidAPI/Progress.h>
20#include <map>
21#include <set>
22#include <tbb/tbb.h>
23#include <vector>
24
26
27// We need to include additional pulses because time-of-flight can be greater than a couple of pulse periods.
28// This is in nanoseconds. So four pulses of 1/60s is 66666666 ns.
29const int64_t PULSETIME_OFFSET = 66666666;
30
31class MANTID_DATAHANDLING_DLL ProcessBankSplitFullTimeTask : public ProcessBankTaskBase {
32public:
33 ProcessBankSplitFullTimeTask(std::vector<std::string> &bankEntryNames, H5::H5File &h5file,
34 std::shared_ptr<NexusLoader> loader, std::vector<int> &workspaceIndices,
35 std::vector<SpectraProcessingData> &processingDatas,
36 const BankCalibrationFactory &calibFactory, const size_t events_per_chunk,
37 const size_t grainsize_event,
38 const std::map<Mantid::Types::Core::DateAndTime, int> &splitterMap,
39 std::shared_ptr<std::vector<Types::Core::DateAndTime>> pulse_times,
40 std::shared_ptr<API::Progress> &progress);
41
42 void operator()(const tbb::blocked_range<size_t> &range) const;
43
44private:
45 H5::H5File m_h5file;
46 std::vector<int> m_workspaceIndices;
47 // Do not copy the processing data (contains atomics which are not copyable).
48 // Store a reference to the externally-owned vector instead.
49 std::vector<SpectraProcessingData> &m_processingDatas;
51 const size_t m_events_per_chunk;
52 const std::map<Mantid::Types::Core::DateAndTime, int> m_splitterMap;
54 const size_t m_grainsize_event;
55 std::shared_ptr<std::vector<Types::Core::DateAndTime>> m_pulse_times;
56 std::shared_ptr<API::Progress> m_progress;
57};
58} // 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::shared_ptr< std::vector< Types::Core::DateAndTime > > m_pulse_times