Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::DataHandling::ProcessBankData Class Reference

This task does the disk IO from loading the NXS file, and so will be on a disk IO mutex. More...

#include <ProcessBankData.h>

Inheritance diagram for Mantid::DataHandling::ProcessBankData:
Mantid::Kernel::Task

Public Member Functions

 ProcessBankData (DefaultEventLoader &loader, const std::string &entry_name, API::Progress *prog, std::shared_ptr< std::vector< uint32_t > > const &event_id, std::shared_ptr< std::vector< float > > const &event_time_of_flight, size_t numEvents, size_t startAt, std::shared_ptr< std::vector< uint64_t > > const &event_index, std::shared_ptr< BankPulseTimes > const &thisBankPulseTimes, bool have_weight, std::shared_ptr< std::vector< float > > const &event_weight, detid_t min_event_id, detid_t max_event_id)
 Constructor.
 
void run () override
 Run the data processing FIXME/TODO - split run() into readable methods.
 
- Public Member Functions inherited from Mantid::Kernel::Task
virtual double cost ()
 What is the computational cost of this task?
 
std::shared_ptr< std::mutex > getMutex ()
 Get the mutex object for this Task.
 
void setMutex (const std::shared_ptr< std::mutex > &mutex)
 Set the mutex object for this Task.
 
void setMutexObject (void *object)
 Use an arbitrary pointer to lock (mutex) the execution of this task.
 
 Task ()
 Default constructor.
 
 Task (double cost)
 Constructor with cost.
 
virtual ~Task ()=default
 Destructor.
 

Private Member Functions

size_t getWorkspaceIndexFromPixelID (const detid_t pixID)
 Get the workspace index for a given pixel ID.
 
void preCountAndReserveMem ()
 

Private Attributes

std::string entry_name
 NXS address to bank.
 
std::shared_ptr< std::vector< uint32_t > const > event_detid
 event pixel ID array
 
std::shared_ptr< std::vector< uint64_t > const > event_index
 vector of event index (length of # of pulses)
 
std::shared_ptr< std::vector< float > const > event_time_of_flight
 event TOF array
 
std::shared_ptr< std::vector< float > const > event_weight
 event weights array
 
bool have_weight
 Flag for simulated data.
 
DefaultEventLoaderm_loader
 Algorithm being run.
 
detid_t m_max_detid
 Maximum pixel id (inclusive)
 
detid_t m_min_detid
 Minimum pixel id (inclusive)
 
size_t numEvents
 
detid_t pixelID_to_wi_offset
 Offset in the pixelID_to_wi_vector to use.
 
const std::vector< size_t > & pixelID_to_wi_vector
 Vector where (index = pixel ID+pixelID_to_wi_offset), value = workspace index)
 
API::Progressprog
 Progress reporting.
 
size_t startAt
 index of the first event from event_index
 
std::shared_ptr< BankPulseTimes const > thisBankPulseTimes
 Pulse times for this bank.
 

Additional Inherited Members

- Protected Attributes inherited from Mantid::Kernel::Task
double m_cost
 Cached computational cost for the thread.
 
std::shared_ptr< std::mutex > m_mutex
 Mutex associated with this task (can be NULL)
 

Detailed Description

This task does the disk IO from loading the NXS file, and so will be on a disk IO mutex.

Definition at line 24 of file ProcessBankData.h.

Constructor & Destructor Documentation

◆ ProcessBankData()

Mantid::DataHandling::ProcessBankData::ProcessBankData ( DefaultEventLoader loader,
const std::string &  entry_name,
API::Progress prog,
std::shared_ptr< std::vector< uint32_t > > const &  event_id,
std::shared_ptr< std::vector< float > > const &  event_time_of_flight,
size_t  numEvents,
size_t  startAt,
std::shared_ptr< std::vector< uint64_t > > const &  event_index,
std::shared_ptr< BankPulseTimes > const &  thisBankPulseTimes,
bool  have_weight,
std::shared_ptr< std::vector< float > > const &  event_weight,
detid_t  min_event_id,
detid_t  max_event_id 
)

Constructor.

