|
Mantid
|
This task does the disk IO from loading the NXS file, and so will be on a disk IO mutex. More...
#include <ProcessBankData.h>
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. | |
| DefaultEventLoader & | m_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::Progress * | prog |
| 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) | |
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.
| 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.
| 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.
|
private |
Get the workspace index for a given pixel ID.
Throws if the pixel ID is not in the expected range.
| pixID | :: The pixel ID to look up |
Definition at line 250 of file ProcessBankData.cpp.
References pixelID_to_wi_offset, and pixelID_to_wi_vector.
Referenced by preCountAndReserveMem(), and run().
|
private |
Definition at line 44 of file ProcessBankData.cpp.
References Mantid::DataHandling::DefaultEventLoader::alg, getWorkspaceIndexFromPixelID(), m_loader, m_max_detid, m_min_detid, Mantid::DataHandling::DefaultEventLoader::m_ws, and numEvents.
Referenced by run().
|
overridevirtual |
Run the data processing FIXME/TODO - split run() into readable methods.
Implements Mantid::Kernel::Task.
Definition at line 75 of file ProcessBankData.cpp.
References Mantid::DataHandling::DefaultEventLoader::alg, Mantid::Kernel::ROI::calculate_intersection(), entry_name, event_detid, event_index, event_time_of_flight, event_weight, Mantid::DataHandling::DefaultEventLoader::eventVectors, Mantid::API::Algorithm::getCancel(), Mantid::DataHandling::EventWorkspaceCollection::getNumberHistograms(), getWorkspaceIndexFromPixelID(), have_weight, m_loader, m_max_detid, m_min_detid, Mantid::DataHandling::DefaultEventLoader::m_ws, numEvents, Mantid::DataHandling::DefaultEventLoader::precount, preCountAndReserveMem(), prog, Mantid::DataObjects::PULSETIME_SORT, Mantid::Kernel::ProgressBase::report(), Mantid::Kernel::Timer::reset(), startAt, thisBankPulseTimes, Mantid::DataObjects::UNSORTED, and Mantid::DataHandling::DefaultEventLoader::weightedEventVectors.
|
private |
|
private |
|
private |
vector of event index (length of # of pulses)
Definition at line 75 of file ProcessBankData.h.
Referenced by run().
|
private |
|
private |
|
private |
|
private |
Algorithm being run.
Definition at line 57 of file ProcessBankData.h.
Referenced by preCountAndReserveMem(), and run().
|
private |
Maximum pixel id (inclusive)
Definition at line 85 of file ProcessBankData.h.
Referenced by preCountAndReserveMem(), ProcessBankData(), and run().
|
private |
Minimum pixel id (inclusive)
Definition at line 83 of file ProcessBankData.h.
Referenced by preCountAndReserveMem(), ProcessBankData(), and run().
|
private |
Definition at line 71 of file ProcessBankData.h.
Referenced by preCountAndReserveMem(), ProcessBankData(), and run().
|
private |
Offset in the pixelID_to_wi_vector to use.
Definition at line 63 of file ProcessBankData.h.
Referenced by getWorkspaceIndexFromPixelID().
|
private |
Vector where (index = pixel ID+pixelID_to_wi_offset), value = workspace index)
Definition at line 61 of file ProcessBankData.h.
Referenced by getWorkspaceIndexFromPixelID().
|
private |
|
private |
index of the first event from event_index
Definition at line 73 of file ProcessBankData.h.
Referenced by run().
|
private |