A view of the positions of a sequence of events, as a matrix of one row per event and one column per axis.
More...
#include <vitrio/detector_event_position_view.hpp>
|
| | detector_event_position_view (span< const std::uint32_t > coordinates, std::size_t rank) |
| | Construct a view of coordinates held row after row.
|
| std::size_t | get_rank () const noexcept |
| | Get the number of coordinates each event carries.
|
| std::size_t | get_event_count () const noexcept |
| | Get the number of events viewed.
|
| bool | empty () const noexcept |
| | Check whether no event is viewed.
|
| span< const std::uint32_t > | get (std::size_t event) const noexcept |
| | Get the position of one event.
|
| std::uint32_t | operator() (std::size_t event, std::size_t axis) const noexcept |
| | Get one coordinate of one event.
|
| detector_event_position_view | get_events (std::size_t first, std::size_t count) const noexcept |
| | Get the positions of a run of the events viewed.
|
| span< const std::uint32_t > | get_coordinates () const noexcept |
| | Get every coordinate viewed, row after row.
|
A view of the positions of a sequence of events, as a matrix of one row per event and one column per axis.
The coordinates are held row after row, those of one event after those of the one before, slowest axis first within a row. Each is counted in the position quanta of a detector_event_timeline_descriptor.
A view is a pointer, a size and a rank, as cheap to copy as a span, and what it views must outlive it. It never owns or changes the coordinates.
- See also
- detector_event_timeline
◆ detector_event_position_view()
| vitrio::detector_event_position_view::detector_event_position_view |
( |
span< const std::uint32_t > | coordinates, |
|
|
std::size_t | rank ) |
Construct a view of coordinates held row after row.
- Parameters
-
| coordinates | The coordinates of every event, those of one event after another. |
| rank | Number of coordinates each event carries. |
- Exceptions
-
| std::invalid_argument | If rank is zero, or if the number of coordinates is not a multiple of it. |
◆ empty()
| bool vitrio::detector_event_position_view::empty |
( |
| ) |
const |
|
noexcept |
Check whether no event is viewed.
- Returns
- true There are no rows.
-
false There is at least one.
◆ get()
| span< const std::uint32_t > vitrio::detector_event_position_view::get |
( |
std::size_t | event | ) |
const |
|
noexcept |
◆ get_coordinates()
| span< const std::uint32_t > vitrio::detector_event_position_view::get_coordinates |
( |
| ) |
const |
|
noexcept |
◆ get_event_count()
| std::size_t vitrio::detector_event_position_view::get_event_count |
( |
| ) |
const |
|
noexcept |
Get the number of events viewed.
- Returns
- std::size_t The number of rows.
◆ get_events()
Get the positions of a run of the events viewed.
- Parameters
-
| first | Index of the first event of the run. |
| count | Number of events from there. The run must not reach past get_event_count. |
- Returns
- detector_event_position_view A view of the run, of the same rank.
◆ get_rank()
| std::size_t vitrio::detector_event_position_view::get_rank |
( |
| ) |
const |
|
noexcept |
Get the number of coordinates each event carries.
- Returns
- std::size_t The rank, the number of columns. Never zero.
◆ operator()()
| std::uint32_t vitrio::detector_event_position_view::operator() |
( |
std::size_t | event, |
|
|
std::size_t | axis ) const |
|
noexcept |
Get one coordinate of one event.
- Parameters
-
- Returns
- std::uint32_t The coordinate.
The documentation for this class was generated from the following file: