Mantid
Loading...
Searching...
No Matches
ProcessBankData.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
12#include "MantidKernel/Task.h"
13#include "MantidKernel/Timer.h"
14
15#include <memory>
16
17namespace Mantid {
18namespace API {
19class Progress;
20}
21namespace DataHandling {
22class DefaultEventLoader;
23
27public: // API::IFileLoader<Kernel::NexusDescriptor>
47 std::shared_ptr<std::vector<uint32_t>> event_id,
48 std::shared_ptr<std::vector<float>> event_time_of_flight, size_t numEvents, size_t startAt,
49 std::shared_ptr<std::vector<uint64_t>> event_index,
50 std::shared_ptr<BankPulseTimes> thisBankPulseTimes, bool have_weight,
51 std::shared_ptr<std::vector<float>> event_weight, detid_t min_event_id, detid_t max_event_id);
52
53 void run() override;
54
55private:
56 size_t getWorkspaceIndexFromPixelID(const detid_t pixID);
57 size_t getFirstEventIndex(const size_t pulseIndex) const;
58 size_t getLastEventIndex(const size_t pulseIndex, const size_t numPulses) const;
59
63 std::string entry_name;
66 const std::vector<size_t> &pixelID_to_wi_vector;
72 std::shared_ptr<std::vector<uint32_t>> event_id;
74 std::shared_ptr<std::vector<float>> event_time_of_flight;
76 size_t numEvents;
78 size_t startAt;
80 std::shared_ptr<std::vector<uint64_t>> event_index;
82 std::shared_ptr<BankPulseTimes> thisBankPulseTimes;
86 std::shared_ptr<std::vector<float>> event_weight;
93}; // ENDDEF-CLASS ProcessBankData
94} // namespace DataHandling
95} // namespace Mantid
Helper class for reporting progress from algorithms.
Definition: Progress.h:25
Helper class for LoadEventNexus that is specific to the current default loading code for NXevent_data...
This task does the disk IO from loading the NXS file, and so will be on a disk IO mutex.
size_t getWorkspaceIndexFromPixelID(const detid_t pixID)
Get the workspace index for a given pixel ID.
std::shared_ptr< std::vector< float > > event_weight
event weights array
bool have_weight
Flag for simulated data.
size_t getFirstEventIndex(const size_t pulseIndex) const
Mantid::Kernel::Timer m_timer
timer for performance
DefaultEventLoader & m_loader
Algorithm being run.
detid_t m_max_id
Maximum pixel id.
std::shared_ptr< std::vector< uint64_t > > event_index
vector of event index (length of # of pulses)
std::string entry_name
NXS path to bank.
size_t startAt
index of the first event from event_index
std::shared_ptr< std::vector< uint32_t > > event_id
event pixel ID array
detid_t m_min_id
Minimum pixel id.
detid_t pixelID_to_wi_offset
Offset in the pixelID_to_wi_vector to use.
std::shared_ptr< std::vector< float > > event_time_of_flight
event TOF array
const std::vector< size_t > & pixelID_to_wi_vector
Vector where (index = pixel ID+pixelID_to_wi_offset), value = workspace index)
API::Progress * prog
Progress reporting.
std::shared_ptr< BankPulseTimes > thisBankPulseTimes
Pulse times for this bank.
size_t getLastEventIndex(const size_t pulseIndex, const size_t numPulses) const
void run() override
Run the data processing FIXME/TODO - split run() into readable methods.
A Task is a unit of work to be scheduled and run by a ThreadPool.
Definition: Task.h:29
A simple class that provides a wall-clock (not processor time) timer.
Definition: Timer.h:27
Helper class which provides the Collimation Length for SANS instruments.
int32_t detid_t
Typedef for a detector ID.
Definition: SpectrumInfo.h:21