Parameters
loader:: DefaultEventLoader
entry_name:: name of the bank
prog:: Progress reporter
event_id:: array with event IDs
event_time_of_flight:: array with event TOFS
numEvents:: how many events in the arrays
startAt:: index of the first event from event_index
event_index:: vector of event index (length of # of pulses)
thisBankPulseTimes:: ptr to the pulse times for this particular bank.
have_weight:: flag for handling simulated files
event_weight:: array with weights for events
min_event_id;: minimum detector ID to load
max_event_id:: maximum detector ID to load

Definition at line 19 of file ProcessBankData.cpp.

References Mantid::Kernel::Task::m_cost, m_max_detid, m_min_detid, and numEvents.

Member Function Documentation

◆ getWorkspaceIndexFromPixelID()

size_t Mantid::DataHandling::ProcessBankData::getWorkspaceIndexFromPixelID ( const detid_t  pixID)
private

Get the workspace index for a given pixel ID.

Throws if the pixel ID is not in the expected range.

Parameters
pixID:: The pixel ID to look up
Returns
The workspace index for this pixel

Definition at line 250 of file ProcessBankData.cpp.

References pixelID_to_wi_offset, and pixelID_to_wi_vector.

Referenced by preCountAndReserveMem(), and run().

◆ preCountAndReserveMem()

void Mantid::DataHandling::ProcessBankData::preCountAndReserveMem ( )
private

◆ run()

void Mantid::DataHandling::ProcessBankData::run ( )
overridevirtual

Member Data Documentation

◆ entry_name

std::string Mantid::DataHandling::ProcessBankData::entry_name
private

NXS address to bank.

Definition at line 59 of file ProcessBankData.h.

Referenced by run().

◆ event_detid

std::shared_ptr<std::vector<uint32_t> const> Mantid::DataHandling::ProcessBankData::event_detid
private

event pixel ID array

Definition at line 67 of file ProcessBankData.h.

Referenced by run().

◆ event_index

std::shared_ptr<std::vector<uint64_t> const> Mantid::DataHandling::ProcessBankData::event_index
private

vector of event index (length of # of pulses)

Definition at line 75 of file ProcessBankData.h.

Referenced by run().

◆ event_time_of_flight

std::shared_ptr<std::vector<float> const> Mantid::DataHandling::ProcessBankData::event_time_of_flight
private

event TOF array

Definition at line 69 of file ProcessBankData.h.

Referenced by run().

◆ event_weight

std::shared_ptr<std::vector<float> const> Mantid::DataHandling::ProcessBankData::event_weight
private

event weights array

Definition at line 81 of file ProcessBankData.h.

Referenced by run().

◆ have_weight

bool Mantid::DataHandling::ProcessBankData::have_weight
private

Flag for simulated data.

Definition at line 79 of file ProcessBankData.h.

Referenced by run().

◆ m_loader

DefaultEventLoader& Mantid::DataHandling::ProcessBankData::m_loader
private

Algorithm being run.

Definition at line 57 of file ProcessBankData.h.

Referenced by preCountAndReserveMem(), and run().

◆ m_max_detid

detid_t Mantid::DataHandling::ProcessBankData::m_max_detid
private

Maximum pixel id (inclusive)

Definition at line 85 of file ProcessBankData.h.

Referenced by preCountAndReserveMem(), ProcessBankData(), and run().

◆ m_min_detid

detid_t Mantid::DataHandling::ProcessBankData::m_min_detid
private

Minimum pixel id (inclusive)

Definition at line 83 of file ProcessBankData.h.

Referenced by preCountAndReserveMem(), ProcessBankData(), and run().

◆ numEvents

size_t Mantid::DataHandling::ProcessBankData::numEvents
private

of events in arrays

Definition at line 71 of file ProcessBankData.h.

Referenced by preCountAndReserveMem(), ProcessBankData(), and run().

◆ pixelID_to_wi_offset

detid_t Mantid::DataHandling::ProcessBankData::pixelID_to_wi_offset
private

Offset in the pixelID_to_wi_vector to use.

Definition at line 63 of file ProcessBankData.h.

Referenced by getWorkspaceIndexFromPixelID().

◆ pixelID_to_wi_vector

const std::vector<size_t>& Mantid::DataHandling::ProcessBankData::pixelID_to_wi_vector
private

Vector where (index = pixel ID+pixelID_to_wi_offset), value = workspace index)

Definition at line 61 of file ProcessBankData.h.

Referenced by getWorkspaceIndexFromPixelID().

◆ prog

API::Progress* Mantid::DataHandling::ProcessBankData::prog
private

Progress reporting.

Definition at line 65 of file ProcessBankData.h.

Referenced by run().

◆ startAt

size_t Mantid::DataHandling::ProcessBankData::startAt
private

index of the first event from event_index

Definition at line 73 of file ProcessBankData.h.

Referenced by run().

◆ thisBankPulseTimes

std::shared_ptr<BankPulseTimes const> Mantid::DataHandling::ProcessBankData::thisBankPulseTimes
private

Pulse times for this bank.

Definition at line 77 of file ProcessBankData.h.

Referenced by run().


The documentation for this class was generated from the following files: