|
Mantid
|
PulseIndexer contains information for mapping from pulse index/number to event index. More...
#include <PulseIndexer.h>
Classes | |
| struct | Iterator |
| struct | IteratorValue |
Public Member Functions | |
| Iterator | begin () const |
| const Iterator | cbegin () const |
| const Iterator | cend () const |
| Iterator | end () const |
| std::pair< size_t, size_t > | getEventIndexRange (const size_t pulseIndex) const |
| The range of event(tof,detid) indices to read for this pulse. | |
| size_t | getFirstPulseIndex () const |
| Which element in the event_index array is the first one to use. | |
| size_t | getLastPulseIndex () const |
| Which element in the event_index array is the last one to use. | |
| size_t | getStartEventIndex (const size_t pulseIndex) const |
| The first event(tof,detid) index to read for this pulse. | |
| size_t | getStopEventIndex (const size_t pulseIndex) const |
| The one past the last event(tof,detid) index to read for this pulse. | |
| PulseIndexer (std::shared_ptr< std::vector< uint64_t > const > const &event_index, const std::size_t firstEventIndex, const std::size_t numEvents, const std::string &entry_name, const std::vector< size_t > &pulse_roi) | |
Private Member Functions | |
| size_t | determineFirstPulseIndex () const |
| This performs a linear search because it is much more likely that the index to look for is at the beginning. | |
| size_t | determineLastPulseIndex () const |
| This looks at the event_indexes and number of events to read then determines what is the maximum pulse to use. | |
| bool | includedPulse (const size_t pulseIndex) const |
| returns true when the roi says the pulse should be used | |
| PulseIndexer () | |
Private Attributes | |
| const std::string | m_entry_name |
| Name of the NXentry to be used in exceptions. | |
| const std::shared_ptr< std::vector< uint64_t > const > | m_event_index |
| vector of indices (length of # of pulses) into the event arrays | |
| std::size_t | m_firstEventIndex |
| How far into the array of events the tof/detid are already. | |
| std::size_t | m_numEvents |
| Total number of events tof/detid that should be processed. | |
| std::size_t | m_numPulses |
| Total number of pulsetime/pulseindex. | |
| std::vector< std::size_t > | m_roi |
| Alternating values describe ranges of [use, don't) of pulse index ranges. | |
| bool | m_roi_complex |
| true when there is more to check than the pulse being between the ends | |
PulseIndexer contains information for mapping from pulse index/number to event index.
The events come in two sets of parallel arrays:
In general, NUM_PULSE<NUM_EVENT, but this is not true for "dark count" measurements.
Once configured, this allows for the caller to start at the first index into the pulse information, then get the range of event [inclusive, exclusive) detid and tof to iterate through.
Definition at line 33 of file PulseIndexer.h.
| Mantid::DataHandling::PulseIndexer::PulseIndexer | ( | std::shared_ptr< std::vector< uint64_t > const > const & | event_index, |
| const std::size_t | firstEventIndex, | ||
| const std::size_t | numEvents, | ||
| const std::string & | entry_name, | ||
| const std::vector< size_t > & | pulse_roi | ||
| ) |
Definition at line 14 of file PulseIndexer.cpp.
References Mantid::Kernel::ROI::calculate_intersection(), determineFirstPulseIndex(), determineLastPulseIndex(), getEventIndexRange(), m_event_index, m_numEvents, m_numPulses, m_roi, and m_roi_complex.
|
private |
| PulseIndexer::Iterator Mantid::DataHandling::PulseIndexer::begin | ( | ) | const |
Definition at line 238 of file PulseIndexer.cpp.
References getFirstPulseIndex().
| const PulseIndexer::Iterator Mantid::DataHandling::PulseIndexer::cbegin | ( | ) | const |
Definition at line 230 of file PulseIndexer.cpp.
References getFirstPulseIndex().
| const PulseIndexer::Iterator Mantid::DataHandling::PulseIndexer::cend | ( | ) | const |
Definition at line 234 of file PulseIndexer.cpp.
References getLastPulseIndex().
|
private |
This performs a linear search because it is much more likely that the index to look for is at the beginning.
Definition at line 82 of file PulseIndexer.cpp.
References m_event_index, and m_firstEventIndex.
Referenced by PulseIndexer().
|
private |
This looks at the event_indexes and number of events to read then determines what is the maximum pulse to use.
Definition at line 122 of file PulseIndexer.cpp.
References m_event_index, m_firstEventIndex, and m_numEvents.
Referenced by PulseIndexer().
| PulseIndexer::Iterator Mantid::DataHandling::PulseIndexer::end | ( | ) | const |
Definition at line 240 of file PulseIndexer.cpp.
References getLastPulseIndex().
| std::pair< size_t, size_t > Mantid::DataHandling::PulseIndexer::getEventIndexRange | ( | const size_t | pulseIndex | ) | const |
The range of event(tof,detid) indices to read for this pulse.
Definition at line 146 of file PulseIndexer.cpp.
References getStartEventIndex(), getStopEventIndex(), m_entry_name, m_event_index, m_firstEventIndex, and m_numEvents.
Referenced by Mantid::DataHandling::PulseIndexer::Iterator::calculateEventRange(), and PulseIndexer().
| size_t Mantid::DataHandling::PulseIndexer::getFirstPulseIndex | ( | ) | const |
Which element in the event_index array is the first one to use.
Definition at line 143 of file PulseIndexer.cpp.
References m_roi.
| size_t Mantid::DataHandling::PulseIndexer::getLastPulseIndex | ( | ) | const |
Which element in the event_index array is the last one to use.
Definition at line 144 of file PulseIndexer.cpp.
References m_roi.
| size_t Mantid::DataHandling::PulseIndexer::getStartEventIndex | ( | const size_t | pulseIndex | ) | const |
The first event(tof,detid) index to read for this pulse.
When this is after the event indices to use, it returns the value of getStopEventIndex. This is only public for testing.
Definition at line 166 of file PulseIndexer.cpp.
References getStopEventIndex(), m_firstEventIndex, and m_roi.
Referenced by getEventIndexRange(), and getStopEventIndex().
| size_t Mantid::DataHandling::PulseIndexer::getStopEventIndex | ( | const size_t | pulseIndex | ) | const |
The one past the last event(tof,detid) index to read for this pulse.
When this is not a pulse index to use, it returns the value of getStartEventIndex. When the pulseIndex is past the end of the use regions, it returns the m_numEvents. This is only public for testing.
Definition at line 205 of file PulseIndexer.cpp.
References getStartEventIndex(), includedPulse(), m_event_index, m_firstEventIndex, m_numEvents, and m_roi.
Referenced by getEventIndexRange(), and getStartEventIndex().
|
private |
returns true when the roi says the pulse should be used
Definition at line 187 of file PulseIndexer.cpp.
References m_roi, and m_roi_complex.
Referenced by getStopEventIndex().
|
private |
Name of the NXentry to be used in exceptions.
Definition at line 138 of file PulseIndexer.h.
Referenced by getEventIndexRange().
|
private |
vector of indices (length of # of pulses) into the event arrays
Definition at line 107 of file PulseIndexer.h.
Referenced by determineFirstPulseIndex(), determineLastPulseIndex(), getEventIndexRange(), getStopEventIndex(), and PulseIndexer().
|
private |
How far into the array of events the tof/detid are already.
This is used when data is read in chunks. It is generally taken from the zeroth element of the event_index array, but is also used for chunking by pulse-time.
Another way to think of this value is the offset into the tof/detid arrays from disk that are actually in memory. Because of this, all indices into the event arrays (tof/detid) have this value subtracted off.
Definition at line 117 of file PulseIndexer.h.
Referenced by determineFirstPulseIndex(), determineLastPulseIndex(), getEventIndexRange(), getStartEventIndex(), and getStopEventIndex().
|
private |
Total number of events tof/detid that should be processed.
This can be less than the total number of events in the actual array. This value plus the m_firstEventIndex should be <= the total events in the NXevent_data being processed.
Definition at line 124 of file PulseIndexer.h.
Referenced by determineLastPulseIndex(), getEventIndexRange(), getStopEventIndex(), and PulseIndexer().
|
private |
Total number of pulsetime/pulseindex.
Definition at line 135 of file PulseIndexer.h.
Referenced by PulseIndexer().
|
private |
Alternating values describe ranges of [use, don't) of pulse index ranges.
There will always be a gap between neighboring values.
Definition at line 130 of file PulseIndexer.h.
Referenced by getFirstPulseIndex(), getLastPulseIndex(), getStartEventIndex(), getStopEventIndex(), includedPulse(), and PulseIndexer().
|
private |
true when there is more to check than the pulse being between the ends
Definition at line 132 of file PulseIndexer.h.
Referenced by includedPulse(), and PulseIndexer().