Mantid
|
Helper class for LoadEventNexus that is specific to the current default loading code for NXevent_data entries in Nexus files, in particular LoadBankFromDiskTask and ProcessBankData. More...
#include <DefaultEventLoader.h>
Static Public Member Functions | |
static void | load (LoadEventNexus *alg, EventWorkspaceCollection &ws, bool haveWeights, bool event_id_is_spec, std::vector< std::string > bankNames, const std::vector< int > &periodLog, const std::string &classType, std::vector< std::size_t > bankNumEvents, const bool oldNeXusFileNames, const bool precount, const int chunk, const int totalChunks) |
Public Attributes | |
LoadEventNexus * | alg |
int | chunk |
chunk number More... | |
bool | event_id_is_spec |
True if the event_id is spectrum no not pixel ID. More... | |
int32_t | eventid_max {0} |
Maximum (inclusive) event ID possible for this instrument. More... | |
size_t | eventsPerChunk |
number of chunks per bank More... | |
std::vector< std::vector< std::vector< Mantid::Types::Event::TofEvent > * > > | eventVectors |
Vector where index = event_id; value = ptr to std::vector<TofEvent> in the event list. More... | |
int | firstChunkForBank |
for multiple chunks per bank More... | |
std::vector< std::shared_ptr< BankPulseTimes > > | m_bankPulseTimes |
One entry of pulse times for each preprocessor. More... | |
bool | m_haveWeights |
Flag for dealing with a simulated file. More... | |
EventWorkspaceCollection & | m_ws |
detid_t | pixelID_to_wi_offset |
Offset in the pixelID_to_wi_vector to use. More... | |
std::vector< size_t > | pixelID_to_wi_vector |
Vector where (index = pixel ID+pixelID_to_wi_offset), value = workspace index) More... | |
bool | precount |
Do we pre-count the # of events in each pixel ID? More... | |
bool | splitProcessing |
whether or not to launch multiple ProcessBankData jobs per bank More... | |
int | totalChunks |
number of chunks More... | |
std::vector< std::vector< std::vector< Mantid::DataObjects::WeightedEvent > * > > | weightedEventVectors |
Vector where index = event_id; value = ptr to std::vector<WeightedEvent> in the event list. More... | |
Private Member Functions | |
DefaultEventLoader (LoadEventNexus *alg, EventWorkspaceCollection &ws, bool haveWeights, bool event_id_is_spec, const size_t numBanks, const bool precount, const int chunk, const int totalChunks) | |
template<class T > | |
void | makeMapToEventLists (std::vector< std::vector< T > > &vectors) |
Map detector IDs to event lists. More... | |
std::pair< size_t, size_t > | setupChunking (std::vector< std::string > &bankNames, std::vector< std::size_t > &bankNumEvents) |
Helper class for LoadEventNexus that is specific to the current default loading code for NXevent_data entries in Nexus files, in particular LoadBankFromDiskTask and ProcessBankData.
Definition at line 23 of file DefaultEventLoader.h.
|
private |
Definition at line 49 of file DefaultEventLoader.cpp.
References event_id_is_spec, eventVectors, Mantid::DataHandling::EventWorkspaceCollection::getDetectorIDToWorkspaceIndexVector(), Mantid::DataHandling::EventWorkspaceCollection::getNumberHistograms(), Mantid::Kernel::ThreadPool::getNumPhysicalCores(), Mantid::DataHandling::EventWorkspaceCollection::getSpectrum(), Mantid::DataHandling::EventWorkspaceCollection::getSpectrumToWorkspaceIndexVector(), m_ws, makeMapToEventLists(), pixelID_to_wi_offset, pixelID_to_wi_vector, splitProcessing, Mantid::DataObjects::EventList::switchTo(), Mantid::API::WEIGHTED, and weightedEventVectors.
|
static |
Definition at line 18 of file DefaultEventLoader.cpp.
References alg, chunk, event_id_is_spec, Mantid::Kernel::ThreadPool::joinAll(), precount, Mantid::Kernel::ThreadPool::schedule(), setupChunking(), splitProcessing, and totalChunks.
|
private |
Map detector IDs to event lists.
Generate a look-up table where the index = the pixel ID of an event and the value = a pointer to the EventList in the workspace.
vectors | :: the array to create the map on |
Definition at line 87 of file DefaultEventLoader.h.
References event_id_is_spec, eventid_max, Mantid::DataHandling::EventWorkspaceCollection::getAxis(), Mantid::DataObjects::getEventsFrom(), Mantid::DataHandling::EventWorkspaceCollection::getNumberHistograms(), Mantid::DataHandling::EventWorkspaceCollection::getSpectrum(), m_ws, Mantid::DataHandling::EventWorkspaceCollection::nPeriods(), pixelID_to_wi_offset, and pixelID_to_wi_vector.
Referenced by DefaultEventLoader().
|
private |
Definition at line 76 of file DefaultEventLoader.cpp.
References chunk, Mantid::EMPTY_INT(), eventsPerChunk, firstChunkForBank, tmp, and totalChunks.
Referenced by load().
LoadEventNexus* Mantid::DataHandling::DefaultEventLoader::alg |
Definition at line 57 of file DefaultEventLoader.h.
Referenced by load(), Mantid::DataHandling::LoadBankFromDiskTask::loadEventId(), Mantid::DataHandling::LoadBankFromDiskTask::loadEventIndex(), Mantid::DataHandling::LoadBankFromDiskTask::loadEventWeights(), Mantid::DataHandling::LoadBankFromDiskTask::loadPulseTimes(), Mantid::DataHandling::LoadBankFromDiskTask::loadTof(), Mantid::DataHandling::LoadBankFromDiskTask::prepareEventId(), Mantid::DataHandling::LoadBankFromDiskTask::run(), and Mantid::DataHandling::ProcessBankData::run().
int Mantid::DataHandling::DefaultEventLoader::chunk |
chunk number
Definition at line 49 of file DefaultEventLoader.h.
Referenced by load(), Mantid::DataHandling::LoadBankFromDiskTask::prepareEventId(), and setupChunking().
bool Mantid::DataHandling::DefaultEventLoader::event_id_is_spec |
True if the event_id is spectrum no not pixel ID.
Definition at line 34 of file DefaultEventLoader.h.
Referenced by DefaultEventLoader(), load(), and makeMapToEventLists().
int32_t Mantid::DataHandling::DefaultEventLoader::eventid_max {0} |
Maximum (inclusive) event ID possible for this instrument.
Definition at line 46 of file DefaultEventLoader.h.
Referenced by Mantid::DataHandling::LoadBankFromDiskTask::loadEventId(), and makeMapToEventLists().
size_t Mantid::DataHandling::DefaultEventLoader::eventsPerChunk |
number of chunks per bank
Definition at line 55 of file DefaultEventLoader.h.
Referenced by Mantid::DataHandling::LoadBankFromDiskTask::prepareEventId(), and setupChunking().
std::vector<std::vector<std::vector<Mantid::Types::Event::TofEvent> *> > Mantid::DataHandling::DefaultEventLoader::eventVectors |
Vector where index = event_id; value = ptr to std::vector<TofEvent> in the event list.
Definition at line 62 of file DefaultEventLoader.h.
Referenced by DefaultEventLoader(), and Mantid::DataHandling::ProcessBankData::run().
int Mantid::DataHandling::DefaultEventLoader::firstChunkForBank |
for multiple chunks per bank
Definition at line 53 of file DefaultEventLoader.h.
Referenced by Mantid::DataHandling::LoadBankFromDiskTask::prepareEventId(), and setupChunking().
std::vector<std::shared_ptr<BankPulseTimes> > Mantid::DataHandling::DefaultEventLoader::m_bankPulseTimes |
One entry of pulse times for each preprocessor.
Definition at line 73 of file DefaultEventLoader.h.
Referenced by Mantid::DataHandling::LoadBankFromDiskTask::loadPulseTimes().
bool Mantid::DataHandling::DefaultEventLoader::m_haveWeights |
Flag for dealing with a simulated file.
Definition at line 31 of file DefaultEventLoader.h.
Referenced by Mantid::DataHandling::LoadBankFromDiskTask::run().
EventWorkspaceCollection& Mantid::DataHandling::DefaultEventLoader::m_ws |
Definition at line 58 of file DefaultEventLoader.h.
Referenced by DefaultEventLoader(), makeMapToEventLists(), and Mantid::DataHandling::ProcessBankData::run().
detid_t Mantid::DataHandling::DefaultEventLoader::pixelID_to_wi_offset |
Offset in the pixelID_to_wi_vector to use.
Definition at line 43 of file DefaultEventLoader.h.
Referenced by DefaultEventLoader(), Mantid::DataHandling::LoadBankFromDiskTask::loadEventId(), and makeMapToEventLists().
std::vector<size_t> Mantid::DataHandling::DefaultEventLoader::pixelID_to_wi_vector |
Vector where (index = pixel ID+pixelID_to_wi_offset), value = workspace index)
Definition at line 70 of file DefaultEventLoader.h.
Referenced by DefaultEventLoader(), and makeMapToEventLists().
bool Mantid::DataHandling::DefaultEventLoader::precount |
Do we pre-count the # of events in each pixel ID?
Definition at line 40 of file DefaultEventLoader.h.
Referenced by load(), and Mantid::DataHandling::ProcessBankData::run().
bool Mantid::DataHandling::DefaultEventLoader::splitProcessing |
whether or not to launch multiple ProcessBankData jobs per bank
Definition at line 37 of file DefaultEventLoader.h.
Referenced by DefaultEventLoader(), load(), and Mantid::DataHandling::LoadBankFromDiskTask::run().
int Mantid::DataHandling::DefaultEventLoader::totalChunks |
number of chunks
Definition at line 51 of file DefaultEventLoader.h.
Referenced by load(), and setupChunking().
std::vector<std::vector<std::vector<Mantid::DataObjects::WeightedEvent> *> > Mantid::DataHandling::DefaultEventLoader::weightedEventVectors |
Vector where index = event_id; value = ptr to std::vector<WeightedEvent> in the event list.
Definition at line 66 of file DefaultEventLoader.h.
Referenced by DefaultEventLoader(), and Mantid::DataHandling::ProcessBankData::run().