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

Private Member Functions

size_t getFirstEventIndex (const size_t pulseIndex) const
 
size_t getLastEventIndex (const size_t pulseIndex, const size_t numPulses) const
 
size_t getWorkspaceIndexFromPixelID (const detid_t pixID)
 Get the workspace index for a given pixel ID. More...
 

Private Attributes

std::string entry_name
 NXS path to bank. More...
 
std::shared_ptr< std::vector< uint32_t > > event_id
 event pixel ID array More...
 
std::shared_ptr< std::vector< uint64_t > > event_index
 vector of event index (length of # of pulses) More...
 
std::shared_ptr< std::vector< float > > event_time_of_flight
 event TOF array More...
 
std::shared_ptr< std::vector< float > > event_weight
 event weights array More...
 
bool have_weight
 Flag for simulated data. More...
 
DefaultEventLoaderm_loader
 Algorithm being run. More...
 
detid_t m_max_id
 Maximum pixel id. More...
 
detid_t m_min_id
 Minimum pixel id. More...
 
Mantid::Kernel::Timer m_timer
 timer for performance More...
 
size_t numEvents
 
detid_t pixelID_to_wi_offset
 Offset in the pixelID_to_wi_vector to use. More...
 
const std::vector< size_t > & pixelID_to_wi_vector
 Vector where (index = pixel ID+pixelID_to_wi_offset), value = workspace index) More...
 
API::Progressprog
 Progress reporting. More...
 
size_t startAt
 index of the first event from event_index More...
 
std::shared_ptr< BankPulseTimesthisBankPulseTimes
 Pulse times for this bank. More...
 

Additional Inherited Members

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

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 26 of file ProcessBankData.h.

Constructor & Destructor Documentation

◆ ProcessBankData()

Mantid::DataHandling::ProcessBankData::ProcessBankData ( DefaultEventLoader loader,
std::string  entry_name,
API::Progress prog,
std::shared_ptr< std::vector< uint32_t > >  event_id,
std::shared_ptr< std::vector< float > >  event_time_of_flight,
size_t  numEvents,
size_t  startAt,
std::shared_ptr< std::vector< uint64_t > >  event_index,
std::shared_ptr< BankPulseTimes thisBankPulseTimes,
bool  have_weight,
std::shared_ptr< std::vector< float > >  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
Returns

Definition at line 17 of file ProcessBankData.cpp.

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

Member Function Documentation

◆ getFirstEventIndex()

size_t Mantid::DataHandling::ProcessBankData::getFirstEventIndex ( const size_t  pulseIndex) const
private

Definition at line 241 of file ProcessBankData.cpp.

References event_index, and startAt.

Referenced by run().

◆ getLastEventIndex()

size_t Mantid::DataHandling::ProcessBankData::getLastEventIndex ( const size_t  pulseIndex,
const size_t  numPulses 
) const
private

Definition at line 249 of file ProcessBankData.cpp.

References event_index, numEvents, and startAt.

Referenced by run().

◆ 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 265 of file ProcessBankData.cpp.

References pixelID_to_wi_offset, and pixelID_to_wi_vector.

Referenced by run().

◆ run()

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

Member Data Documentation

◆ entry_name

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

NXS path to bank.

Definition at line 63 of file ProcessBankData.h.

Referenced by run().

◆ event_id

std::shared_ptr<std::vector<uint32_t> > Mantid::DataHandling::ProcessBankData::event_id
private

event pixel ID array

Definition at line 72 of file ProcessBankData.h.

Referenced by run().

◆ event_index

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

vector of event index (length of # of pulses)

Definition at line 80 of file ProcessBankData.h.

Referenced by getFirstEventIndex(), getLastEventIndex(), and run().

◆ event_time_of_flight

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

event TOF array

Definition at line 74 of file ProcessBankData.h.

◆ event_weight

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

event weights array

Definition at line 86 of file ProcessBankData.h.

◆ have_weight

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

Flag for simulated data.

Definition at line 84 of file ProcessBankData.h.

Referenced by run().

◆ m_loader

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

Algorithm being run.

Definition at line 61 of file ProcessBankData.h.

Referenced by run().

◆ m_max_id

detid_t Mantid::DataHandling::ProcessBankData::m_max_id
private

Maximum pixel id.

Definition at line 90 of file ProcessBankData.h.

Referenced by run().

◆ m_min_id

detid_t Mantid::DataHandling::ProcessBankData::m_min_id
private

Minimum pixel id.

Definition at line 88 of file ProcessBankData.h.

Referenced by run().

◆ m_timer

Mantid::Kernel::Timer Mantid::DataHandling::ProcessBankData::m_timer
private

timer for performance

Definition at line 92 of file ProcessBankData.h.

Referenced by run().

◆ numEvents

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

of events in arrays

Definition at line 76 of file ProcessBankData.h.

Referenced by getLastEventIndex(), 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 68 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 66 of file ProcessBankData.h.

Referenced by getWorkspaceIndexFromPixelID().

◆ prog

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

Progress reporting.

Definition at line 70 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 78 of file ProcessBankData.h.

Referenced by getFirstEventIndex(), getLastEventIndex(), and run().

◆ thisBankPulseTimes

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

Pulse times for this bank.

Definition at line 82 of file ProcessBankData.h.

Referenced by run().


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