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

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

LoadEventNexusalg
 
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...
 
EventWorkspaceCollectionm_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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DefaultEventLoader()

Mantid::DataHandling::DefaultEventLoader::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 
)
private

Member Function Documentation

◆ load()

void Mantid::DataHandling::DefaultEventLoader::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 
)
static

◆ makeMapToEventLists()

template<class T >
void Mantid::DataHandling::DefaultEventLoader::makeMapToEventLists ( std::vector< std::vector< T > > &  vectors)
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.

Parameters
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().

◆ setupChunking()

std::pair< size_t, size_t > Mantid::DataHandling::DefaultEventLoader::setupChunking ( std::vector< std::string > &  bankNames,
std::vector< std::size_t > &  bankNumEvents 
)
private

Definition at line 76 of file DefaultEventLoader.cpp.

References chunk, Mantid::EMPTY_INT(), eventsPerChunk, firstChunkForBank, tmp, and totalChunks.

Referenced by load().

Member Data Documentation

◆ alg

LoadEventNexus* Mantid::DataHandling::DefaultEventLoader::alg

◆ chunk

int Mantid::DataHandling::DefaultEventLoader::chunk

◆ event_id_is_spec

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().

◆ eventid_max

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().

◆ eventsPerChunk

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().

◆ eventVectors

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().

◆ firstChunkForBank

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().

◆ m_bankPulseTimes

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().

◆ m_haveWeights

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().

◆ m_ws

EventWorkspaceCollection& Mantid::DataHandling::DefaultEventLoader::m_ws

◆ pixelID_to_wi_offset

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().

◆ pixelID_to_wi_vector

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().

◆ precount

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().

◆ splitProcessing

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().

◆ totalChunks

int Mantid::DataHandling::DefaultEventLoader::totalChunks

number of chunks

Definition at line 51 of file DefaultEventLoader.h.

Referenced by load(), and setupChunking().

◆ weightedEventVectors

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().


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